GaloyMoney / blink

bitcoin banking infrastructure
https://galoy.io
MIT License
362 stars 138 forks source link

proof of reserve #191

Closed nicolasburtey closed 1 year ago

nicolasburtey commented 3 years ago

Reach out on slack if you're interested in the bounty

Proof of reserve is key for the success of bitcoin. To understand why, some useful reading: https://niccarter.info/wp-content/uploads/Proof-of-Reserves-.pdf

https://github.com/olalonde/proof-of-assets https://blockstream.com/2019/02/04/en-standardizing-bitcoin-proof-of-reserves/

Some idea of how this could be rolled out progressively:

Step 1 (proof of liabilities): Proof of reserve with public account listing. This is what Coinfloor is currently doing. one hash per user, so that each user can verify that their balance has been included correctly

Step 2 (proof of reserve): For every UTXO on our onchain wallet, sign a message showing the wallet own the UTXO For lnd wallet, more research is being needed: https://github.com/lightningnetwork/lnd/issues/5391 (TODO: look at how this should be published?)

Step 3 (better proof of liabilities): Instead of publishing the whole list of hashed user with amount, use a merkle tree and only published the merkle root. This would require adding an API so that the user can send his hash, and can receive the merkle path and the balance so that the client can verify that their balance has been included themselves

Step 4 (zero knowledge proof: improve the privacy by not disclosing the total amount): This is the difficult part. Step 2 and 3 involves that the total amount is published to the world (or the user at least). This would be preferable to have a proof that the total assets is >= than the total liabilities without having to disclose the total balance.

dolcalmi commented 3 years ago

Idea for Proof of Liabilities

Use blockcerts algorithm to create the Merkle tree proposed in step 3

Steps to create the proof

  1. Create a hash for each wallet (id of wallet or username, balance, date, time)
  2. Create a Merkle tree
  3. Save the Merkle tree path for each user, it could be and additional field in user schema or just a plain file uploaded to a publicly available storage (in this case we cant make the proof with the username)

or just use the blockcert library

  1. Include the Merkle root hash in the same procedure of proof of reserve

Steps to validate

  1. Add an additional setting in mobile app to:
    • allow the user to download the proof of reserve (for his/her wallet)
    • view the content of the proof/certificate
  2. Create and publish a validation tool or... just copy or use blockcerts validation tool
nicolasburtey commented 3 years ago

https://blog.bitmex.com/addressing-the-privacy-gap-in-proof-of-liability-protocols/

dolcalmi commented 3 years ago

https://blog.bitmex.com/addressing-the-privacy-gap-in-proof-of-liability-protocols/

https://github.com/BitMEX/proof-of-reserves-liabilities

jrbuhl93 commented 3 years ago

https://blog.bitmex.com/proof-of-reserves-liabilities-bitmex-demonstration/

nicolasburtey commented 2 years ago

Should be looked at: https://github.com/jakecraige/provisions

sandipndev commented 1 year ago

@nicolasburtey can we close this?

nicolasburtey commented 1 year ago

I think so but we should copy the documentation/link maybe to the poof of sats repo in a RESEARCH.md (or another better name)

nicolasburtey commented 1 year ago

this will be implemented in other layers (bria, cala) so closing this ticket.