ASA Details

Transcript

Toggle full transcript
00:00

So now that we've covered some of the basic concepts around Algorand standard assets, let's dive into some of the detail. More specifically, the key thing to understand is parameters.

00:10

Parameters. The key way that you can specify the information associated with an ALGORAND standard asset, including metadata and other properties.

00:20

And for instance, when you create an asset for the first time, you need to set the values of some of these key fields.

00:30

You need to be careful with which fields you set, with what values. Some of them aren't able to be changed later. So it's important to have an understanding of what all of these fields mean so that you can plan ahead and understand.

00:40

So the asset that you need to represent what each of these values should be. So let's run through all of the fields and I can give you some tips about them.

00:50

First and foremost, it's basically four different categories of fields. So we've got the ID and name. We've got various things related to the quantity of the asset.

01:00

We've got some metadata properties, and then there's a series of algorand account addresses that can be associated with an ALGORAND standard asset.

01:10

A more useful way of representing these fields is to look at two sets of properties.

01:20

The first is whether or not the fields are immutable or immutable. So what that means is immutable fields can only be set at creation time and then cannot be changed.

01:30

Whereas under certain circumstances the immutable fields in the right column can be changed. And then the second property to look at is whether or not these parameters

01:40

are mandatory, i.e. you have to specify a value when creating an asset or if they are optional. You don't have to specify a value.

01:50

Let's start by honing in on the mandatory immutable parameters. So these are the ones that you have to set

02:00

when creating an asset and cannot be changed. So you need to get them right first go. The first one is the asset index. The asset index is an ID that allows you

02:10

to uniquely identify a given asset on the ALGORAND blockchain. Now, this is one that you don't actually set. It's set for you. It's created automatically and will often be displayed as asset ID

02:20

on various user interfaces in the Algorand ecosystem.

02:30

The Creator is the Algorand account that actually issued the transaction to create the asset, so that one is also set automatically.

02:40

The total field is a number that represents the total number of these assets that exist. So if you're creating an nonfungible token, then you're probably going to set this value to one to indicate that there is only one of these items.

02:50

And if you're implementing something like the Usdc Stablecoin, then you might say that there's a total supply of, say, $10 billion.

03:00

Now in here, the actual total value for Usdc is actually about $18 trillion. Decimals specify whether or not you can

03:10

fractionalize or split up the asset. That is, you can divide any one of the asset into multiple parts.

03:20

So the equivalent for real money is dollars and cents. You can have 100 cents to a dollar. So if you were representing dollars and cents, then you would set

03:30

the decimals to be two because you've got two decimal places. Now in this case, Usdc actually has very fine grained ability to be split and the decimals is actually set to six

03:40

Algoanna 220 as an NFT can't be divided into parts. So in this case the decimals zero are default frozen

03:50

relates to one of the building blocks that Algorand has built into it. For context, one of the key use cases for Algorand is decentralized finance or defi.

04:00

There are concept parts in finance more broadly that are highly useful, and one of them is freezing this says that a particular account cannot transact with an asset.

04:10

Now, in an algorand sense, there's a number of situations where being able to use freezing is useful. So one example might be where you need to perform a know your customer check

04:20

before allowing someone to transact with an asset. So what this default frozen field does is it says that when you create this asset,

04:30

it is frozen by default and no one can transact with it unless an action is taken to unfreeze the asset.

04:40

Next, let's have a look at the immutable fields that are optional. So these are the fields that, again, you can only set when creating the asset. And once they are set, they can't be changed.

04:50

But in this case, you don't have to specify them. The first one is the asset name, which is absolutely a recommended field. If you don't specify it, then most user interfaces are going to be

05:00

pretty unusable because the asset name is often used to describe the asset. For instance, if you have an asset in your wallet, the asset name has a maximum of 32 bytes.

05:10

So for a standard set of characters that would translate to a 32 character name, the unit name is

05:20

used as the representation when you are transferring an asset. So for instance, if I was going to transfer a quantity of 200 USD, say then it would actually

05:30

say I'm transferring 200 of Usdc is the unit name. Now in this case, the unit name in the asset name of the same. So you wouldn't be able to tell the difference.

05:40

However, a better example would be if I was going to send you, Algoanna 220. It would say that I'm transferring one times, goan20 rather than one times Algoanna 220.

05:50

The URL is an optional bit of metadata that basically allows you to point to information or metadata that's relevant for the asset.

06:00

In the case of Usdc, that field is not populated, but in the case of Algo in A220 it's pointing to an ipfs URL

06:10

that actually contains the image that you can see that of the owner. And finally, the metadata hash, which is an optional field that allows you to specify an integrity

06:20

hash of what you should expect when you request the URL. This can be used to give confidence that the content being requested is intact.

06:30

Finally, let's look at the immutable fields. The manager address is the address for an algorand account

06:40

that has permission to change these mutable asset parameters. If you don't set this, when you create the asset, it means that all of the fields become immutable,

06:50

since no one actually has the permission to set any of them. And at any point in the future. If you ever set the manager address to empty, then it can never be set to anything else.

07:00

So at that point in time you would turn an asset from being mutable to being immutable. This can be quite handy if there's a period of time where you want an asset to be able to be modified.

07:10

Then there's a point in time where you want to give confidence that it can't be changed and it would stay intact. The reserve address

07:20

is basically just an informational field. Notionally, it points to an account that you designate as the reserve. So for instance, if you minted USDC with the $18

07:30

trillion worth but you're only currently circulating, say $1.000.000.000 worth of currency, then that would mean that you'd have $17.999 trillion sitting in the reserve account

07:40

given that this is a immutable field and it's only for informational purposes.

07:50

Sometimes the reserve address actually gets used for immutable metadata, particularly in the case of some of the NFT metadata standards in algorand. The freeze address is the address that has permission to either

08:00

freeze or unfreeze this asset. So for instance, if you set default frozen to true, you would have to set the freeze address so that you can actually unfreeze

08:10

the asset for a particular account to transact with it. And finally, the clawback address is another feature

08:20

in Algorand that's built in as a useful financial building block. The basic idea is that the clawback address, regardless of the frozen status or who currently owns

08:30

the asset, can actually repossess the asset essentially, and move it to a different account at any point in time.

08:40

So again, this is just a really handy building block feature that can be useful in certain circumstances, particularly when combined with the freeze functionality.

08:50

It's worth pointing out that for all of these fields, as soon as you set any one of them to empty, the net field is then immutable and can no longer be set to something in the future.

09:00

And to reiterate, the manager address is the only one that has permission to change any of this.