<p>A proof of reserve via invalid input is not necessarily constructable by regular means, due to a few reasons.</p>

<ol>
<li>Proving you own all utxos in a single tx may result in a tx that is too large - while this isn't a problem for the proof, any sane wallet will refuse to construct such a tx</li>
<li>Using invalid inputs by definition requires you to sign an invalid tx - any sane wallet will also disallow this.</li>
<li>In trivial cases, a proof via invalid inputs is unnecessary - if all your coins reside in p2pkh addresses or simple multisig addresses, a single signed message signed with all the keys involved (along with appropriate redeemscripts) is sufficient.</li>
</ol>

<p>That said, if you really do want to use a proof of reserve with invalid inputs, you can construct a raw transaction consuming all the inputs, add an invalid inputs (a utxo that doesn't exist, or has already been spent), and then sign it with any bitcoin signing tool or library - any tool that supports offline signing should have little trouble signing it (although you may still get hit by validation issues if the resulting tx is too large).</p>

CC BY-SA 4.0
2019-08-12T05:57:11.207Z
Can you suggest some good libraries for the same? @RaghavSood
Shubham Saxena
CC BY-SA 4.0
2019-08-12T05:59:14.507Z
That depends entirely on the language you wish to use, but most BTC-related libraries (btcsuite for go, bitcoin-js for javascript, etc). support signing arbitrary txs offline.
Raghav Sood
CC BY-SA 4.0
2019-08-08T11:26:08.130Z
2019-08-08T11:26:08.130Z
Raghav Sood
<p>I recently came across the topic where exchanges have to constantly give a proof of solvency to prove that they hold enough bitcoin for it's clients. I was however intrigued by the way an exchange would give a proof of reserves. I was trying to build a script for generating the proof of reserves using the Invalid input scheme to prove the reserves of bitcoin a node holds. Are there any resources which I can refer to for the same?I have been struggling to find any. Any help would be very much appreciated.</p>

<proof-of-solvency>
Creating my own script for proof of reserves
Shubham Saxena
# Creating my own script for proof of reserves

(Asked by: username_0 on 2019-08-08)

I recently came across the topic where exchanges have to constantly give a proof of solvency to prove that they hold enough bitcoin for it's clients. I was however intrigued by the way an exchange would give a proof of reserves. I was trying to build a script for generating the proof of reserves using the Invalid input scheme to prove the reserves of bitcoin a node holds. Are there any resources which I can refer to for the same?I have been struggling to find any. Any help would be very much appreciated.

**Tags:** proof-of-solvency


---

## 1 answers

### Answer by username_1 on 2019-08-08. Score: 2 | Accepted answer

A proof of reserve via invalid input is not necessarily constructable by regular means, due to a few reasons.

1. Proving you own all utxos in a single tx may result in a tx that is too large - while this isn't a problem for the proof, any sane wallet will refuse to construct such a tx
2. Using invalid inputs by definition requires you to sign an invalid tx - any sane wallet will also disallow this.
3. In trivial cases, a proof via invalid inputs is unnecessary - if all your coins reside in p2pkh addresses or simple multisig addresses, a single signed message signed with all the keys involved (along with appropriate redeemscripts) is sufficient.

That said, if you really do want to use a proof of reserve with invalid inputs, you can construct a raw transaction consuming all the inputs, add an invalid inputs (a utxo that doesn't exist, or has already been spent), and then sign it with any bitcoin signing tool or library - any tool that supports offline signing should have little trouble signing it (although you may still get hit by validation issues if the resulting tx is too large).

> **Comments:**
> **username_0**: Can you suggest some good libraries for the same? @username_1  
> **username_1**: That depends entirely on the language you wish to use, but most BTC-related libraries (btcsuite for go, bitcoin-js for javascript, etc). support signing arbitrary txs offline.  

---

