rumourscape / Minting-API

API for minting Cardano Native Tokens
6 stars 0 forks source link

ScriptWitnessNotValidatingError: ["04c63d7d7507275ee5ca80868f1de94fc4a7200679ce919a0f84c1d2"]. #1

Closed pierre-andre-long closed 2 years ago

pierre-andre-long commented 2 years ago

Hi, i found your project while trying to build a dApp nami web minter, using multisig transaction for minting. I could run the Nestjs app fine. Then i came to the conclusion that to run the mint.js example, I should put it inside cheff twitternfts project. Though I am having trouble when trying that : I have, like you mentionned in another error report, the following error : ScriptWitnessNotValidatingError: ["04c63d7d7507275ee5ca80868f1de94fc4a7200679ce919a0f84c1d2"]. Did you manage to solve that error?

Also, i am really willing to help on this project, thank you for the hard work, how can i help in any way ?

pierre-andre-long commented 2 years ago

Also I don't get where when building the transaction (in mintTx function of mint.js file) you set that the asset will be minted to the nami address, because the payment address is also in the outputs...

pierre-andre-long commented 2 years ago

When trying to submit signed a transaction hex (that i generated with your mint.js example) throught window.cardano (nami injected api) instead of ogmios API : window.cardano.submitTx('84a500818258201ea08626e72a1bef741aa8082307a6fed6af8e9fd49990c1070bd987f1c030f5000182825839007241d649039a45c1d6f619110f18f019ff8639561e855192576ed76b56e49f790f792a8e0d22ce82a6f9f44d5b2317cfdcd2e66344fd55f2821a348574c3a2581c43fd23b6a4d1ec7025e9b885173b07b0d487a03a8648488dd6b54236a1413101581c764c84187741fb8df7743c4527e34b8959920e342295c6496289ba55a34131024b706f6c6963794c4f434b31014b706f6c6963794c4f434b320182583900a07a22dee3d6945ea28b7c615322343839f2eb71c03b56a248a84cfad89d8dbbaa1f1b7297e8cd7548829fc53934fa0a2992c548978a36c21a002dc6c0021a0003d090075820f77e2b52bc1f11bc56e7f95782b75b475b8c84733f9b434540dbd2e9f8bfedbf09a1581c43fd23b6a4d1ec7025e9b885173b07b0d487a03a8648488dd6b54236a1413101a20082825820fbbcddd965ca5308344b2d65fa7fdec2ec135f87d046010042e54840bbc3dc0a5840eaaef1d34d0d0ab5c48626719cc890ec0ebc6446c56d5a25f5d55ed2c975ce1c0858732f41cedcb1aca28c45372142939c420f776976e80d5c105184350a9d0082582004bab0eea180ae87df5f3e234312db7353b8c20f75890be1ff6a647e58fc342e5840d8b6368deeee3d54e5707f0f3f88e2fb083936e6eee678eaf5c3865b4b936efa3174c7fbf6a379dc5e25c5100c8bee04dffdc942b85fc4aff2d45b117580450501818201828200581c33bd504419f63bffef94218bce654057633a62c41595f0d7ad8fe29e82051a0a75c89ef582a11902d1a178383433666432336236613464316563373032356539623838353137336230376230643438376130336138363438343838646436623534323336a16131a165696d61676568697066733a2f2f31818201828200581c33bd504419f63bffef94218bce654057633a62c41595f0d7ad8fe29e82051a0a75c89e')

I got the following error : ""transaction submit error ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash \"43fd23b6a4d1ec7025e9b885173b07b0d487a03a8648488dd6b54236\"])))])"" Like if it missed a signature.

When decoding the signed transaction CBOR hex i got the following json for your information :

