Closed ben221199 closed 1 year ago
Hey @ben221199 Did you use the same key for signing the metadata that was used for the minting policy? The key used for signing the metadata must fit the one given in the policy field.
I made a policy script and generated sign and verification keys. Did I miss something? I did the following steps:
1) Make monetary policy script for token: policy.json
or policy.script
.
2) Make policy by hashing the script.
3) Name your token
4) Get the subject by concatting the hex form of the policy id with the hex form of the name.
5) Use the subject to make the metadata file: ./token-metadata-creator entry --init 1234567890abcdef
6) Add data to the metadata file: ./token-metadata-creator entry 1234567890abcdef -n Name -d "Description" -t TICKER -h "https://cardano.org" --decimals 6 -l logo.png -p policy.script
7) Generate a signing key and a verification key: cardano-cli address key-gen --verification-key-file policy.vkey --signing-key-file policy.skey
8) Sign the metadata: ./token-metadata-creator entry 1234567890abcdef -a policy.skey
9) Finish the metadata: ./token-metadata-creator entry 1234567890abcdef --finalize
10) Upload the JSON file.
TL;DR; I assume step 7 is the wrong part here. You are generating a new key pair which you then use for signing the metadata. This does not work for your native asset. You must use the key that you used for the minting operation.
In detail:
In your json file the policy entry references a public key which hashes to a value of 39A1DF51147B6DE6689A4727846962FB6540C3A3C7859A1A79B9420F
You can check this when you go to the website cbor.me and enter the value of your policy entry, which is atm 820182018282051a045983c88200581c39a1df51147b6de6689a4727846962fb6540c3a3c7859a1a79b9420f
Screenshot is here:
According to cexplorer the policy value is correct or better said, matches with the asset.
The hash function used to hash the public key value is blake2b-224
The signatures in your json file are created with a key which public key part is c23381ac64d56e195e142a499d11392625c85df65171bc775a7840720afe9daf
which hashes to 047830610b8363a7a5279063454b25746dc376f20f59897f3e574f7e
Which is where you see the mismatch between the key referenced in the policy and the key used for signing the metadata.
Also the subject is not correct. You are using 427566666572 after the policy id which does not match the asset name used during the minting operation. So you must replace this with 42554653
As mentioned in pull request #223, we have a problem in pull request #2698. When finalizing the metadata file, or when validating the file, it gives this error:
Failed to validate wallet metadata entry, error was: 'policy evaluation failed for: name.
. I don't know the reason of it, because everything seems fine. Also, I am not into Haskell, so I don't understand the validation code.