olalonde / proof-of-solvency

Proof of Solvency (PoS) is a scheme designed to let users verify the solvency of online websites which accept Bitcoin (or other similar currency) deposits (e.g. exchange websites, online wallets, gambling websites, etc.) in a way that doesn't compromise the privacy of users.
MIT License
71 stars 9 forks source link

Proof of Solvency

Proof of Solvency specification and Javascript implementation.

Proof of Solvency (PoS) is a scheme designed to let users verify the solvency of online websites which accept Bitcoin (or other similar currency) deposits (e.g. exchange websites, online wallets, gambling websites, etc.) in a way that doesn't compromise the privacy of users.

This scheme is based on the Proof Of Liabilities and Proof of Assets schemes.

Table of Contents

Proof of Solvency extension

extension screenshot

Table of Contents

Specification

Work in progress.

Liabilites proof

The liabilities proof is done using the scheme described at olalonde/proof-of-liabilities.

Embedded:

PS: The x-liabilities-proof-root must be available on the index page (domain.com/) of the domain name and should be retrievable by non logged in visitors.

<meta name="x-liabilities-proof" data="/account/btc-partial-tree.json">
<meta name="x-liabilities-proof-root" data="/btc-root.json">

/acccount/btc-partial-tree.json (different for each user)

{
  "id": "MtGox.com BTC liabilities",
  "partial_tree": { ... }
}

/btc-root.json

{ 
  "id": "MtGox.com BTC liabilities",
  "root": {
    "value": 37618,
    "hash": "2evVTMS8wbF2p5aq1qFETanO24BsnP/eshJxxPHJcug="
  }
}

Assets proof

The assets proof is done using the scheme described at olalonde/proof-of-assets.

Embedded:

<meta name='x-assets-proof' data='/btc-assets.json'>

/btc-assets.json

{
  "id": "MtGox.com BTC assets",
  "signatures": [
    { "address": "", "signature": "" }
  ],
  "type": "BTC" (optional - defaults to bitcoin)
}

Verification

The proof that a site is solvent can be done by adding up all amounts controlled by addresses listed in the assets proof and deducting this amount from the root value in the liabilities proof.

function is_solvent() { return (assets >= liabilities) }

Assets and liabilities proof should be paired together using the id key. An asset proof must have the same id as its matching liabilities proof. This allows a shared wallet who handles multiple currencies to have multiple solvency proofs.

Known limitations

Sites that implement this scheme

Send a pull request if you would like your site listed here.