minter-sdk
minter-sdk copied to clipboard
Dynamic Metadata
Allow a designated address to append new metadata to enable dynamic NFT metadata
Example:
- Display a new opt-in visual layer inside of a marketplace or wallet UI on top of the original image of the NFT
My design is to use one-step batch permits to implement cosigning:
- User submits
pair id user_param, authenticated to them and stored at the top level - Admin submits
pair id admin_param, authenticated to them - If the
id's match, the(id, user_param, admin_param)triple represents a parameter cosigned by both the user and the admin
See here for further notes on this design pattern.
LIGO module design
An extension of the Permit module
Storage
- Permit storage
current_user_param : option (pair (nat %current_id) (bytes %current_user_param))- A method
log_param : (id : nat, user_param : bytes, admin_param : bytes)- Likely to be storing an
option (bytes, bytes)field in metadata ledger - Will need to map
natand the contents of theuser_param : bytesto whatever metadata key is used (potentially using TZIP-16 methods)
- Likely to be storing an
Functions
user_cosign : pair (nat %id) (bytes %user_param)nat : idmust be resolvable to the user'saddress- Only that address may call this entrypoint
- Sets
current_user_param := Some (id, user_param)
admin_cosign : pair (nat %id) (bytes %admin_param)- Only (metadata) admin's may call this entrypoint
- Fails if
current_user_param == None - Fails if
current_id /= id - Calls
log_param(id, current_user_param, admin_parm) - Sets
current_user_param := None
Entrypoints
- Permit management entrypoints
cosign : pair nat (or (bytes %user_cosign) (bytes %admin_cosign))- This entrypoint combining
user_cosignandadmin_cosigndoesn't need to be implemented in the final contract, see MR-151 for more detail
- This entrypoint combining
- One-step cosigned batch permit:
- Implemented as a batch of
cosign's according to the one-step TZIP-16 specification
- Implemented as a batch of
cosign_batch : list (pair
(pair (nat %id) (or (bytes %user_param) (bytes %admin_param))
(option permit_parameter))