diff --git a/doc/pruning.md b/doc/pruning.md index c8e26bbcc..90b297204 100644 --- a/doc/pruning.md +++ b/doc/pruning.md @@ -41,3 +41,38 @@ receiving or keeping all the data. * When a new node joins the network, it may temporarily behave as a partially validating node to make it available for use faster, even if it ultimately becomes a fully validating node. + +# Validation of Fully Pruned State + +Pruning needs to remove as much data as possible while keeping all the +guarantees of a full MimbleWimble-style validation. This is necessary to keep +a pruning node state's sane, but also on first fast sync, where only the +minimum amount of data is sent to a new node. + +The full validation of the chain state requires that: + +* All kernel signatures verify against their public keys. +* The sum of all UTXO commitments, minus the supply is a valid public key (can +be used to sign the empty string). +* The sum of all kernel pubkeys equals the sum of all UTXO commitments, minus +the supply. +* The root hashes of the UTXO PMMR, the range proofs PMMR and the kernels MMR +match a block header with a valid Proof of Work chain. +* All range proofs are valid. + +In addition, while not necessary to validate the full chain state, to be able +to accept and validate new blocks additional data is required: + +* The output features and switch commitments, making the full output data +necessary for all UTXOs. + +At minimum, this requires the following data: + +* The block headers chain. +* All kernels, in order of inclusion in the chain. This also allows the +reconstruction of the kernel MMR. +* All unspent outputs. +* The UTXO MMR and the range proof MMR (to learn the hashes of pruned data). + +Note that further pruning could be obtained by requiring the validation of +only a subset of the range proofs, chosen randomly by the validating node.