Intro to Layer 2 Data (L2D)

Layer-2 Data Feeds

Umbrella's Layer-2 Data feeds live off-chain. These feeds are anchored on-chain so dApps can verify the cryptographic integrity of the data when using it on-chain..

Solution Overview

The Umbrella Validator Network, at a predefined frequency, fetches the values for the different data points to be included as a layer-2 data, authenticates them and "merkelize" them, aggregating all values into a single Merkle Tree root hash.

This root hash is then anchored on the blockchain so dApss to be able to cryptographically verify a L2D feed on-chain.

Web3 apps fetches L2D feeds from Umbrella's API, along with internal data required for verifictaion. This data is sent to Web3's smart contract, which must invoke a method in Umbrella's Chain smart contract to verify the root hash, thus safely using the data.

Merkle Trees

Merkle Trees allow decentralized applications to scale without sacrificing security while maintaining data integrity. In our application, each leaf on the Merkle Tree represents a data point. The data point could be cryptocurrency pair such as ETH/USDT or the price of Apple stock. The leaves are “rolled” from the lowest leaf up to the Root Hash. And the Root Hash is a unique representation of the entire Merkle Tree.

The image above represents a Merkle Tree with 8 leaves (TX1 through TX8). Leaves can be any data, in our case a pair of key and value. Each leave's data is hashed and as a result, we get a unique ID hash (eg. H11). Uniqueness is guaranteed by hashing algorithm; meaning, if we made any change to the data we will get a completely different hash.

By hashing all data we just created the next level of the tree — represented in the image as leaf hashes (H11–18). Now we join them into pairs and hash them together again — as a result we get the next level up on the Merkle Tree. Repeating this same process, we get to the Merkle Tree root: “The Root Hash” as shown in the image above.

It is because of the uniqueness of hashes, that different data produces different roots. Proving the validity of data is a unique property of a Merkle Tree. So in this instance, if I am given the internal data of a leave (key, value) along with the sibling hashes, the Merkle Tree can be reconstructed. and if the root hashes match, we can confirm the validity of the data -data has not been changed and it is the same as the one validated by the Umbrella's Validator Network.


What’s Next