[
    {
        0: [[h'1EA08626E72A1BEF741AA8082307A6FED6AF8E9FD49990C1070BD987F1C030F5', 0]], 
        1: [[h'007241D649039A45C1D6F619110F18F019FF8639561E855192576ED76B56E49F790F792A8E0D22CE82A6F9F44D5B2317CFDCD2E66344FD55F2', [881161411, {h'43FD23B6A4D1EC7025E9B885173B07B0D487A03A8648488DD6B54236': {h'31': 1}, h'764C84187741FB8DF7743C4527E34B8959920E342295C6496289BA55': {h'31': 2, h'706F6C6963794C4F434B31': 1, h'706F6C6963794C4F434B32': 1}}]], [h'00A07A22DEE3D6945EA28B7C615322343839F2EB71C03B56A248A84CFAD89D8DBBAA1F1B7297E8CD7548829FC53934FA0A2992C548978A36C2', 3000000]],
        2: 250000, 
        7: h'F77E2B52BC1F11BC56E7F95782B75B475B8C84733F9B434540DBD2E9F8BFEDBF', 
        9: {h'43FD23B6A4D1EC7025E9B885173B07B0D487A03A8648488DD6B54236': {h'31': 1}}
    }, 
    {
    0: [[h'FBBCDDD965CA5308344B2D65FA7FDEC2EC135F87D046010042E54840BBC3DC0A', h'EAAEF1D34D0D0AB5C48626719CC890EC0EBC6446C56D5A25F5D55ED2C975CE1C0858732F41CEDCB1ACA28C45372142939C420F776976E80D5C105184350A9D00'], [h'04BAB0EEA180AE87DF5F3E234312DB7353B8C20F75890BE1FF6A647E58FC342E', h'D8B6368DEEEE3D54E5707F0F3F88E2FB083936E6EEE678EAF5C3865B4B936EFA3174C7FBF6A379DC5E25C5100C8BEE04DFFDC942B85FC4AFF2D45B1175804505']], 
    1: [[1, [[0, h'33BD504419F63BFFEF94218BCE654057633A62C41595F0D7AD8FE29E'], [5, 175491230]]]]

    }, 
    true, 
    [
        {
            721: {"43fd23b6a4d1ec7025e9b885173b07b0d487a03a8648488dd6b54236": {"1": {"image": "ipfs://1"}}}

        },
        [[1,[[0, h'33BD504419F63BFFEF94218BCE654057633A62C41595F0D7AD8FE29E'], [5, 175491230]]]]
    ]
]
pierre-andre-long commented 2 years ago

Ok so I found where it comes from thanks to that thread matching the error I sent in my previous message. You forgot to add the ttl in the const finalTxBody = Loader.Cardano.TransactionBody.new(... lign 317 of mint.js file, it should be the same as the timelock policy expiry (also be careful it is oudated since november in your cardano.ts file on the repo, it should be changed as an env variable imo).

But you won't be happy to learn that there is a new error when solving this one, and this time it looks even worse :

""transaction submit error ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (ScriptWitnessNotValidatingUTXOW (fromList [ScriptHash \"43fd23b6a4d1ec7025e9b885173b07b0d487a03a8648488dd6b54236\"]))),UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Testnet (KeyHashObj (KeyHash \"7241d649039a45c1d6f619110f18f019ff8639561e855192576ed76b\")) (StakeRefBase (KeyHashObj (KeyHash \"56e49f790f792a8e0d22ce82a6f9f44d5b2317cfdcd2e66344fd55f2\"))),Value 4542932 (fromList [(PolicyID {policyID = ScriptHash \"09fc160d4e4769694028e81262e4b303e3b0fce29166a0a5144783cb\"},fromList [(\"uiyjhvgtrecd\",1)]),(PolicyID {policyID = ScriptHash \"218c5e7d23b"
rumourscape commented 2 years ago

I have added ttl to the TransactionBody in the new commit like you suggested. Unfortunately, I still receive the same error:

ScriptWitnessNotValidatingError: ["5704d61a1ca119563a5da3c108108c40f5774706e1141d377bd20ccf"]

The error that you are receiving still includes the above error while it also seems to have an error with your transaction outputs. Try out the new commit and let me know if you find something new.

rumourscape commented 2 years ago

I found the bug and the Issue has been resolved!