SPV proof
The Simplified Payment Verification (SPV) proof is a cryptographic proof that allows the light client to verify that a transaction has been included in a block. The SPV proof is generated by the full node and sent to the light client. The light client can then verify the proof and trust that the transaction has been included in the block.
The light client fetches the SPV proof through the /spv
endpoint
of the full node.
Along with the verification of the SPV the programs, the predicates for the longest chain proof are also verified to ensure that the light client is in sync with the running chain.
SPV program IO
Inputs
The following data structures are required for proof generation:
- Vector of
LayerBlockHeader
: A List of layer block headers that can be considered as part of the longest chain.- Element at index 0: An already verified Layer Block Header.
- SPV: An SPV proof produced for a chain at the height of the newly verified layer block header.
HashValue
: 32 bytes representing the hash of the expected block header of the SPV proof.
Outputs
BigInt
: U256 representing the total work produced on top of the newly verified block.HashValue
: 32 bytes representing the hash of the first layer block header of the list.HashValue
: 32 bytes representing the hash of the newly verified layer block header.HashValue
: 32 bytes representing the hash of the subject of the SPV proof.