I can send simple transactions to yoroi without any errors. However when I submit a transaction with NFT policy cardano-cli returns an error.
node version 1.30.1 (relay node)
system: ubuntu 20.4
tip:
{
"epoch": 296,
"hash": "32a29af3a31fa24e6d731e9adfeb35eb065eb8f688a611da9b479f2770870a01",
"slot": 42857090,
"block": 6380067,
"era": "Alonzo",
"syncProgress": "100.00"
}
nft meta :
{
"721": {
"policyid": {
"name": {
"name": "name",
"artist": "artist",
"description": "",
"image": "ipfs://"
}
}
}
}
create policy
cardano-cli address key-gen \
--verification-key-file policy/policy.vkey \
--signing-key-file policy/policy.skey
keyhash:
cardano-cli address key-hash --payment-verification-key-file policy/policy.vkey
policy script:
{
"type": "all",
"scripts": [
{
"type": "before",
"slot": 42862090
},
{
"keyHash": "keyhash",
"type": "sig"
}
]
}
address:
hash 0 5000000 lovelace + TxOutDatumHashNone
calculate fee:
cardano-cli transaction calculate-min-fee --tx-body-file keys/nfttx.raw --tx-in-count 1 --tx-out-count 2 --witness-count 2 --mainnet --protocol-params-file keys/protocol.json --byron-witness-count 0
transaction:
cardano-cli transaction build-raw --fee 198721 --tx-in hash#0 --tx-out $(cat keys/payment.addr)+2000000 --tx-out $(cat keys/payment.addr)+2801279+"1 $(cat policy/nft/policy.id).head00" --mint="1 $(cat policy/nft/policy.id).head00" --minting-script-file policy/nft/nft_policy.script --metadata-json-file policy/nft/nft_meta.json --invalid-hereafter=42862090 --out-file keys/nfttx.raw --invalid-before 42857090
sign transaction
cardano-cli transaction sign --tx-body-file keys/nfttx.raw --signing-key-file keys/payment.skey --mainnet --out-file keys/tx.signed
error:
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash "keyhash"])))])
EDIT: I get the same error even when submitting a transaction without the invalidation of the policy script part.