Summary

It’s 2021, and the idea of smart contracts seems exciting to a guy interested in technology and economics: code, executed by a decentralized computer called blockchain, serving as a self-enforcing contract between any 2+ people on earth. There are many contracts people might like to have but can’t, because there’s nobody to enforce them. Could this e.g. allow farmers scattered across the globe to pool their weather risk, creating insurance for themselves even in markets where no insurance company yet bothered to go?

The short answer was no, because smart contracts only see what’s happening on the chain. They’re blind to the outside world. Most users didn’t bother because they just cared about tokens, but it made me furious. So my friends and I set out to create a protocol that would allow smart contracts to receive and verify proofs about arbitrary https data (e.g. the most recent weather in Ghana according to https://weather.com).

Because of how HTTPS works - mutual secrets between client and server - this requires a proof that the prover didn’t use the secret to manipulate the data. We used what AWS calls ‘Nitro Enclaves’, a form of trusted execution environment, to create such a proof in a secure way. Using a chain of trust involving signatures and AWS’s attestation documents, any smart contract can verify the veracity of arbitrary python code parsing arbitrary https data through our protocol. This enables a bunch of applications:

As typical for cryptographic protocols, things get pretty complicated once you look under the hood:

Fortunately, a contract developer would just have to write a html parsing python script and the contract logic, each 30 lines of code or so, and the rest is abstracted away. The protocol would even auto-generate a UX so people could interact with your contract from the browser, even if you’re not a WebDev.

By the time the protocol was working and open-sourced, we got pretty disillusioned with the space. It felt like most devs were mostly trying to fix problems created by the technology itself, and the userbase mostly wanted to speculate on token prices. Nobody was that interested in solving real-world problems for real-world people.

Not much has changed since then. Maybe the technology still just isn’t ready yet, maybe guaranteed trust between strangers is just not that useful on top of existing institutions, even in developing countries. Or maybe, all you need to derail a technology is to have an easy way to make money with it before solving real problems for end-users.