-
Notifications
You must be signed in to change notification settings - Fork 318
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
CIP-0068 | Make more economic and contract-friendly #377
Conversation
@szist the title change is because:
Please get anyone with whom you've discussed these ideas to contribute here while we wait for @alessandrokonrad to weigh in. 😎 |
Thanks. 😰 I haven't really discussed it with anyone really, wasn't sure what was the right platform or way. The CIP discord categorically said, things should be discussed on github. |
@szist in case it emerges in this discussion that what you are suggesting is beyond the scope of CIP-0068, and especially if all you end up with is a goal or problem definition without a specific solution, we have a new category called Cardano Problem Statement (CPS) on the way as described in this late stage draft (via #366): https://github.com/cardano-foundation/CIPs/blob/cip-cps-rework/CIP-9999/README.md |
Hey @szist CIP-0068 doesn't have versioning per se. What you try to change here is the sub standard
Using the cbor constructor as a versioning mechanism is an interesting idea, but I feel like you lose a bit of flexibility. It's also harder to make use of that in contract languages where you don't have explicit access to the constructor index and type casting happens automatically in the back (e.g. Aiken, Helios)
This again also has trade-offs and I think you stated it correctly in your PR. We could include that paragraph into CIP-0068, but the idea and usage around inline datums is described in CIP-0032 already.
What do you mean with is not enforced? |
Not necessarily just for NFTs. If you consider DEXes with liquidity pools - on Minswap, Sundaeswap and WingRiders - currently all are using LP tokens. Identifying these lp tokens in the wallet is a very bad UX, unless they were minted with the cip-25 (infeasible in the case of Min/Sundae as they are dynamically minted, I think) tags or provided with offchain-metadata (pain).
Worth considering :). What is the use-case you were considering to use these reference UTxOs for in relation to NFTs? royalties?
I view that more of a shortcoming of those platforms. Versioning should be an integral part of datum design (Imagine using the same datum format across multiple contracts like oracles. If you change something, it's the most straightforward way to do it.). But it's an off-topic discussion
Sure, but in my experience if it's not part of the tooling or considered during design, people will just use whatever. Even that's not a guarantee (just look how cip25 is not followed by most tokens, required fields missing, etc.). I would much prefer having some recommendations at least, so people actually consider it and not just use whatever random option the given tool gives them.
As in plutus data format. With Exact positioning without the need to parse through generic data format just to find some property in smart contracts. E.g. imagine metadata this way (I've chosen arbitrary columns to be selected :/ don't put any weight on them at this point): data FTTokenMetadata = FTTokenMetadata {
name :: !BuiltinByteString
decimals :: !Integer
totalSupply :: !Integer
properties :: Map BuiltinData BuiltinData
} This way the data - that would be used with highest possibility by smart contracts (like oracles), would be available more easily through field accessors, instead of parsing through a generic metadata format and finding the "string" keys you are actually interested in. |
Have a way to dynamically update the metadata based on some other validators for instance, giving the NFT holder the rights to update certain fields etc. But also to keep the datum small so it can be referenced with not too much costs in other validators.
I don't think the cbor constructor has anything to do with versioning and should not be confused with the actual constructor of the contract language, that's why you have the extra field with the version.
Since there wasn't set any constraint in CIP-0068 (or the substandards specifically) people can choose between inline datum or hash only. Both are acceptable. But yeah for the sake of clarity we can add a recommendation. I personally have been using both already.
That's what I wanted to do initially. Ensuring exact positioning is hard especially if there are optional parameters. Also if you want to add extra entries you lose the key names. 3rd parties have to find them somewhere first, which makes the whole process a bit cumbersome. |
Given that the CIP is still in a |
@KtorZ some of these would also be reasons to rephrase this as a CPS, in case there's trouble reconciling this with CIP-0068 directly (reiterating my suggestion here, since I missed my chance to say this at today's CIP meeting) |
I think the primary concern/idea of this proposal is to allow for multiple reference NFTs in a single UTxO instead of only one NFT. Which makes sense, but also has trade-offs. You need to store more data in the datum and if you have just one reference NFT then it's one additional lookup and you need to store additionally the policyid and asset name in the datum, which increases cpu/mem. |
I will try to incorporate the changes till eow. Not all of them are breaking. Differentiating between bulk and single-utxo holders could make sense :). I will try to restructure this, so it's basically an extension and not a full new version, nor a full CPS. If any leftovers remain after that, we can do a CPS/new version. |
I very much disagree with this. Constructor could have a lot to do with versioning, it was also one of the original intends for it afaik when designing these data representation. Adding/removing fields together with bumping the constructor index could be a flexible pattern. It gives you separation of concerns. Consider an oracle use-case where you identify oracle utxos through tokens. In theory the provider could replace the validator scripts, but not change the data format. When they add a new field, they could just bump the constructor index while leaving in the same identifier token, same validator. Or you could add a version in the datum and have a generic structure, but that would make parsing and accessing oracle fields much more expensive. Sure, you could add additional logic that every new version would require new oracle identifier tokens. Anyhow, it's a similar case here. If the formats are well-defined (not a generic structure), then versioning through index could make sense. Anyhow that would be a much heavier change to the proposal, so I'm going to leave it out. |
From the original suggestions I left out versioning. Even though it's less efficient from the contracts standpoint, the additional flexility could be beneficial. I've also left out enforced positional types for the metadata - again it would help with contract efficiency at the cost of flexibility as pointed out by @alessandrokonrad . In case of an NFT series the publisher costs can be minimized by batching all reference tokens into a single utxo and providing the datum through a hash, when sending it to an unspendable script address. This will reduce the costs to ~1 ADA currently. |
I think this is a good compromise and that looks good to me👍🏻 |
@szist this has become grossly out-of-date with respect to CIP-0068. Is it safe to assume due to your #382 (comment) that this can also be closed? |
OK @szist please let us know if you will be continuing work on this... and if @alessandrokonrad or @KtorZ know of anyone who would be interested from the community or perhaps the CF then please I hope they might also be suggested here. |
These suggestions are coming from trying to implement the standard for an aggregator for token metadata.
Adds metadata batching options to the proposal and extends the documentation by explicitly mentioning datum inlining.
FYI @alessandrokonrad