Bitcoin Internals: Verifying Merkle Roots using Merkle Proofs in JavaScript

Опубликовано: 18 Октябрь 2024
на канале: Edd Mann
16,562
280

In this video we expand on the previous one where we computed a given list of transactions Merkle root using Merkle trees. We will now compute a Merkle proof for a given transaction, allowing clients to validate that a transaction exists in a block without having to download it's entire contents.
This technique is used widely in light-weight Bitcoin clients (using Simplified Payment Verification).
We codify a JavaScript solution which will create a Merkle proof for a transaction and then do the inverse and validate that proofs claim based on the blocks Merkle root.

Discussed in the video:
https://bitcoin.org/en/glossary/simpl...
https://www.bitcoinbook.info/

The source-code for this video can be found here:
https://gist.github.com/eddmann/6b8d0...