Stacks 2.0 vs AWS Lambda
By: Radicle Society
Tags: AWS, Blockstack, Stacks2, Bitcoin, AWS Lambda

The much anticipated release of the Stacks 2.0 blockchain is drawing near and we thought it might be helpful for AWS developers to understand why this is big news and how it might affect them. Put simply the Stacks network adds smart contract capability to the Bitcoin blockchain. Clarity Contracts share many of the characteristics of the underlying blockchain. They are uncensorable, transparent and inherit the most important features of a global consensus network — they provide an independent mechanism for determining the ownership of digital assets.

In practice Clarity Contracts are similar to lambda functions in AWS’ Serverless, small units of code with responsibilities for carrying out well defined operations, but unlike lambda functions these contracts run securely on a decentralised network of computers that is not controlled by any single entity — no multinational corporation or individual person is able to own and control this new Internet — sorry Jeff!

What difference does it make who owns the Internet?

Without rehashing the hacks and identity thefts, the fake news and other problems which beset our beloved but highly centralised Internet we’d like to point out the that the door is opening. New models for organising the Internet are taking root and they hold the promise of a real shake up.

Secure and instant person to person payments are in the next room! Imagine financial transactions with no banks or middle men needed. Also there will no longer be the need for passwords or storing credit card details on huge, hackable databases. How about owning your own online identity, owning your own digital property? These things are just down the hallway. They will usher in a new Internet age, one where you control all the posts you’ve made on social media — can remove them or stop sharing them through say Facebook and choose a different platform.

These innovations build on the Bitcoin revolution that started ten years ago and are happening because we need a fairer and safer Internet for the generations to come.

Non Fungible Tokens

To make this more tangible consider the new field of NFTs — Non Fungible Tokens is the common vernacular for digital assets which are registered on-chain. One class of such assets, for example, are digital collectibles (DC). DCs have taken off on the Ethereum blockchain with a frenzy of interest in buying, selling and collecting them. They are really interesting not only for their own sake but what they signal for the future of the industry. DCs serve as the proving ground for the technology in general. If we can build stable, scalable and robust blockchain applications which handle the creation/minting, transfer of ownership etc of DCs then this opens the door to managing other types of digital assets — from car registration documents to property deeds — the imagination is the limit!

Our interest in this field is in the ability to manage (mint/register/transfer ownership) of digital assets rooted in the Bitcoin blockchain. This is becoming possible as we speak with the Stacks 2.0 project, soon to launched on mainnet.

The technology behind all this involves some new concepts. Users have wallets and wallets hold the private keys required to sign the transactions they wish to broadcast to the consensus network. These transactions can be anything from simple transfer of tokens to interactions with smart contracts to provide the more advanced features of asset management such as trading through marketplaces and auctions.

The details of how Bitcoin and Clarity contracts work under the hood is complex and highly technical. But then so is the story behind say, ARNs on AWS and exactly how API Gateways work and access AWS Lambda functions. One massive difference however is that with the former, the code is open source. Available for anyone with the stomach for it to dig in!

Verifiable

Not only is the code open source but the runtime state is verifiable. In any web 2.0 auction platform the code that runs the bidding is private but so to is the data. This means bidding software can act against the interests of buyers and sellers to maximise the gain of the Auction Houses. Smart contracts change the rules of this game. Anyone is able to read the code but more importantly anyone can examine the transactions, the bidding and the transfers of assets. Clarity smart contracts bring a level of much needed transparency to these kinds of trades.

In general once a signed transaction is broadcast it will address a specific Clarity Contract method and cause some code to run, some state to change etc. The effect is much the same as anything you’d expect from an AWS Lambda function, including triggering events to communicate with other parts of the system — like the SNS/SQS bridges in AWS.

For example a transaction can trigger code which mints/creates an NFT. Comparing with the equivalent AWS Lambda function brings home the fact that in using the blockchain version we are creating a globally unique digital asset for which we can prove the ownership — not something that will ever be possible on AWS Lambda functions.

Pre / Post Conditions

One of the really nice features of Clarity and smart contracts in general is that they have built in support for preventing fraud, corruption and theft. They do so by providing checks called Pre and Post Conditions which can tie the contract code into a set of predefined rules. For example, a postcondition might impose the condition that the contract never transfer more more than X amount of tokens from the users account for a given transaction.

Summary

The global economic cost of the pandemic could be swallowed by one years profits of the world’s top 5 largest Internet companies. But where does all that money come from?

The Internet is the largest centraliser of economic wealth that the world has ever seen. The Internet is also the no more than the creative output of humanity in general. Our project and the work of the Stacks Foundation is one small corner where people are challenging the assumption that we can’t do better. We believe the Internet can be decentralised and that this is the best way to redistribute the economic value it generates back to the people who really own it — everyone! The goals of the Stacks Foundation are to build a User Owned Internet that works in the interests of everyone and that creates a new foundation for sharing the economic benefits that the Internet brings. We support them wholeheartedly in that endeavour — and hope you will also?