Module: Bitcoin::Validation
- Defined in:
- lib/bitcoin/validation.rb
Overview
Validates blocks and transactions before they are accepted into the local blockchain. There are two modes of validation, “syntax” and “context”. “syntax” validates everything that can be validated without access to the rest of the blockchain, for example that the block hash matches the claimed difficulty, and the tx hashes add up to the given merkle root, etc. The “context” rules include the checks that need to cross-reference data against the local database, like comparing the difficulty target to the last blocks, or checking for doublespends. (Suggestions for better names for these modes are welcome!) Everything accepted into the local storage should at least be syntax-validated, but it should be possible to skip context-validation when the current block is already known, for example when checkpoints are used.
Defined Under Namespace
Classes: Block, Tx, ValidationError