Skip to Content
Hands-On Blockchain for Python Developers
book

Hands-On Blockchain for Python Developers

by Arjuna Sky Kok
February 2019
Intermediate to advanced
450 pages
9h 59m
English
Packt Publishing
Content preview from Hands-On Blockchain for Python Developers

Merkle tree

Let's take a look at an example of a Merkle tree in order to understand it. Let's say you have eight pieces of data. In this case, we will use the names of animals for our data, but in Bitcoin, which uses a Merkle tree, the pieces of data are usually transactions. Back to Merkle trees: put the data in order, so in this case, cat is the first piece of data, dog is the second, ant is the third, and so on:

We take the hash of each piece of data, in this case, cat, dog, ant, and so on. For this demonstration, we use the hash function SHA256. Because of limited space, we have truncated the full hash result in the diagram. For now, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Blockchain in Action

Blockchain in Action

Bina Ramamurthy
Learn Python by Building a Blockchain and Cryptocurrency

Learn Python by Building a Blockchain and Cryptocurrency

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781788627856Supplemental Content