Chapter 11: Upshot’s ZKML Price Oracle

Modulus Labs
6 min readNov 21, 2023

--

Debuting the largest AI application ever implemented on Ethereum — and yes, it’s 100% ZK verified.

Say hello to the world’s 1st production ZK AI price oracle, online today to a limited audience, and public soon . At a glance:

  • Up to 10,000 AI-powered, ZK verified appraisals settling every hour on Ethereum
  • Behind each price, Upshot’s sophisticated appraisal decision forests (each over 2,500 trees) proven in parallel at massive scale
  • All using the world’s 1st AI-specialized ZK prover—“Remainder”—check it out at: http://explorer.modulus.xyz

It’s a new era for AI-augmented smart contracts, where AI features are folded into the EVM without compromising blockchain security. Stick around — a lot to unpack!

“Hit it!”

“The Upshot of Upshot”

Upshot is — the — market-leader in the NFT appraisal space. At the product level, this means near real-time prices for over 100 million NFTs (PFPs, RWAs, and more soon), with which enterprising services have used to build marketplaces, indices, lending vaults, and more.

Which is… impossible? After all, normally we’d only have insight into the true value of our NFTs at time of sale. To circumvent this issue, services have been forced to rely on market or collection-based proxies for NFT value (collection floor price being a popular one). The result of this, however, is losing out on the granular features unique to each NFT. This also instantly limits liquidity for would-be markets, which in turn forces traders to sell at massive discounts.

When it comes to “long-tail assets”, the reality today is that of sellers leaving money on table, while buyers buy assets of uncertain value.

AI prices for paradigm-busting financial markets!

That’s where Upshot’s novel solution comes in: use wildly powerful AI models that ingest complex market data to “appraise” the value of every single NFT, every hour.

This is a pretty wild idea, but one which has been battle-tested over the past year of volatile NFT prices, and which boasts a 3–10% MAPE (mean average percent error). That’s market-topping accuracy!

“Necessary Evil?”

That’s all well and good, but as my mother likes to remind me: “if it sounds too good to be true, it’s probably exactly that — unless it’s how well your brother is doing. We got so lucky with him.”

Anyways.

The drawback to Upshot’s approach is the need for “Trust” with a capital T. Specifically, due to the Upshot appraisal model’s extremely complexity, the calculations need to be performed wholly off-chain. In fact, by our estimate, a single appraisal on Ethereum would cost just a touch over $1,000,000 in gas fees alone(!).

The tradeoff then, is really quite straightforward: Upshot uses AI to deliver extremely accurate, timely NFT prices, but service providers have to trust Upshot to never tamper with the price feed.

Robin deserves better. Let’s be better, for Robin.

In other words, Upshot’s price feed becomes the attack vector for any market manipulation. And as an added bonus, due to the complexity of AI compute, any doctoring of pricing data to the benefit of a collection, collector, or anyone else is exceedingly difficult to detect.

Shoot.

“Make an Honest Price Out of You”

The holy grail, of course, would be to deliver Upshot’s astonishing AI price feed without giving up on “on-chain” security.

Which is precisely what we’ve done.

Hehehe… Wait. We’re being serious?!

Each hour, Upshot sends their most transaction-relevant and valuable AI appraisals to Modulus. Then, our wildly optimized ZK prover blitzes through legions of bleeding-edge cryptographic operations to craft a “proof of correctness” for these AI computations. These proofs are then aggregated, before being submitted to Ethereum for final verification.

The result: total mathematical certainty that Upshot couldn’t have manipulated their price feed.

For us consumers, this means an NFT price feed forged with AI superpowers and blockchain security — fully digestible by on-chain protocols and live now to a limited audience.

“Proving is Believing”

Here’s a teaser on how this step-change in ZKML was made possible (“Remainder” paper coming soon!):

First things first, a bit of context—Upshot’ appraisal decision forest is a massive statement of work. Not only does Upshot’s network digest hundred of millions of appraisal results each day, but each result is itself built from 2,500+ gradient-booted trees.

This means that in aggregate, not only is the Upshot model hundreds of times larger than any decision forest previously proven in ZK, it also has to be proven at a scale thousands of times greater than anything before in ZKML.

Thankfully, two particular insights into machine learning algorithms caught our eye: ML algorithms are both structured and dataparallel.

  • Structured: machine learning models’ layers have outputs whose element-wise locations are directly related to their corresponding inputs’ element-wise locations
  • Dataparallel: many inputs are fed simultaneously into the same model, producing many parallel outputs

This insight drove our work in a custom prover — Remainder — whose backend rests on the seminal work commonly known as GKR, followed by many other refinements and follow-up work. We’ll leave how we’re implementing GKR for the upcoming paper and deep-dive blog, but the result of our implementation is:

  • Sumcheck requires a linear number of field-only operations and is embarrassingly parallel-friendly
  • Prover performs a polynomial commitment on only the circuit’s input layer. This means that heavy cryptographic operations are only used on model parameters and inputs and never intermediates
  • Time-optimal sumcheck protocols exist for special linear operations often used in machine learning models
  • “Structured” version of GKR yields a succinct verifier, and perfectly mirrors the structure described earlier in machine learning algorithms

The result of all this? Proving operations tens to thousands of times faster than their generic counterparts, with similar speed and scale improvements to follow.

“Hi Impossible, Meet Math”

The “zkPredictor” was an impossible product.

It required both the unadulterated superpowers of AI, as well as the uncompromising satisfaction of the blockchain’s trustless creed.

So to bring it to reality, we had to marry Upshot’s sophisticated appraisal model with Modulus’ bleeding-edge ZKML API. Which meant creating the world’s 1st AI-specialized ZK prover, orchestrating a novel acceleration pipeline, circuiting wildly performant AI models, and of course, investing in a deep partnership with the Upshot team, built over months.

The result… is a technical revolution.

Beware! Superpowers coming to dApps near you

So where does this leave us? Now that we’ve taken our first steps into an AI-enhanced on-chain world, has the bull market finally returned?

“Queuing the Next Track”

In the immediate-term, projects building with Upshot’s pricing oracle network will begin to enjoy the cryptographic backbone of Modulus’ zero-knowledge proofs (look for the “✓”). Especially as production volume ramps in the next month.

In the medium-term, the road to “zkPredictor” taught us a startling amount about what it takes to build ZKML apps at scale. To that end, in the months to come, look out for:

  • The theory behind “Remainder” — our upcoming paper, more blogs, and deep dives
  • The production implementation of the world’s largest ZKML application — Veridise’ audit report, dev docs, and open-sourcing of the codebase
  • And of course, how we’re gonna bring these capabilities to many more projects — more use-cases to unveil, as well as updates about our API

And in the long-term? Well, we’ll leave that for another blog for now ;)

Look out for the Modulus ✓ when Ditto goes public later this year!

Alrighty, that’s all we’ve got for you today. In the meantime, we’ll direct your attention to upshot.xyz and dittohq.xyz, where the Modulus proving pipeline is already live to a limited audience.

Additionally, feel free to check out explorer.modulus.xyz. It’s our prototype AI verification dashboard, which catalogues each verification settlement in real time (more on the ✓Explorer soon, a lot of goodies here).

Until next time, stay up-to-date with Modulus via our Twitter, subscribe to our blogs, and for all things ZKML, you’re already in the right place.

“Welcome to a world of pure imagination

--

--