minter-sdk icon indicating copy to clipboard operation
minter-sdk copied to clipboard

Dynamic Metadata

Open jacobarluck opened this issue 4 years ago • 1 comments

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

jacobarluck avatar Mar 05 '21 19:03 jacobarluck

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 nat and the contents of the user_param : bytes to whatever metadata key is used (potentially using TZIP-16 methods)

Functions

  • user_cosign : pair (nat %id) (bytes %user_param)
    • nat : id must be resolvable to the user's address
    • 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_cosign and admin_cosign doesn't need to be implemented in the final contract, see MR-151 for more detail
  • One-step cosigned batch permit:
    • Implemented as a batch of cosign's according to the one-step TZIP-16 specification
cosign_batch : list (pair
  (pair (nat %id) (or (bytes %user_param) (bytes %admin_param))
  (option permit_parameter))

michaeljklein avatar Mar 26 '21 20:03 michaeljklein