Case study · Umbrella Network · Co-Founder and Product Architect · 2020–2022

A price oracle that puts one Merkle root on chain instead of every price.

Umbrella Network is a decentralized oracle: a service that brings real-world data, like prices, onto blockchains so smart contracts can use them. I designed its architecture and built the first versions of its smart contracts and validator node. Instead of writing every price to the chain, validators agree on a tree of all of them and publish one root. Any contract can then check any value against that root.

~70 gasper pair per update on Ethereum
~260,000 gasto update one pair the standard way
3,800+feeds on Solana by the time I left
5 chainsBSC, Ethereum, Polygon, Avalanche, Solana
The idea

Independent validators check each other's work.

The usual oracle writes each price to the chain in its own transaction. That works for a few dozen popular pairs, but every new pair adds the same cost again, so the long tail of assets never gets a feed.

Umbrella flips it. Each validator fetches the data on its own, builds a Merkle tree where every leaf is one pair's value, and compares its result with the others. When enough of them agree, they sign the root and only that root goes on chain. The cost of a round barely changes whether the tree holds a hundred values or thousands.

  • No trusted input. Nodes don't need signed data from a source. They each pull it themselves, so agreement between them replaces trust in any one feed.
  • Every write is attributable. Each validator signs what it votes for, so a bad value traces back to who approved it.
  • Pay only when you use a value. Reading off chain is free. A contract that needs a price passes the value plus a short Merkle proof, and the contract checks it against the stored root.
How it works

Validators agree on the root on one chain. The other chains get a copy.

Data sourcesexchanges, price APIs Validatorfetch, build tree, root Validatorfetch, build tree, root Validatorfetch, build tree, root Consensus, home chaincompare within a tolerance,sign and submit the root replicate Other chainsEthereum, Polygon,Avalanche, Solanacontracts verify value + proof
  • A proposer and voters. One validator proposes a block. The others compare it with their own values, within a set tolerance, and vote. The home chain contract checks their signatures before it accepts the root.
  • One tree, every chain. The same root is copied to each chain, so the proofs are identical wherever a contract reads them.
  • A few values stored directly. The most-used prices are also written in full each round, so the common case needs no proof at all.
What it saved

About 70 gas per pair instead of about 260,000.

I went back to the chain and measured it. On Ethereum, Umbrella published a new root every hour, about 4,900 rounds over eight months, at around 140,000 gas a round. Each root covered about 2,000 pairs at the time. The same months on Ethereum, the leading oracle spent around 260,000 gas on each update of a single pair.

One value per transactionOne root per round
Gas per pair per update~260,000~70
2,000 pairs every hour~524M gas, about 6% of Ethereum's capacity~140,000 gas, under half a block
Adding a pairAnother full update cost every roundOne more leaf in the tree
Using a value in a transactionRead itPass a short proof, a few thousand gas

Umbrella figures measured on chain. The 2,000-pair comparison is calculated from the measured per-update cost.

What I built

I designed it and wrote the first versions.

  • The architecture: independent validators, the Merkle tree of values, consensus on a home chain and replication to the others.
  • The smart contracts: the first versions of the chain contracts that store roots and verify proofs.
  • The validator node: the first versions of the service that fetches data, builds the tree and votes.
  • The block explorer backend: its first version, so anyone could look up a round and its values.

The backend services were TypeScript, and the contracts were Solidity. The network launched on BSC first, then Ethereum with over 1,200 pairs, then Polygon, Avalanche and Solana, where it served more than 3,800 feeds by the time I left.

Introducing Umbrella Network · phoenix (contracts) · pegasus (validator)

What I took from it

What I learned.

  • Make the expensive part constant. The cost was per value, so the fix was a design where values stop being the unit you pay for.
  • Replace a requirement with a property. Signed source data was hard to get. Independent nodes that must agree made it unnecessary.
  • Measure it. I checked the cost comparison against real transactions on chain.

Want to talk about it?

I'm based in Los Angeles and open to product and engineering roles.

therevoltingx@gmail.com