IntersectMBO / plutus-apps

The Plutus application platform
Apache License 2.0
304 stars 212 forks source link

NFT Metadata in plutus. #93

Open locallycompact opened 2 years ago

locallycompact commented 2 years ago

Hi, in the NFT example tutorials that use the cardano-cli, you can attach metadata to an NFT.

{
  "721": {
    "{policy_id}": {
      "{policy_name}": {
        "name": "<required>",
        "description": "<optional>",
        "sha256": "<required>",
        "type": "<required>",
        "image": "<required>",
        "location": {
          "ipfs": "<required>",
          "https": "<optional>",
          "arweave": "<optional>"
        }
      }
    }
  }
}

but how do you do this in Haskell directly?

ak3n commented 2 years ago

Thanks for the issue!

Unfortunately this is impossible at the moment and I'm not aware of plans in the near future.

kk-hainq commented 2 years ago

We would love to work on this if accepted!

bhoudebert commented 2 years ago

To be honest for a lot of use case around NFT, not being able to attach metadata is a deal breaker and would mean people would have to build/use something out of PAB which is really not a good news (mostly because minting + pab + local wallet is really efficient currently).

Is there anything new about this? Even a non accurate time window would be interesting to know as I really want to avoid using something else than PAB for that part.

koslambrou commented 2 years ago

This is something that should be part of the transaction creation library plutus-ledger-constraints. However, we're planning a complete rewrite of this library. Thus, attaching metadata to transactions would be done in this rewrite.

zmrocze commented 2 years ago

@koslambrou Can you elaborate on the rewrite? It seems like adding the missing fields to Tx and forwarding the changes here would go a long way. I want to do that, is it reasonable to do already?

Edit: I saw that plutus-ledger-constraint reuses Tx from plutus-ledger-api. That's what I wanted to know.