Difference between revisions of "Simplified Payment Verification"
Line 6: | Line 6: | ||
As block headers are of constant size of 80 bytes, the size of the data grows linearly, and is independent of the size of the blocks. The size of a Merkle path is of maximum <math>32 * 2 * log_{2}{n}</math> bytes, where <math>n</math> is the total number of transaction in one block. | As block headers are of constant size of 80 bytes, the size of the data grows linearly, and is independent of the size of the blocks. The size of a Merkle path is of maximum <math>32 * 2 * log_{2}{n}</math> bytes, where <math>n</math> is the total number of transaction in one block. | ||
− | |||
− | |||
[[File:Longest_proof_of_work_chain.png|frame|centre|alt=Longest proof of work chain]] | [[File:Longest_proof_of_work_chain.png|frame|centre|alt=Longest proof of work chain]] | ||
− | + | == SPV Wallet == | |
− | + | SPV wallet is a lightweight wallet that uses the mechanism of SPV to construct bitcoin transactions and payments. | |
− | |||
− | + | To spend a UTXO, a user of a SPV wallet will pass on the following information to the receiver: | |
+ | # <math>Transaction_0</math> - the transaction that contains the UTXO as an output, | ||
+ | # The Merkle path of <math>Transaction_0</math> | ||
+ | # The block header that contains the Merkle root derived from the Merkle path (or its identifier, e.g., block height) | ||
+ | # <math>Transaction_1</math> - the transaction that spends the UTXO |
Revision as of 14:46, 20 January 2020
Simplified Payment Verification (SPV) is described in section 8 of the Bitcoin whitepaper. It allows a user to prove or verify that a transaction is in the chain without downloading the full chain.
To provide a proof, a user simply download the block headers and the Merkle paths of interested transactions. By showing the Merkle path of a transaction, and its corresponding Merkle root in the block header, it confirms that the transaction is in the chain at that block height.
To validate a such proof, a user only needs to download the block headers. By computing the hash of the transaction and the Merkle root, the user can compare it with the Merkle root in the block header. If it matches, then the validation is successful.
As block headers are of constant size of 80 bytes, the size of the data grows linearly, and is independent of the size of the blocks. The size of a Merkle path is of maximum bytes, where is the total number of transaction in one block.
SPV Wallet
SPV wallet is a lightweight wallet that uses the mechanism of SPV to construct bitcoin transactions and payments.
To spend a UTXO, a user of a SPV wallet will pass on the following information to the receiver:
- - the transaction that contains the UTXO as an output,
- The Merkle path of
- The block header that contains the Merkle root derived from the Merkle path (or its identifier, e.g., block height)
- - the transaction that spends the UTXO