1

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.

2

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).

  • Can you suggest some good libraries for the same? @RaghavSood – shubham saxena Aug 12 at 5:57
  • 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 Aug 12 at 5:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.