Asset and Account
Asset
There are two kinds of assets in NEO: One is UTXO-type global assets, such as NEO and GAS. They are defined in Genesis Block. The other is NEP5 assets, which is generated by a smart contract. The former are recorded in transactions, while the latter are stored in the contracts' storage space.
Size | Field | Type | Description |
---|---|---|---|
32 | AssetId | UInt256 | assetid = tx.hash |
1 | AssetType | AssetType | |
? | Name | string | |
8 | Amount | Fixed8 | amount = -Fixed8.Satoshi = -1 = infinity |
8 | Available | Fixed8 | |
1 | Precision | byte | |
1 | FeeMode | const byte | |
8 | Fee | Fixed8 | |
20 | FeeAddress | UInt160 | default null |
? | Owner | ECPoint | |
20 | Admin | UInt160 | |
20 | Issuer | UInt160 | |
4 | Expiration | uint | |
1 | IsFrozen | bool | Frozen assets, cannot be transferred |
There are two models of
Amount
: One is unlimited, the amount is set to-Fixed8.Satoshi
, which means infinity. The other is fixed amount that cannot be modified.
AssetType
Type | Value | Description |
---|---|---|
CreditFlag | 0 | |
DutyFlag | 0x80 | |
GoverningToken | 0x00 | Neo |
UtilityToken | 0x01 | Gas |
Currency | 0x08 | |
Share | DutyFlag | 0x10 | Equity-like assets |
Invoice | DutyFlag | 0x18 | |
Token | CreditFlag | 0x20 | Normal token |
Asset with
DutyFlag
, needs the signature of the payee.
Asset Name | Type | Value | Amount | Description |
---|---|---|---|---|
NEO | AssetType.GoverningToken | 0x00 | 100 million | All of which are transferred to the address of the standby consensus nodes' multi-signature contract in Genesis Block |
GAS | AssetType.UtilityToken | 0x01 | 100 million | Released as new blocks are generated, and NEO holders can claim GAS through ClaimTransaction |
Account
In NEO, the account model and UTXO model coexist. An Account has the records of the UTXO-type global assets and the voting information.
Size | Field | Type | Descriptoin |
---|---|---|---|
20 | ScriptHash | UInt160 | The hash of account's script contract. |
1 | IsFrozen | bool | Fronzen accounts cannot transfer. This field is not currently used. |
? * ? | Votes | ECPoint[] | the voted address list |
? | Balances | Dict<UInt256, Fixed8> | UTXO assets, mapping from assetId to amount. |