StricaHQ / typhonjs

Pure javascript Cardano wallet library
Apache License 2.0
61 stars 12 forks source link

Issue when minting with time-locked policyId #20

Closed Aervue closed 1 year ago

Aervue commented 2 years ago

So I was successful in minting a NFT with this package with just "pubKeyHash" but when I also add "all" and "invalidBefore" to try and make a time-locked policyId and submit the transaction I get the following errors:

"transaction submit error ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash \\"bf31919f8550764b5299a1ddb4d53265c5124b45d8e751eef36ac891\\"])))])"

This is the nativeScript I use to get the policyId and submit the transaction:

    nativeScript: {
      "all":
        [
          { "pubKeyHash": "2f3f2d0a2c0c0d9f0a1abb46f08be8a8f05fb941222ef03705a49a83" },
          { "invalidBefore": 70998357 }
        ]
    }

If I use just the following to generate policy and set the required variables I can mint no problem but it's not time-locked.

    nativeScript: {
           "pubKeyHash": "2f3f2d0a2c0c0d9f0a1abb46f08be8a8f05fb941222ef03705a49a83" 
}

Google searches say that I should use --invalid-hereafter with the same slot or before the one used in the invalidBefore in the CLI so I added the same slot number to TTL. Am I doing something wrong?

ashisherc commented 1 year ago

if you have { "invalidBefore": 70998357 } you must also define validity interval start value, which must be larger than 70998357

basically look at it as the invalidBefore or after values are compared with the TTL and validityIntervalStart value itself so the tx can be verified statically.

ashisherc commented 1 year ago

closing due to inactivity