What if smart contracts were a new web standard = new achievement unlocked?
Edit: thought of a catchy name for this – Smart REST.
Smart contracts are all about formalizing trust relationships in an effort to try reduce critical points of failure within an agreement. The idea is that instead of trusting that a person will carry out a given function - we clearly segregate and define those responsibilities which can then be tied to the conditional release of collateral, the change of reputation, the conclusion of a legal contract, and even actions taking place within the real world.
To do this we use cryptographic ledgers which offer us a way to securely and publicly record relationships between individuals. In the case of financial relationships – some of these relationships can be made 100% trustless by using cryptography (a godsend to finance) - and in other cases its usually possible to reduce the amount of trust involved by using things like distributed oracles, or by incrementally completing sub-agreements.
So far we’ve found plenty of ways to use smart contracts to solve trust problems (mostly in a financial context) but I argue that the idea can also be used to vastly improve the world wide web. Imagine for a moment that every website now supported smart contracts by default. Crazy shit would become possible. Here’s what a cryptographically linked WWW might look like.
Actions against websites are now transactions.
Every action on a website is now associated with a concrete transaction type. Want to cancel Internet plans, switch phone providers, or post a message to social media? There’s a transaction for that. Additionally, just like with transactions in Bitcoin – we can specify complex conditions for a transaction’s validity by using a cryptographic domain specific language.
Transactions are signed with digital signatures.
Every website account now has an ECDSA key pair that can’t be revoked. The key pair can be permissioned for increased security and can be queried against an account to check for integrity. This is necessary to do smart contracts because all existing authorization schemes rely on producing access tokens that can be revoked, passwords that can be changed, or accounts that can be canceled (making enforcing agreements impossible.)
Objects and resources are smart property.
Any action that results in the creation of a new object (like a message) or manipulates the state of an existing object / resource should be restricted by the same cryptographic scripting language as if it were a kind of smart property. This prevents individuals from forming contracts to do some action and then doing the inverse of that action later on to cancel the contract.
Future commitments are enforcible.
Welcome to web 3.0. You can now create complex, conditional, and enforcible actions against websites, between any number of parties. Want to ask a girl out on Facebook but only if your friend asks out their crush too? There’s a smart contracts for that. Essentially any action that a website allows can now be captured as a smart contract, committed to on a public ledger, and used as part of some cryptographically enforcible protocol.
Actions can be used to enforce agreements.
There are other disincentives that can be used to backup agreements other than purely financial losses. You can make people commit to authorizing any kind of actions that would have devastating consequences if an agreement were to be broken. Imagine a contract whereby a person’s utilities were canceled if the parties couldn’t agree on an outcome. Or perhaps a contract that causes a person to resign from their job?
Smart contracts make the web interoperable.
Actions against disparate services can now be chained together to produce complex, emergent behavior, resulting in new services that can’t presently be done any other way. Suddenly the web is interoperable. A service need not understand the function of any other service but they can still interact so long as every service commits to using the same language for cryptographic agreements. I hate to use buzzwords here but “the Internet of things” (translation: new, unexpected, Internet-connected devices) could make highly interesting and unexpected agreements possible.
Blockchains make this possible already.
Blockchains provide the blueprints for how this can be done but within a web context, having private N party verifiable contracts between oracles and individuals would also be necessary. This could be done using standard crypto, the only pieces that are missing are a formal technical specification for the web that takes into account privacy, flexibility, scalability, enforcement, security, and the way smart contracts are currently written.
It also remains to be seen how much of this needs to be done off-chain. There are probably existing consensus systems that would be up to the task but in my opinion Bitcoin wouldn’t be one of them due to the severe limitations of its scripting system and its current poor scalability (no offense, maybe in the future?) Besides, the problem isn’t just about what consensus system to use but how we should formalize and provide oracle specific functions across the websites that choose to support this standard.
tl; dr, A smart contract standard for programmable REST-based actions on websites would make services interoperable and allow for new possibilities for forming online agreements. The original idea for smart contracts and shared property ledgers was Nick Szabo’s.