-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIP-21][Discussion] Fungible Asset using objects #95
Comments
Interesting well. Hopefully gas cost not so much. |
@e99243506bigplay execution gas is already 100x cheaper. Storage would not charge much, thanks to |
I am greedy about gas cost fee cut down 😄 |
Is the idea that future Aptos based coins trading on exchanges will adopt this module rather than aptos_framework::coin? Will APT eventually move to this? |
Hi, that's the objective we're pushing the community forward for. We're still designing the migration plan for existing coins, including APT. cc @movekevin |
AIP Discussion
Discussion and feedback thread for AIP.
Link to AIP: #96
aip: 21
title: Fungible Asset Standard using objects
author: lightmark
Status: Draft
type: Standard (Framework)
created: 04/11/2022
[AIP-x] Fungible Asset using Objects
Summary
This AIP proposes a standard of Fungible Asset (FA) using Move Objects. In this model, any object, which is called Metadata in the standard, can be used as metadata to issue fungible asset units. This standard provides the building blocks for applications to explore the possibilities of fungibility.
Motivation
We are eager to build fungible asset on Aptos as it plays an critical role in the Web3 ecosystem beyond cryptocurrency. it enables the tokenization of various assets, including commodities, real estate, and financial instruments, and facilitate the creation of decentralized financial applications.
Besides aforementioned features, fungible asset is a superset of cryptocurrency as coin is just one type of fungible asset. Coin module in Move could be replaced by fungible asset framework.
Rationale
The rationale is two-folds:
We witnessed an drastically increasing needs of fungible asset framework from Aptos community and partners. The earlier coin module is obsolete and insufficient for today's needs partially due to the rigidity of Move structs and the inherently poor extensibility that it’s built upon. Also, the basic model of authorization management is not flexible enough to enable creative innovations of fungible asset policy.
The old coin module has a noticeable deficiency that the
store
ability makes ownership tracing a nightmare. Therefore, it is not amenable to centralized management such as account freezing because it is not programmably feasible to find all the coins belonging to an account.fungible asset framework is born to solve both issues.
Specification
fungible_asset::Metadata
serves as metadata or information associated with a kind of fungible asset. Any object with fungibility has to be extended with this resource and then become the metadata object. It is noted that this object can have other resources attached to provide richer context. For example, if the fungible asset represents a gem, it can hold anotherGem
resource with fields like color, size, quality, rarity, etc.FungibleStore
only resides in an object as a container/holder of the balance of a specific fungible asset.FungibleAsset
is an instance of fungible asset as a hot potatoPrimary and Secondary Stores
Each account can own multiple
FungibleStore
s but only one is primary and the rest are called secondary stores. The primary store address is deterministic,hash(owner_address | metadata_address | 0xFC)
. Whereas the secondary store could be created when needed.The difference between primary and secondary stores are summarized as:
Reference Implementation
aptos-labs/aptos-core#7183
aptos-labs/aptos-core#7379
aptos-labs/aptos-core#7608
Fungible asset main APIs
Fungible store main APIs
Risks and Drawbacks
DeriveRef
could also be used by other module to squat the primary store object. This requires the creator of metadata to bear that in mind. So we limit the function can be only called byprimary_store
module for now. The reason behind this is the name deriving scheme does not have native domain separator for different modules.Future Potential
There is still some room for improvements of management capabilities and the way to locate fungible asset objects. Once we have a powerful indexer with a different programming model then it may be unnecessary to have primary store anymore.
Suggested implementation timeline
By end of March.
Suggested deployment timeline
on Devnet by early April, on Testnet by mid April and Mainnet by early May.
The text was updated successfully, but these errors were encountered: