Merkle Tree-based BaaSid Backend System

Merkle Tree-based BaaSid Backend System

BaaSid's backend system is designed with an off-chain structure based on Merkle Tree to effectively verify the authenticity of data. Initially operated through BaaSid's own mainnet, it has now been migrated to an Ethereum base to increase token utilization and strengthen connectivity with external ecosystems. Furthermore, it is planned to be upgraded to a lightweight on-chain verification method based on Layer 2 such as Arbitrum in the future for more expanded accessibility and processing efficiency. Through this, we aim to build a blockchain data verification infrastructure that satisfies reliability, scalability, and cost efficiency.

Technical Structure:

  • Merkle Tree generation: Hash data (responses, votes, etc.) created by users or companies to create a tree structure

  • Root hash storage: Record only the generated Merkle Root on the blockchain

  • Verification request processing: Verify whether specific data is included through Merkle Proof provided by users

  • Data forgery prevention: Able to detect forgery without directly storing original data

Voting data verification: Merkle tree

off-chain storage pattern

Cryptographic proof in Merckle tree

To prove that an element (hK on the picture) is in the hash, we have to assemble the hash again, and it’s mandatory to use the hK hash during the assembling because we want to prove that hK is in the list. If we assemble the top hash with explicit usage of the element’s hash (hK), it means that the element’s hash is contained in the top hash. So, a smart contract function, that wants to check if an element is in the root, should re-create the root hash itself, using the element’s hash and other hashes nearby it, and check, if the result is the same as the root hash. If the result is the same, it means, that the root hash contains the hash of the element.Merkle Root Tree — Structure of hashes, ending with a hash of all hashes in the root. (sauce : Medium Solidity : Merkle Tree)

Last updated