UMBRELLA DEMO GUIDE

Sam Kim
Umbrella Network
Published in
5 min readNov 23, 2020

--

In future blog posts, we will go into a deeper dive into the technical details and specifications of Umbrella Network’s layer 2 based oracle.

For today, we want to walk you through our online demonstration that is available for you to try for yourself. We recommend you read the TECHNICAL BACKGROUND section below, but feel free to skip to the INSTRUCTIONS section.

TECHNICAL BACKGROUND

First, a bit of basic information about the Umbrella Network oracle. Umbrella uses a Merkle Tree that is rolled up and anchored to Ethereum. In a follow-up blog post, we will go into how this is done and how consensus is achieved. Meanwhile, just know that we use a Merkle Tree anchored to Ehtereum blocks as represented below.

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 pairs 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.

Proving validity of data is a unique property of a Merkle Tree. So in this instance, if I am given the internal data (key value pair, block height) along with the sibling hash, I can confirm the validity of the data. For more technical specification, we will be releasing an explainer in our Medium blog in the near future.

The image above represents a Merkle Tree with 8 leaves (Kn, Vn). Leaves can be any data, in our case a pair of key and value. Each leave data (combined key + value) 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 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. Because of the uniqueness of hashes, different data produces different roots. We are using this property to prove the data.

We store The Root Hash (or for simplicity, the “root”) on-chain. When we want to prove that K4V4 are valid this is what we do:

  1. we know the K4 and V4 so we can hash them and we get H14
  2. in order to get hash H22 we need to know the pair for H13, this pair item is called sibling and needs to be provided by Umbrella
  3. having H13 sibling and H14 we can calculate H22
  4. we repeat hashing with siblings until we get the root
  5. if the root that we got is the same as saved on-chain it proves that TX4 data is valid

Umbrella utilizes the unique qualities of Merkle Trees to make data available to dApps and Layer 2 applications. Umbrella provides the Key Value Pair, block height, and the sibling proof which allows an applications to confirm the validity of the data

INSTRUCTIONS

This demonstration app is not meant to be used in production. It is purely to illustrate how Umbrella works and to give a visual representation. And so, this application will not show all of the cryptocurrency pairs, implied volatility, realized volatility and other data Umbrella’s oracle supports. Umbrella is designed to be used directly from a smart contract or API.

The Umbrella Demo application can be found at the Umbrella website: https://www.umb.network/

User would first select “Proofs” in the left menu bar. In the dropdown menu “Keys”, User can select the data points they would like to retrieve. For the purposes of this demo, we are making only a few key pairs available. The live product will make thousands of data points available. In addition, this demo app only provides spot data feeds. Once again, the live product allows for the retrieval of all historical data in addition to spot data.

User can then select the pair they would like to retrieve. In this example, we selected two pairs.

The data is automatically populated with the following:

-Key: the name of the currency pair

-Value: the price

-Block Height: the ethereum block the merkle tree is anchored to

-Proof: the hash of the sibling leaf

-Key [Bytes]: byte representation of the Key

-Value [Bytes]: byte representation of the Value

To verify that the values returned by Umbrella’s Block Explorer, User can view the contract on Etherscan. This can easily be done by clicking on the green icon in the top right corner.

In the contract page, User copies and pastes the values from Umbrella’s Block Explorer into the corresponding section in “verifyProofofBlock”. Select “Query”. The result will be “Bool: true” if the key value pair is consistent with what’s in the Merkle Tree and “Bool: false” if it is not.

If data is entered correctly, the result will be True as seen below:

If data is incorrect, the result will be False. In this example, we changed the value (bytes) by 1 digit from 0x0190 to 0x0191. And as expected, the returned value is “false”.

We hope this peak into the Umbrella oracle system provided you with a hands on experience with how the system works and why it is unique. In one single Ethereum block, Umbrella is able to write hundreds if not thousands of data points thereby increasing the amount of data that is available on chain while simultaneously reducing the cost of getting data on chain.

For more information, join our Telegram (https://t.me/umbrellanet) and / or follow us on Twitter (https://twitter.com/UmbNetwork)

--

--

Sam Kim
Umbrella Network

Entrepreneur in the blockchain, crypto and ad tech industries. Currently a partner at Umbrella Network and MetalCore. www.umb.network. www.metalcoregame.com