Create Publication

We are looking for publications that demonstrate building dApps or smart contracts!
See the full list of Gitcoin bounties that are eligible for rewards.

Article Thumbnail

Algorand Standard Assets

Introduction

An Algorand Standard Asset, ASA for short, is a layer 1 feature that allows users to represent any asset on the Algorand blockchain, in turn benefiting from the same level of security and ease of use as the native Algo. Detailed documentation about this feature is available on Algorand’s developer website here.

In this post we will draw out some of the most important concepts for developers who plan to work with ASAs. We will list some of the many examples of real-world assets that users can represent with this feature on the Algorand blockchain. Then we will share an example scenario paired with an interactive task to get you started with this new feature on TestNet.

ASA Important Concepts

ASA Transaction Types and User Flows

There are three new types of transactions on Algorand to support ASA-related functions, namely 1) AssetConfigTxn (‘acfg’), 2) AssetFreezeTxn (‘afrz’), and 3) AssetTransferTxn (‘axfer’). Those three types paired with different parameter specifications support seven primary user flows, namely: 1) Asset Creation, 2) Asset (re-)Configuration, 3) Asset Freezing, 4) Asset Destruction, 5) Asset Transfer, 6) Asset Revocation and 7) Asset Opt-In. Note that goal and the SDKs include wrappers for most of these user flows. See diagram below for the key differences between these user flows with respect to their underlying constructs.

Asset Diagram

Diagram that shows primary ASA user flows with respect to their underlying transaction constructs.

Asset Opt-Ins

To receive a new type of asset, an account must opt-in, which is the equivalent of the account sending a 0-amount transfer of the desired asset from and to itself. This will create a holding in that user’s account for that new asset, which gives others who own that asset the ability to transfer it to this user.

Minimum Balance Requirement

Every Algorand address that exists on the ledger, must have a minimum balance of 100,000 microAlgos. The addition of any new ASA holding increases that balance by 100,000 microAlgos. For example, if I opt-in to receive two different ASAs, my minimum balance will be 300,000 microAlgos (100,000 microAlgos x 2 ASAs + 100,000 microAlgos for the native Algo).

Freeze Assets

Upon creation of an asset, you can specify a freeze address and a defaultfrozen state. If the defaultfrozen state is set to true the corresponding freeze address must issue unfreeze transactions, one per account, to allow trading of the asset to and from that account. This may be useful in situations that require holders of the asset to pass certain checks prior to ownership (e.g. KYC/AML). If the defaultfrozen state is set to false anyone would be allowed to trade the asset and the freeze address could issue freeze transactions to specific accounts to disallow trading of that asset. If you want to ensure to asset holders that the asset will never be frozen, set the defaultfrozen state to false and set the freeze address to null or an empty string in goal and the SDKs.

Revoke Assets

The clawback address, if specified, is able to revoke the asset from any account and place them in any other account that has previously opted-in. This may be useful in situations where a holder of the asset breaches some set of terms that you established for that asset. You could issue a freeze transaction to investigate, and if you determine that they can no longer own the asset, you could revoke the assets. Similar to freezing, if you would rather ensure to asset holders that you will never have the ability to revoke assets, set the clawback address to null.

ASA Use Cases

With Algorand Standard Assets you can represent fungible and non-fungible assets and with varying degrees of control. Here is a small subset of what could be represented on layer 1 of the Algorand blockchain with ASAs:

  1. Loyalty Points— e.g. Airline points that can be traded in for seat upgrades, tickets, or merchandise.
  2. In-game points — e.g. Buy badges and other in-game assets.
  3. System/store credits — e.g. Provide credits to your customers that can be redeemed in-store.
  4. Supply Chain — e.g. Track food items, like bananas, through the supply chain to the consumer.
  5. Tickets Sales— e.g. Issue tickets of the same type and price for entry into an event, issue tickets to a basketball game where each ticket may have a different value.
  6. Cryptocurrencies — e.g. stable coins, fiat currency.
  7. Real Estate — e.g. Generate and issue shares of a building, represent ownership of a home.
  8. Certification — e.g. KYC-certified account, non-GMO certified account.

Interactive Task

Get started with Algorand Standard Assets, by opting-in to receive an ASA we created on the Algorand TestNet called Algorand Developer Coins. See the full task on our forums here.

Resources

This post was originally published on Medium: https://medium.com/algorand/algorand-standard-assets-efda8afcfc0a