Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
RFC: New instruction for the reservation of asset classes/IDs #35
base: master
Are you sure you want to change the base?
RFC: New instruction for the reservation of asset classes/IDs #35
Changes from 2 commits
93bcae2
796cbf2
9d9c4b9
9ec98b2
49923ad
36b2591
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would instead call this
AcquireAssetId
, since:a) you're not actually creating any assets; and
b) you're appointing a controller for the given asset class/ID.
Alternatives are:
OccupyAssetId
SeizeAssetId
TakeAssetId
AppointAssetIdAdmin
ProcureAssetId
ObtainAssetId
My favourites are
ReserveAssetId
andHoldAssetId
, however these clash with pre-existing terminology.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about
CreateAssetId
orCreateAssetType
orCreateAssetClass
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you're really creating anything so much as priming some namespace which is already yours to do so by virtue of the origin.
Perhaps
InitializeAsset
orSetupAsset
..There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vstam1
what amount? e.g. for pallet_assets::create we need
min_balance
, is this it?just thinking, if it would be better like this, not sure:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These instructions are not connected to FRAME-based systems, so this instruction should also be usable to create an ERC20 token, for example, where the amount can represent the total_supply.
Like you said, the amount could represent the min_balance for the assets_pallet.
I do not directly see the difference between the CreateAsset with the assets field or with the id and fun fields split as the MultiAsset has both of these fields. However, if we split the fields, we could set the
fun
toOption<Fungibility>
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, I know they are not connected and xcm should be disconnected from frame as much possible,
ideally, fields should be self explanatory and also to avoid confusion or misuse,
so e.g.
MultiAsset.fun.amount
if user thinks about this amount as "total_supply" and on target system, we use this with several "AssetTransactors" where one can interpret this as "total_supply" and other as "min_balance", it could lead to problemsso for this case, fields split, as you said with Option could work better:
we can go also with some properties wrapper and so on :)
yeah, I understand that this should be pretty generic to cover all cases,
so I am interesting where this will go :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah you are definitely right that it could cause serious problems (imagining an asset that has its min balance set to value that should be total_supply haha). I would like to see more feedback on this approach. Especially the AssetProperties approach as it might also solve the Metadata related question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of an
AssetProperties
, but I think we can't reuseFungibility
for those fields.I think a possible approach would be to make the fungibility separation in the properties themselves.
If we add the largest amount of properties pertaining to that fungibility as possible, if some implementations don't handle some of them, like collections for example, they can just ignore that field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could reasonably have an
AssetProperties
field in there I guess. It'll be a bit weird through since we'll need to make all fieldOption
al otherwise we'll force the sender to introduce garbage info for fields which don't make sense for their asset and hope that the receiver ignores them. But then not all receive will support all fields. I guess we can have a convention of strictness, whereby receivers require some fields to beSome
(if their implementation really needs them) orNone
(if their implementation doesn't support them and they're actually important). Other fields it might be flexible on.What would the proposed
collection_id
be? We have a namedowner
already for the asset class/ID who can actually mint the (NF)Tokens. Ifcollection_id
is passed anywhere, I'd have expected it to be passed when minting, not initializing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea of calling the instruction
InitializeAsset
, as well as adding the AssetProperties field. Is there already a standard for NFT metadata?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case is the origin allowed to create the asset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this depends entirely on the implementation. For what it's worth, the initial impl for AssetHub will allow any location to create its own asset and assets at any sublocations, which is a perfectly reasonable convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would avoid it altogether by not using a
MultiAsset
but instead just theid
portion of it.This would require exposing the
AssetId
, which is fine. But I would also propose that XCMv4 remove theAssetId::Abstract
variant and thus make theid
just a straightMultiLocation
. This would make the instruction contain the fields{ asset_id: InteriorMultiLocation, owner: MultiLocation }
, whereasset_id
is an interior location ofOrigin
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think there's not actually any need to require that
asset_id
be anInteriorMultiLocation
. Some chains might privilege certain origins to be able to create assets which are not interior to them. So this becomes:{ asset_id: MultiLocation, owner: MultiLocation }
.