With Arweave's 'Lazy' Approach to Smart Contracts, Its Version of Web3 Does More
Arweave, a blockchain network meant for the permanent storage of data, has released a completely new approach to smart contracts.
![Arweave CEO and co-founder Sam Williams speaks at the Fall 2019 Multicoin Summit. (Credit: Multicoin Capital)](https://www.coindesk.com/resizer/flxwZbB_ywzjfTW_vAmu6bPb9fE=/567x378/filters:quality(80):format(jpg)/cloudfront-us-east-1.images.arcpublishing.com/coindesk/IKMWKPCHNVDZJBSSZR5IIARH3A.jpg)
Arweave, a blockchain network meant for the permanent storage of data, has released a completely new approach to smart contracts.
In short, smart contracts on Arweave, much like must of the code on websites today, will be run by users' computers rather than the blockchain itself. Released Thursday, SmartWeave is an approach to smart contracts that allows the blockchain to dispense with gas fees and only requires a smart contract's code to be run as often as it's needed and not by every node on the network.
"SmartWeave is a new smart contract language environment built on top of the Arweave network," Arweave's Sam Williams told CoinDesk. "It uses this novel type of evaluation called 'lazy evaluation' to move the computational burden of smart-contract execution from the nodes in the network to the users of the smart contract."
It's like the bake-at-home pizza versus Pizza Hut. Arweave keeps the data ready, available and accurate (in the freezer); users' machines only need to make sense of that data (bake it) when, and only when, it is needed.
Lazy evaluation verifies the data and, in particular, when each piece of data came into the system.
"The key thing Arweave is offering you is the ability to say every single thing that came through the system has a time ordering," Williams said.
As Ethereum's perpetual problem with front-running on decentralized exchanges (DEX) illustrates, establishing the order of events reliably is one of the more important pieces of work decentralized systems need to do.
That said, it's not important that each node on a network verify precisely how each digital document renders. Much as each computer that opens a website interprets its HTML and JavaScript locally, Arweave requires users' computers to do the processing of information, not the network itself. This logic makes sense because Arweave is fundamentally built to be a new kind of internet.
"Arweave as a base protocol is very focused on decentralized, autonomous web services," Williams said.
Entering a space similar to that of Blockstack, Arweave offers a kind of internet that users log into directly. Once a wallet has logged into Arweave, it can move around all kinds of apps without needing to log into them individually. Williams expects this will create interesting new experiences that we can only partially imagine now.
Arweave's chief value add is creating a system in which data loaded onto the network can be stored there affordably, forever.
What it can do
Many apps have already been built for Arweave but SmartWeave will open a new level of functionality, both because of what it enables and the language it runs on.
"If you know JavaScript you can write this immediately," Williams said. "I would expect we see DAOs within a few weeks."
Williams gave a simple example of a potential DAO. Imagine an Arweave based blogging platform, like Medium, that anyone could use but whose prized front page was controlled by a committee (that's the DAO).
Each committee member would have some kind of governance token that allowed them to vote posts to the front page. Whenever each of them opened Arweave and cast their votes for posts, that would get logged as data on the chain.
Each terminal that opened the blog would simply look at the votes and use that to construct the front page that each user sees when they first visit the blog's homepage.
Arweave has a few sample applications ready to go, such as a basic ERC-20-like and non-fungible token (NFT) modules that will be easy for developers to adopt.
High voltage
The limitations really come off of smart contracts when the processing moves off-chain.
"What that means in practice is the smart contracts can involve exceptionally large amounts of work," Williams said. "That wouldn't really be possible in a normal smart-contract system like Ethereum."
After that, as developers start to realize further potential for Arweave, Williams expects people will begin to plug machine learning and artificial intelligence into SmartWeave smart contracts. By taking the processing off the network, considerably more powerful kinds of computing can be brought to bear without driving up costs or clogging up the blockchain.
There's another benefit here: safety.
Said Williams:
The nodes aren't doing all that work. Like on the web, the user needs to trust the code that's going to be executed but the entire blockchain doesn't need to protect itself against every smart contract.
"I think there will be a later wave that when people start to realize that the additional computational power that SmartWeave allows you access to unlocks a huge number of things you just couldn't have built previously," Williams said.