Merkle Tree and Merkle root are explained which are the backbone of blockchain. It is a special type of data structure in blockchain technology which is completely built using Cryptographic Hash functions
SHA - 256 Algorithm is an concept of Block Chain Technology . It is an Hashing method, Hashing is the process of scrambling raw information to the extent that it cannot reproduce it back to its original form. SHA-256 is a part of the SHA 2 family of algorithms, where SHA stands for Secure Hash Algorithm. Published in 2001. It's applications include hash tables, integrity verification, challenge handshake authentication, digital signatures, etc.I have also given an complete solved example of this algorithm.
A hash function usually means a function that compresses, meaning the output is shorter than the input
A hash function takes a group of characters (called a key) and maps it to a value of a certain length (called a hash value or hash).
The hash value is representative of the original string of characters, but is normally smaller than the original.
This term is also known as a hashing algorithm or message digest function.
Hash functions also called message digests or one-way encryption or hashing algorithm.
http://phpexecutor.com
1. Merkle tree is a fundamental part of blockchain technology.
2. It is a mathematical data structure composed of hashes of different blocks of data, and which serves as a summary of all the transactions in a block.
3. It also allows for efficient and secure verification of content in a large body of data. It also helps to verify the consistency and content of the data. Both Bitcoin and Ethereum use Merkle Trees structure.
4. Merkle Tree is also known as Hash Tree.
Information and network security 13 playfair cipherVaibhav Khanna
The Playfair cipher was the first practical digraph substitution cipher. The scheme was invented in 1854 by Charles Wheatstone but was named after Lord Playfair who promoted the use of the cipher. In playfair cipher unlike traditional cipher we encrypt a pair of alphabets(digraphs) instead of a single alphabet
SHA - 256 Algorithm is an concept of Block Chain Technology . It is an Hashing method, Hashing is the process of scrambling raw information to the extent that it cannot reproduce it back to its original form. SHA-256 is a part of the SHA 2 family of algorithms, where SHA stands for Secure Hash Algorithm. Published in 2001. It's applications include hash tables, integrity verification, challenge handshake authentication, digital signatures, etc.I have also given an complete solved example of this algorithm.
A hash function usually means a function that compresses, meaning the output is shorter than the input
A hash function takes a group of characters (called a key) and maps it to a value of a certain length (called a hash value or hash).
The hash value is representative of the original string of characters, but is normally smaller than the original.
This term is also known as a hashing algorithm or message digest function.
Hash functions also called message digests or one-way encryption or hashing algorithm.
http://phpexecutor.com
1. Merkle tree is a fundamental part of blockchain technology.
2. It is a mathematical data structure composed of hashes of different blocks of data, and which serves as a summary of all the transactions in a block.
3. It also allows for efficient and secure verification of content in a large body of data. It also helps to verify the consistency and content of the data. Both Bitcoin and Ethereum use Merkle Trees structure.
4. Merkle Tree is also known as Hash Tree.
Information and network security 13 playfair cipherVaibhav Khanna
The Playfair cipher was the first practical digraph substitution cipher. The scheme was invented in 1854 by Charles Wheatstone but was named after Lord Playfair who promoted the use of the cipher. In playfair cipher unlike traditional cipher we encrypt a pair of alphabets(digraphs) instead of a single alphabet
Hyperledger Fabric Technical Deep Dive 20190618Arnaud Le Hors
Slides presented at the Hyperledger Fabric workshop in Barecelona on July 10th, 2019.
This introduces blockchain for business and describes in details the Hyperledger Fabric design principles, overall architecture, its components, and the transaction flow.
In cryptography, a block cipher is a deterministic algorithm operating on ... Systems as a means to effectively improve security by combining simple operations such as .... Finally, the cipher should be easily cryptanalyzable, such that it can be ...
The presentation covers the following:
Basic Terms
Cryptography
The General Goals of Cryptography
Common Types of Attacks
Substitution Ciphers
Transposition Cipher
Steganography- “Concealed Writing”
Symmetric Secret Key Encryption
Types of Symmetric Algorithms
Common Symmetric Algorithms
Asymmetric Secret Key Encryption
Common Asymmetric Algorithms
Public Key Cryptography
Hashing Techniques
Hashing Algorithms
Digital Signatures
Transport Layer Security
Public key infrastructure (PKI)
This PPT explains about the term "Cryptography - Encryption & Decryption". This PPT is for beginners and for intermediate developers who want to learn about Cryptography. I have also explained about the various classes which .Net provides for encryption and decryption and some other terms like "AES" and "DES".
Ethereum is an open software platform based on blockchain technology that enables developers to
build and deploy decentralized applications.
Ethereum is a distributed public blockchain network.
While the Bitcoin blockchain is used to track ownership of digital currency (bitcoins), the Ethereum
blockchain focuses on running the programming code of any decentralized application.
Ether is a cryptocurrency whose blockchain is generated by the Ethereum platform. Ether can be
transferred between accounts and used to compensate participant mining nodes for computations
performed.
Hyperledger Fabric Technical Deep Dive 20190618Arnaud Le Hors
Slides presented at the Hyperledger Fabric workshop in Barecelona on July 10th, 2019.
This introduces blockchain for business and describes in details the Hyperledger Fabric design principles, overall architecture, its components, and the transaction flow.
In cryptography, a block cipher is a deterministic algorithm operating on ... Systems as a means to effectively improve security by combining simple operations such as .... Finally, the cipher should be easily cryptanalyzable, such that it can be ...
The presentation covers the following:
Basic Terms
Cryptography
The General Goals of Cryptography
Common Types of Attacks
Substitution Ciphers
Transposition Cipher
Steganography- “Concealed Writing”
Symmetric Secret Key Encryption
Types of Symmetric Algorithms
Common Symmetric Algorithms
Asymmetric Secret Key Encryption
Common Asymmetric Algorithms
Public Key Cryptography
Hashing Techniques
Hashing Algorithms
Digital Signatures
Transport Layer Security
Public key infrastructure (PKI)
This PPT explains about the term "Cryptography - Encryption & Decryption". This PPT is for beginners and for intermediate developers who want to learn about Cryptography. I have also explained about the various classes which .Net provides for encryption and decryption and some other terms like "AES" and "DES".
Ethereum is an open software platform based on blockchain technology that enables developers to
build and deploy decentralized applications.
Ethereum is a distributed public blockchain network.
While the Bitcoin blockchain is used to track ownership of digital currency (bitcoins), the Ethereum
blockchain focuses on running the programming code of any decentralized application.
Ether is a cryptocurrency whose blockchain is generated by the Ethereum platform. Ether can be
transferred between accounts and used to compensate participant mining nodes for computations
performed.
Like most imperative languages in the ALGOL tradition, C has facilities for structured programming and allows lexical variable scope and recursion, while a static type system prevents many unintended operations. In C, all executable code is contained within subroutines, which are called "functions" (although not in the strict sense of functional programming). Function parameters are always passed by value. Pass-by-reference is simulated in C by explicitly passing pointer values. C program source text is free-format, using the semicolon as a statement terminator and curly braces for grouping blocks of statements.
Real-time Data De-duplication using Locality-sensitive Hashing powered by Sto...DECK36
Data de-duplication, in our case also called "Entity Matching", is not just about reducing multiple instances of the same item to one in order to save some space. It is a challenging task with many practical applications from health care to fraud prevention: "Is this person the same patient as ten years ago, but has moved in the meantime?", "Is this personalized spam mail the same email that was sent to many others, yet customized in each case?", or "Was there a spike resp. what is the base level of similar looking account creations?". In the age of Big Data, we do have the data to answer such questions, but heuristically comparing each item to all other items quickly becomes technically prohibitive for huge data sets.
In this session, we will have a look at past practises and current developments in the world of data de-duplication. After that, we will look at how to leverage locality-sensitive hashing algorithmically to reduce the amount of comparisons to a workable level. A demonstration will feature our implementation of that algorithm on top of Riak and Storm. The session will then finish with an overview of experiments and results using that system on different datasets, including browser fingerprints, tweets, and news articles.
Hashing is the process of converting a given key into another value. A hash function is used to generate the new value according to a mathematical algorithm. The result of a hash function is known as a hash value or simply, a hash.
Data Structure and Algorithms: What is Hash Table pptJUSTFUN40
Outline:
What is a HASH TABLE?
What is a HASH FUNCTION?
What is a HASH COLLISION?
Implementation of a Hash Table
Discussion on collision resolution methods in particular SEPARATE CHAINING and OPEN ADDRESSING
Separate Chaining Implementation
Open Addressing Implementation
Linear Probing
Quadratic Probing
Double Hashing
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
How to Split Bills in the Odoo 17 POS ModuleCeline George
Bills have a main role in point of sale procedure. It will help to track sales, handling payments and giving receipts to customers. Bill splitting also has an important role in POS. For example, If some friends come together for dinner and if they want to divide the bill then it is possible by POS bill splitting. This slide will show how to split bills in odoo 17 POS.
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
How to Manage Notification Preferences in the Odoo 17Celine George
In this slide, we will explore the world of notification preferences in Odoo 17. We will discuss how to manage and customize the way we receive updates and alerts within the platform. By understanding these settings, we can ensure that we stay informed about the most relevant information while avoiding notification overload.
How to the fix Attribute Error in odoo 17Celine George
AttributeError in odoo is one of the most common errors in odoo which can be defined as the error raised when we try to access or assign an attribute that doesn’t exist in the class of the object. In this slide we will discuss on how to fix object has no attribute error in odoo 17.
Incoming and Outgoing Shipments in 2 STEPS Using Odoo 17Celine George
In Odoo 17, the process of managing incoming and outgoing shipments is streamlined into two efficient steps, simplifying logistics management. This feature optimizes the workflow by reducing complexity and increasing productivity, ensuring smooth operations for businesses. With Odoo 17, users can easily track and manage their shipments from start to finish, improving overall efficiency and enhancing the customer experience.
An Overview of the Odoo 17 Discuss App.pptxCeline George
In this slide, we will provide an overview of the Odoo 17 Discuss App. Odoo Discuss is a built-in communication tool that helps businesses improve internal communication and collaboration among teams. We will explore the features and functionalities of Odoo Discuss App and how it can benefit your organization.
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Celine George
In this slide, we'll dive into the "First Expired, First Out" (FEFO) removal strategy in Odoo 17, specifically designed for managing perishable products. We'll explore its benefits, setup process, and how it helps minimize waste and maximize efficiency.
Features of Video Calls in the Discuss Module in Odoo 17Celine George
In this slide, we will discuss the features of video calls in the Discuss module in Odoo 17. Odoo Discuss is a built-in communication app that serves as the central hub for all our team conversations. It offers a variety of features to facilitate seamless collaboration and information sharing, including video calls.
How to Analyse Profit of a Sales Order in Odoo 17Celine George
Sales margin plays a crucial role in the corporate world as a compass that directs enterprises towards profitability. It is the discrepancy between a good or service's selling price and its production or acquisition costs. This margin shows a company's capacity to produce income in addition to how well it manages expenses.
How to Manage Closest Location in Odoo 17 InventoryCeline George
For the Closest Location removal strategy, products are picked based on the alphanumeric order of storage location titles.
The goal of this strategy is to save the warehouse worker from taking a long journey to a farther shelf when the product is also available at a closer location.
An Overview of the Odoo 17 Knowledge AppCeline George
Odoo Knowledge is a multipurpose productivity app that allows internal users to enrich their business knowledge base and provide individually or collaboratively gathered information.
Improved Approval Flow in Odoo 17 Studio AppCeline George
Odoo 17 Studio App introduces enhancements to its approval flow, empowering businesses to manage approvals effectively and boost productivity. This slide dives into these improvements and highlighting their benefits.
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
In the world of commerce, precision is paramount. Pro-Forma Invoices serve as the blueprint for these precise financial transactions. These documents encapsulate critical information such as quantity, transportation charges, value, weight, and the range of goods involved in a transaction.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
2. INTRODUCTION
While having studied blockchain technology, definitely we can see the term ‘Merkle Tree’ in so many
places. Merkle Tree is the backbone of the blockchain. To understand the basics of the blockchain, one
should be aware of Merkle Tree and the related terminologies. In this attempt, we are trying to give you
the basics of Merkle Tree and a simple implementation of the same using Python script.
Merkle Tree is a special type of data structure which is completely built using Cryptographic Hash
function. Before going deep into Merkle Tree, let’s have a glance on a hash function. The hash function is
a function which converts the input data into a fixed length data regardless of the length of input data.
The output of the hash function is called ‘hash value’, ‘hashcode’ or ‘hash’ in short. A hash function
generates a completely unique hash with a fixed length for each input data. It is guaranteed that two
hash functions will never collide for two or more different input data. Let’s see an example of the hash
function.
3. When hashing the data ‘Hash Me’, you can see a hexadecimal code is generated which is 16 bytes
long(32 characters).
In the second example, the data to be hashed is ‘HashMe’. The only change we made is the removal of
space between the words. But in the result, you can see the hash code is entirely different. But with the
same length of 16 bytes. Unlike normal encryption algorithms, no hash can be decoded into original
data(plain text). Which means hashing is a one-way cryptographic method or we can say hashing is
irreversible.
Input Data Hash Code
Hash Me 644D45DD9DF9D3B92E5D773E13DF5215
HashMe 54FF7B00CC8493E7948F5DDF08396CBC
4. Different popular hash functions are, MD5, SHA256, SHA1, and SHA512. Each of them follows different
cryptographic algorithms. SHA256 algorithm is the popular one which followed by most of the
blockchains including Bitcoin.
As already mentioned, Merkle tree is totally build using a hashing function. In short, a Merkle tree
formation is the process of making a single hash from a group of hashes. Let’s see how it works with an
illustration.
5. The bottom blocks L1, L2, L3, and L4 are the data blocks. The first step is to hash each data block using a
specific hashing algorithm say SHA256. So that the blocks Hash 0-0, Hash 0-1, Hash 1-0, Hash 1-1 are
formed. This is the initial step for building a Merkle Tree. These blocks can be called as Leaves of the
Merkle Tree. The minimum number of Leaves should be two and there is no upper limit.
Next step is, hashing two adjacent hashes into a single hash. That is, Hash 0-0 is concatenated with
Hash 0-1 and again hashed it by SHA256 to get Hash 0. The same process is done for Hash 1-0 and Hash 1-
1 blocks to produce Hash 1. The process will continue until a single hash is formed. The final hash is called
Root of the Merkle Tree. It is called Merkle Root.
The validation of the existence of a data in a Merkle Tree is an important process. The data to be
validated is called Target Hash. As already mentioned, hashes are irreversible. That is, it is impossible to
derive the target hashes from the Merkle Root. So that, no data can be validated by decoding the Merkle
root. The only way to validate a data in a Merkle tree is to rebuild the tree. Target Hash alone is not
enough to rebuild the tree. One method to rebuild the Merkle Tree is by collecting all the leaves and
arrange them in the same order and build the tree again.
6. But this a constraint for many applications and also time and storage consuming. If we study a Merkle
Tree formation in little more depth, we can see that all of the leaves are not required for building the
tree. Instead, a proof to reach at Merkle Root from Target Hash can be formed. This proof is called
Merkle Proof. Merkle Proof is nothing but a collection(array) of hashes which is explained below.
7. n this Merkle Tree, HK(red block) is our target hash. HKL is formed by hashing HK with HL. HIJKL is
formed by hashing HIJ with HKL And so on to reach HABCDEFGHIJKLMNOP. It is clear that, to validate HK
in the Merkle tree, the blocks HL, HIJ, HMNOP, HABCDEFGH (yellow blocks) are the only required data
instead of all the leaves HA, HB, HC,........HP. Here, the Merkle Proof of HK in this tree is the array of
hashes HL, HIJ, HMNOP, and HABCDEFGH.
Merkle Tree Implementation Using Python
Merkletools is a library in python for performing Merkle Tree operations. Install merkletools library for
Python. Type the below command in Terminal.
pip install merkletools
Step-1: Create a merkletools object
import merkletools
mt = MerkleTools(hash_type="md5")
8. An object ‘mt’ is created for the merkletools library. In this step, you can specify which hashing
algorithm has to be done by setting it to parameter ‘hash_type’. If nothing is specified, SHA256 will be
set by default. Here MD5 is given. 'MD5', 'SHA1', 'SHA224', 'SHA256', 'SHA384', 'SHA512'
'SHA3-224', 'SHA3-256', 'SHA3-384', and 'SHA3-512' are supported by merkletools.
Step-2: Add leaves(data) to the tree.
hashed_data = '1aae04314577b27f3b4be982eed1b724a6d59e9c413cfb2afa2f0c68e0a93911'
plain_data = ['Lorem ipsum', ‘dolor sit amet']
mt.add_leaf(hashed_data)
mt.add_leaf(plain_data, True)
The first argument is the data and second argument is, do_hash. If data is plain text, then set do_hash as
‘True’. If data is already hashed, then no need to set do_hash argument.
9. • To get the number of leaves:
leaf_count = mt.get_leaf_count();
•To get data from the leaves at index n:
leaf_value = mt.get_leaf(n)
•Remove all the leaves and reset the tree:
mt.reset_tree()
Step-3: Build the tree.
After setting the leaves, execute below code to build the Merkle tree.
mt.make_tree()
10. Step-4: Checking tree is ready or not.
After executing make_tree, check whether the tree is completed and ready to supply its root and
proofs.
is_ready = mt.is_ready()
is_ready returns true when the tree is ready. It returns false if the tree is reset or changing the leaves.
Step-5: Take Merkle root.
root_value = mt.get_merkle_root()
The Merkle root will be returned if the tree is ready. If the tree is not ready, None will be returned.
Step-6: Get proof of each leaf.
proof = mt.get_proof(n)
This will return the proof of the nth index. If there is no leaf at the nth index, then null will be returned.
11. Step-7: Validation of proof.
validate_proof(proof, target_hash, merkle_root)
This validates the proof with target hash and merkle root. Returns true if proof is valid and correctly
connects the target_hash to the merkle_root. The parameter proof is an array which is the output of
get_ptoof(). target_hash and merkle_root should be in hex string form
12. Click here to read more about : What is Merkle Tree?
13. Cybrosys Limited
Alpha House,
100 Borough High Street,
London, Greater London
SE1 1LB, United Kingdom
Thank You !
info@blockchainexpert.uk
Mail UsUK Phone
+44 7414439281