Bruno Škvorc
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # RMRK 2.0: Rich NFTs _A proposal for Composable, Nested NFTs with conditional rendering logic and multiple resources at once._ NFTs should be dynamic and be able to evolve *with* and *on* the protocol they launched on. We propose an updated standard with a highly versatile base that's extendable by child NFTs inside the parent NFT, as well as some flags, switches, and on- and off-chain params and values. The full spec is defined at the end of this propsal. ## Features NFTs should be able to: 1. own other NFTs (nested NFTs). 2. define a visual base from which to inherit and on which to visually build, which can be local to an NFT (useful when single-instance), or external (useful for collections). 3. define slots on the base that define how NFTs equipped into those slots are treated with regards to, for example, transferability and visual interactions on the page. 4. define conditional logic that changes the visuals of these NFTs depending on certain triggers. 5. define multiple groups of 2-4, so that an NFT can have multiple resources at the same time. We will now explain each point. ### Nested NFTs By allowing the "owner" field of an NFT to be the ID of another NFT, we allow NFTs to own NFTs. Other NFTs can then own those NFTs, and so on. Use cases: - an inventory management system in a video game - a user-made collection / bundle of NFTs for them to showcase or sell - an NFT that changes appearance based on other owned NFTs The owner of the root NFT can interact with a child any level deep. That is to say, an owner can put a Health potion that is in a their character's backpack up for sale directly, without having to interact with it through the characted NFT itself, or even the backpack. ### Visual Base and Base Slots An NFT can be a composition of elements - a composition of Z-index stacked SVGs, for example. A visual base defines where the elements of an NFT's visual representation are, and where slots go, so that the NFT can be enriched. Concretely: ![](https://i.imgur.com/0VpXtoF.png) This bird is holding a trumpet and a martini glass (placeholder items from the WIP stage of the [Kanaria](https://kanaria.rmrk.app) project). In order to render a trumpet, three elements work together: the wing, the "hand" of the wing, and the trumpet between these renders. This is how this base defines this part: ```json= { "base":{ "type": "svg", "id": "base-bird-rare-some-id", "parts": { "wing_1_back": { "type": "fixed", "z": 0, "src": "ipfs://ipfs/hash" }, "wing_1_front": { "type": "fixed", "z": 2, "src": "ipfs://ipfs/hash2" }, "wing_1_slot": { "type": "slot", "collections": ["MY_COLLECTION_OF_PROPS"], "unequip": "burn", "z": 1 } } // ... } } ``` In the example above, the base is defined as an SVG composition. For SVG compositions, it is assumed all parts are drawn in the same viewport of the parent, which means a simple overlay without coordinate information is enough to achieve adequate composition. It's worth noting that this does mean that a trumpet in the other wing is a **separate asset**. - TODO: multi resource help? If there's one resource for being equipped in one arm and another in another and we apply conditional rendering to decide which is shown, this is easy to fix. The bird's wing 1 is composed of three parts: two fixed parts of the wing that aren't NFTs, just *parts*, and a slot into which a child NFT can go. Slots ALWAYS host NFTs, and need to provide a whitelist of collections that can be equipeed into them. For "any", one should put `*` as the single element of the array. The slot also specifies that an item can only be equipped into the wing if the owner is willing to accept that it will be burned on unequip - i.e. it is only usable on this character, similar to a "Soul bound" item in MMORPGs. The "z" value defines the stack height of the SVG in the final render. This base can be included in the NFT being minted, but can also be external: ```json= { "collection": // ... "base": { /* ... */ } } ``` vs. ```json= { "collection": // ... "base": "base-bird-rare-some-id" } ``` The latter approach allows for heavy caching of the base in the various UI elements, needing to assemble the base only once. Once an NFT has been sent into another NFT, the owner NFT can EQUIP it into a slot. Only an equipped item will be shown on the render. TODO: define EQUIP. ### Conditional Logic TODO consider conditional in children and their effect on base slots (trumpet left vs right case) ### Multiple Resources TODO define priority for different and same type of resource ## Specification ### Base The `Base` is a new RMRK entity which is used as a "class" or "library" for a composable NFT. Every `resource` can have its own base. It is possible for an NFT to be composed of several non-interacting bases, through the use of different `resource` properties. The base can be included in the NFT using it, or it can be referenced, in cases such as when it's being reused by different NFTs. `Base` is a `json` object. Inside an NFT, it is keyed to the `base` propery in a single `resource`: ```json= { // ... NFT body "base": { /* inline base */ } } ``` or ```json= { // ... NFT body "base": "hash_of_base" } ``` The `Base` has the following properties: - `type` - type: string - possible values: "svg" - purpose: defining the type of the base, so the tools know how to compose the NFT when rendering it. Future values will include audio types, so you can compose music, video types so you can have interactive videos, and more. - `parts` - type: {key => PartDefinition} - possible values: - TBD ### Full Example #### Base ```json= { "type": "svg", "id": "some_id", "parts": [ { "bg": { "type": "fixed", "z": 0, "src": "ipfs://ipfs/hash" }, "gem_1": { "type": "slot", "collections": ["id-of-genesis-trait-crystals-LEGENDARY"], "unequip": "unequip", "z": 1 }, "gem_2": { // ... }, "gem_3": { // ... }, "gem_4": { // ... }, "gem_5": { // ... }, "wing_1_back": { "type": "fixed", "z": 1, "src": "ipfs://ipfs/hash" }, "wing_1_front": { "type": "fixed", "z": 3, "src": "ipfs://ipfs/hash2" }, "wing_1_slot": { "type": "slot", "collections": ["id-of-genesis-legendaries", "id-of-genesis-rares", "id-of-genesis-epics", ...], "unequip": "burn", "z": 2 } } ] } ``` #### NFT Removed name, symbol. SETFIELD(key, value) SETFIELD("rain", "true") ```json= { "collection": "0aff6865bed3a66b-KANS", "transferable": 1, "sn": "0000000000000001", "logic": [ { ">": ["emotes.🚀", 50], "priority": [2,3,1] // change prio based on condition == true }, { ">": ["emotes.❄", 100], "resources.0.bg": "newhash" // overrides the background image in the base, if such a slot exists }, { "==": ["this.rain", "true"], "resources.0.bg": "hash-of-rainy-background" } ], "priority": [1,0,2], "resources": [ { "base": "hash-of-base-svg.json" }, { "metadata": "hash-of-metadata-containing-guest-bird-art" }, { "metadata": "hash-of-metadata-guest-bird-art-with-jetpack" } ], "children": [ {"438637-0aff6865bed3a66b-KANS-oiyhi24yr28i7g4f": ""}, {"438637-0aff6865bed3a66b-KANS-oiyhi24yr28i7g4f": "wing_1_slot"}, {"438637-0aff6865bed3a66b-KANS-oiyhi24yr28i7g4f": ""}, {"438637-0aff6865bed3a66b-KANS-oiyhi24yr28i7g4f": "machine_gun_scope"}, ] } ``` Child 👇 ```json= { "collection": "id-of-genesis-legendaries", "transferable": 1, "sn": "090183892798279", "logic": "", "priority": [1,0,2], "resources": [ { { "base": "hash-of-base-svg.json" }, { "metadata": "hash-of-metadata-containing-guest-bird-art", "slot": "some_id.wing_1_slot" }, { "metadata": "hash-of-metadata-guest-bird-art-with-jetpack" } } ] } ``` #### Collection Removed extras like in NFT. Focusing on this info in metadata. ```json= { "max": 9, "issuer": "CpjsLDC1JFyrhm3ftC9Gs4QoyrkHKhZKtK7YqGTRFtTafgp", "id": "0aff6865bed3a66b-KANS", "metadata": "ipfs://ipfs/QmVgs8P4awhZpFXhkkgnCwBp4AdKRj3F9K58mCZ6fxvn3j" } ``` TODO: polls example TODO: custom fields in metadata, field overrides in NFT and in ops TODO: conditional rendering based on those fields TODO: JSONlogic examples of effects on renders (polls?) TODO: Bird names as a custom field ###### tags: `rmrk`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully