-
Notifications
You must be signed in to change notification settings - Fork 276
-
Notifications
You must be signed in to change notification settings - Fork 276
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
Coherence in Asset registration #2339
Comments
This seems to be the right approach. Registering an asset is not the same as minting an asset to a specific wallet. It should also be noted that we no longer require for something to be registered in order for it to be Minted, which IMO is a bit of a security risk. This increases the surface area for mint instructions in the permission validators, it makes the process unnecessarily more complex. |
After #2333 we will have to register assets before minting. I'm still not sure registering assets to specific accounts makes sense, but assuming we want it, I do think it should be semantically different from minting and create asset with default value. Depending on how flexible we want it to be, it can either be a predefined value for each Relatedly, I only now noticed #2333 as is makes it possible to mint non-mintable assets twice, because you can first set arbitrary value for it when registering, and then mint it. If we decide to stick to register having arbitrary value, we could just prohibit minting non-mintable assets althogether, which will result in desired behaviour; but I'm not sure what we could do otherwise. |
I have a few questions regarding this
AFAIK, the previous consensus was that we want to mint directly to wallets, provided types and permissions are correct. We want to Register definitions and not assets (because that's tedious, and most people will do it in one tx). So it makes no sense to add an initial quantity to a registered asset definition: if you don't have it, you have ZERO, and you don't have ZERO, you just remove the asset from the dashmap. Regarding the last point, you could argue either way. I think variadic expression based mints would be convenient. If done correctly they can take up less space, and in the average case a person who can mint an asset can mint precisely the right amounts to many wallets. |
For the record I have not yet made a decision. I think we need to brainstorm a few ideas and maybe poll a few times. |
Considering registration I would say you need to register asset definition, then you can mint without registering asset to account. That actually is how it is now. From my perspective the whole idea of registering asset to account is redundant and I don't see why we would want it. |
|
Maybe an asset registration always includes an implicit minting? So that you can register an asset with initial value and nonmintable, or zero initial value and it is mintable, or a combination. This is what you guys have already said so I guess I'm just joining in. What is the difference between registering an asset and registering an asset definition? Is it like registering fiat currency vs registering the US dollar? I think we should probably avoid too many layers of indirection. Register asset definition -> register asset -> mint/send asset to people, feels slightly too abstract. And I'm not sure what is gained by having asset definitions, other than "These two assets behave the same". And isn't there a problem of duplicate asset definitions? People registering the same thing many times. Then don't we have to compare asset definitions for equivilance anyway? Also how do domains relate to this question? |
We haven't had the suggestion to do both |
@mversic Indeed that is the case. I fought tooth and nail to keep the API the way it was and so Mintable::Once was necessary. I would encourage revisiting the assumptions and potentially changing the way we mint/register. |
Registering an asset definition is more like introducing a support for a US dollar savings accounts and registering an asset is opening a savings account for a particular person |
The equivalence relation is nominal, not structural. So yes, users can define structurally equal asset definitions, but under different names. I find this a desired behavior |
Since both are already feasible, I think the requirement is to combine existing instructions to provide encapsulation of commonly used patterns.
|
That's not allowed and would produce |
That was deliberate, actually, because I wanted to propose restricting registering an asset to a default value (either per value type or per asset definition). So I tried to leave Mints as pairs of Register+Mint here rather than replacing the Mint.
Originally posted by @QuentinI in #2333 (comment)
The text was updated successfully, but these errors were encountered: