The month of August is proving to be rather successful for Algorand. After experiencing a sharp drop due to the global pandemic during March this year, ALGO token value shot up sharply this month, touching $0.7 mark – the highest over a year. Though it came down a bit, ALGO price increased from $0.53 to $0.66 – a 24.5% jump between August 19-20 and vacillating around $0.6 since then.
This is fueled by Algorand founder Silvio Micali announcing Algorand, adding stateful smart contract features to its arsenal that will immensely boost its capability.
Unlike many older smart contracts operating solely on layer-2, Algorand smart contracts operate on both layer-1 and layer-2. What makes Algorand smart contract highly secure and efficient, is its implementation on layer-1.
Written in a special language called TEAL, Algorand’s layer-1 smart contract has two components – stateless and stateful.
Deployed in November 2019, stateless smart contracts provide instructions supplied within each transaction to either approve or deny it, which makes it very efficient. This allows a user to highly customize a single or group of transactions with certain conditions without any intermediary, therefore at greater transparency and substantially reduced cost. It means stateless smart contracts are executed only when all requirements are met, thus guaranteeing total atomic trade.
Stateless TEAL application also includes complex independent payments, escrow system, collateralized loans, etc.
Stateful, on the other hand, addresses the situation when conditions are not (cannot be) attached to the transaction. This should allow a transaction to occur when a sequence of interactive conditions have been met.
Implementing the stateful TEAL, Algorand must remain true to its gene – maintain block production time of a few seconds, low-cost transaction, and transaction finality simultaneously. While working for the solution, this led to two issues –
- Storing state condition on blockchain – This approach is not at all an efficient option. Retrieving widely spread blocks of long-running applications hampers the block production rate. Also, data annexation required to simulate overwriting puts a load on the blockchain.
- Storing state condition on off-chain – This method directly impedes multiple state change concurrently. Therefore it leads to just a few transactions per second, restricting scalability.
The Algorand Workaround
The Algorand team has resolved these problems by storing the state information in the creator’s account of an application and its participants’ accounts. The creator account holds the global state information of an application, while user accounts hold its local state information. Only the application can change these state data.
The reason behind this decision is these accounts are very efficiently generated and consulted while the operation is cheap – a balance of just 0.1 ALGO in the application account is required.
- Concurrent operation – This allows multiple transactions to simultaneously change an application’s state data without blocking the other, thus providing true concurrency.
- Skimping resources – Algorand has limited the state size for creator and sign-in accounts, ensuring fast block generation as before. This leads to the stateful TEAL program maintaining 1,000 transactions per second for virtually unlimited sign-in accounts at layer-1.
- Efficiency – The state size for each account grows with more sign-ins and becomes large enough to handle big important applications efficiently.
- Low cost – To store its local state information in the application, a participating account must keep a nominal balance (0.05 ALGOs per variable-value pair of local state), instead of paying a fee. On opting out, the reserved balance is revered through on-chain transactions.
PyTEAL is a python binding for Algorand stateless smart contract that was launched in February 2020. Algorand introduced PyTEAL so that developers can write codes/objects and run various operations in Python (a high-level language) with ease, while this gets compiled into TEAL opcode.
Now, the PyTEAL support is also extended to stateful smart contracts, bringing simplicity, modularity, and interoperability. This will allow developers to concentrate on logic, writing complex applications in a much simpler way.
The stateful smart contract became the fourth feature to join Algorand’s previous three layer-1-based features – stateless smart contract, ASA, and atomic swap.
- Empowering ASA – Algorand Standard Assets (ASA) feature allows the creation of both fungible and non-fungible tokens, attracting many leading projects such as Circle’s USDC stablecoin, Marshall Islands’ CBDC, IBMR.io’s macro-economic project for partnership. Also, Algorand offers the ability to generate restricted fungible tokens like security tokens – one such example would be Realio’s RST token.
Now, what if there’s a requirement to create a security token with a customized restricted trade feature? This is where the stateful smart contract’s global state and local states of user accounts feature help out. In fact, Republic – a project with thousands of accredited investors, has selected Algorand to launch their security token.
- Complementing Atomic Swap – Algorand’s layer-1-based atomic swap feature allows users to trade assets securely. But this requires prior knowledge of the exact trade item, its price, and the seller. To take care of this, A stateful smart contract functions as an order book. A buy/sell order posted is saved in the order book application’s local storage for a user. Transfer happens only when buyer and seller conditions are met.
- Crowdsourcing opportunity – Stateful smart contract enables a user to create his/her own funding campaign with specific goals mentioned or set. He/she can withdraw funds only if the goals are achieved; otherwise, it will be disbursed to the donors. A separate stateless contract for each opted-in donor releases the fund on fulfilling the conditions.
- Challenging Ethereum – While stateless smart contract ensured blazing fast transactions, stateful smart contract brings more flexibility to Algorand. The stateful smart contract enables Ethereum to attract varied types of projects to build advanced DApps and De-Fi solutions. With this upgrade, Algorand has finally brought the fight directly to Ethereum.
Apart from this, this update also creates various auctioning and yield farming opportunities.
Algorands’s PPoS algorithm, coupled with several crucial features built into layer-1, has allowed it to boast high scalability, high TPS, exceptionally low transaction time, and nominal transaction fees. Even with this upgrade, Algorad remained true to that tenet while expanding its capability.
Algorand’s enterprise-grade De-Fi focused infrastructure solution has drawn about 400 clientele and more than 35 partnerships, including the top two stablecoins and a CBDC. As Ethereum 2.0 launch continues to get delayed, Algorand is proving what many experts anticipated since the beginning – Algorand is steadily pushing towards attaining De-Fi supremacy.
Subscribe to our Newsletter to be a part of our future $1,000 per month contests.