Here’s Proof Why Confidential Smart Contracts Are the Future of Web3

Oasis Network
Oasis Foundation
6 min readSep 29, 2022

--

Smart contracts have the capacity to revolutionize the way we interact with the internet. Such simple programs hold much potential but are yet to find their killer application.

Community Translations: Hindi | Indonesian | Russian | Turkish | Korean | Filipino | German | Spanish | Serbian | French

Smart contracts are programs stored on a blockchain that run when predetermined conditions are met. They automatically execute an agreement so that all participants can be immediately certain of the outcome without any intermediary’s involvement or time loss.

Sounds great on paper, and is a path to speed, efficiency, trustlessness, transparency and security for various sectors. But, in practice, smart contracts have not reached their potential, and they are at risk of falling behind the curve unless something changes.

A need for Web3 smart contracts

The current blockchain-based smart contract arena is actually in a position that makes it unsuitable for Web3.

A lot of the issues stem from on-chain privacy. The very nature of public blockchains, with their trustless makeup and transparency, means that a trade-off for privacy has to be made. If you use a chain like Ethereum with its smart contracts, you have to be comfortable knowing you are broadcasting all the info needed for smart contract execution to the entire network and even the world.

But what if there was a solution to allow people to maintain their privacy and execute smart contracts with confidentiality while maintaining the integrity and transparency of the blockchain? What if certain aspects of a smart contract could be hidden yet still executed? What if, by default, user information was only accessible only by the smart contract?

This would mean nobody can determine how users interact with the smart contract, allowing the smart contract to decide what information to release publicly.

For a Web3 world, where user privacy and data sovereignty are key aspects, having such smart contracts would certainly scale blockchain into the next generation of the internet. That is why, at Oasis, we are enabling confidential smart contracts, and in particular for Solidity developers with the industry’s first-ever confidential EVM — Sapphire.

Confidential smart contracts in the real world

Let’s look at voting. Voting is an integral part of our democratic world, from electing who will bring in a cake for the office party to who will be the next president in charge of nuclear codes — voting matters.

However, many elections are still completed on bits of paper. Even those that have gone digital require trust in a central authority, which becomes an easy target to manipulate for the outcome of the voting. These non-digital and Web2 methods are highly inefficient and outdated. So perhaps we could turn to smart contracts instead? But, one key aspect of voting is anonymity — we want people to make their choice with no fear of prejudice or repercussion, so a lot of voting has to be anonymous.

If we decided to use an Ethereum-based voting dApp, information on who voted for which candidate and vote totals could be found anytime since transaction data and contract state are publicly visible on Ethereum.

In comparison, with confidential smart contracts, data and smart contract state are automatically encrypted and accessible only by the smart contract. This means nobody can determine how users interact with the smart contract (i.e. who they voted for) and allows the smart contract to decide what information to release publicly (i.e. vote totals).

Smart contracts would certainly be a viable way to make voting much more efficient and solve many issues we see today. Blockchain’s immutability would remove fears of falsified votes as the number of votes received by each candidate would be entirely verifiable.

Moreover, by implementing decentralized ID (DID) for voters, a system of one vote per person could be easily enacted and policed. Allowing only correctly registered users with verified DID to interact with the smart contract would mean fair voting across the election — but would also require secure, on-chain privacy.

Privacy would have to be a key feature to bring voting onto the blockchain, which is a big problem in traditional blockchains, where user data could become public onchain.

By utilizing confidential smart contracts, we can maintain the integrity and power that blockchain can bring to voting — and solve privacy issues. A confidential dApp, built on Sapphire, can implement confidential smart contracts for voting.

This dApp would ensure everyone’s vote is private, with only vote totals released publicly. Additionally, the dApp would hide the current vote totals of each candidate until the voting period ended.

How Sapphire can help

To still have the power of blockchain and smart contracts in Web3, we need to ensure privacy and empower confidentiality to protect individual data. At Oasis, we understand this is the missing piece of the puzzle and is one of the reasons we built the Sapphire ParaTime.

There are other ways to keep data private in smart contract execution on chains like Ethereum, but they require actions that may inhibit the integrity of the public blockchain — for example, confidentiality solutions where the information is taken off-chain. These are insufficient and would not enable full trust in a dApp used for voting.

Sapphire empowers confidential smart contracts with cryptographic integrity to ensure that participants are certain that the smart contract is exactly what they agreed to use and that it has not been tampered with or is publicizing their private information. It also allows for developers to pivot from Ethereum in a matter of minutes to experience these confidentiality solutions

Once smart contracts are kept private with Oasis’s technology, developers can take advantage of the extremely scalable infrastructure while maintaining the security and integrity of their data.

Confidential smart contracts allow data to be kept private, even from the node operators, so that users are assured that their information remains private, but smart contracts can still be executed.

How Oasis’s smart contracts work

In a confidential ParaTime like Sapphire, nodes are required to use a secure computing technology called a Trusted Execution Environment (TEE). With the use of key management, encrypted data goes into the Secure Enclave along with the smart contract, where the data is decrypted, processed by the smart contract, and then encrypted before it is sent out.

This process ensures that data remains confidential and is not disclosed to the node operators or application developers. Other secure compute technology, such as Zero-Knowledge Proofs (ZKPs), can also be used to execute private smart contracts. The interchangeability of secure compute technology is an additional example of modularity and value proposition at the ParaTime Layer on Oasis.

Why confidential smart contracts can bring blockchain into Web3

Blockchain is a revolutionary technology, but it is also in its second decade of existence at a time when the digital space moves very fast. Some of the advancements made by the technology are already outdated.

The Cambridge-Analytica Scandal had not even broken when Bitcoin, and thus blockchain, was created. This scandal thrust user data and the need for privacy into the limelight. In the past decade, the desire for user privacy has grown exponentially while blockchain is still lagging in addressing it.

At Oasis, we understand that privacy is a core pillar of Web3 that has evolved in the last decade. We also understand that blockchain has a long way to go and has much potential to scale. However, to ensure blockchain scales to Web3, we need a privacy solution that maintains blockchain integrity with user data sovereignty.

Confidential smart contracts are one major puzzle piece that makes Web3 possible. Having an EVM runtime that offers the potential to build these smart contracts is also the most direct and powerful way to bring blockchain into Web3.

Join our Discord and follow us on Twitter!

--

--

Oasis Network
Oasis Foundation

A privacy-first, proof-of-stake, decentralized network. Learn more at https://oasisprotocol.org/ & sign up to our newsletter at https://oasisl.ink/3ha7bHy