This tutorial introduces the background of BingX Proof-of-Reserves and how to verify individual liabilities in Merkle Tree. Both Bitcoin and Ethereum use Merkle trees.
BingX Proof-of-Reserves utilizes the technique of Merkle Tree, a data structure designed to encrypt blockchain data securely. This technique allows individual users to verify that their funds are included in the attestation.
Merkle root is a straightforward mathematical technique for verifying the data on a Merkle tree. Users can verify the data by calculating their Merkle leafs with Merkle path to get the Merkle root. If the result matches the expected root, you get the proof-of-inclusion.
Users can get the Merkle leaf in BingX proof-of-reserves page, and skip to the Verification. Users can also calculate their Merkle leaf with the following steps below.
Hash your BingX UID with SHA256. All UID of the individuals will be hashed with SHA256 before generating the Merkle tree or handing it over to the auditor. This will ensure independent auditor only sees the users' hashed UID and never any personally identifiable information.
{Hashed UID},{Asset1}:{Balance1},{Asset2}:{Balance2},{Asset3}:{Balance3},{Asset4}:{Balance4},Total:{TotalValueInUsd}
e.g.
abcdefg,BTC:1.132142,ETH:2.54469871,USDT:20384,USDC:50.3,Total:49875.12599
Use the following number formatting rules to format the balance:
Python 3.4 or above
Generate the Hashed UID
python por.py hash {uid}
Generate the Merkle leaf
python por.py hash {asset string}
e.g.
python por.py hash abcdefg,BTC:1.132142,ETH:2.54469871,USDT:20384,USDC:50.3,Total:49875.12599
python por.py verify {Merkle leaf} {Merkle path}