How can I verify my collateral on-chain?

One of the key benefits of borrowing with Lava is that you can independently verify your bitcoin collateral on-chain.

Just open your loan in the Lava app and click the “View On-Chain” button. You’ll see the collateral address and its full value, directly on the Bitcoin blockchain.

This gives you cryptographic proof, not just legal or reputational assurances, that your collateral is not rehypothecated and your bitcoin is locked in a bitcoin smart contract.

If you want to verify that the script is a 2 of 2, it’s very easy. For a closed loan, the witness script is published on-chain and easy to inspect. It will look something like:

For an active loan, you need to go from this to the funding address, so that you can confirm that it matches with what you see on-chain.

You first need to encode the script to hexadecimal. Note you'll need your borrower pubkey and the lender pubkey. Scroll down to figure out how to get that. Then, you can encode the script using this page. This will give you something like:

Note that you need to replace the two OP_PUSHNUM_2 by OP_2 for things to work, so the tool can encode the script properly.

The second step is to compute the SHA256 of the hexadecimal representation of the script. You can do that on this page. In our example, you obtain the value 29eb9946db49c3f5ac370ff449bd64d4f32960909fdb44504540c9a65673262d .

With this, you can then compute the P2WSH script used in the funding output:

In the same page as before you can derive the bitcoin address for this script, which in our example is: bc1q984ej3kmf8plttphpl6yn0ty6nejjcysnld5g5z9gry6v4nnycksv8a70m .

If you want to access the keys in the 2-of-2 for an active loan (for advanced users, there's a trick you can use to figure it out on your own), you can reach out to us to send you your borrower pubkey, the lender pubkey, and even the derivation path for the borrower pubkey for your verification. Feel free to contact us at concierge@lava.xyz.

Since the pubkeys change for each loan to preserve privacy, there will be different pubkeys per loan. Also note that the lender pubkey for each loan will be different to preserve privacy. Be careful with your mnemonic and do not accidentally expose your mnemonic at any point in this process.

Scan to Download