Skip to content

Fix script integrity hash mismatch (error 3113) for CIP-0069 no-redeemer minting#33

Closed
Copilot wants to merge 7 commits into
mainfrom
copilot/fix-transaction-balance-calculation
Closed

Fix script integrity hash mismatch (error 3113) for CIP-0069 no-redeemer minting#33
Copilot wants to merge 7 commits into
mainfrom
copilot/fix-transaction-balance-calculation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 1, 2026

Transactions using CIP-0069 Plutus reference scripts for minting (no explicit redeemer) were rejected on-chain with error 3113: providedScriptIntegrity didn't match computedScriptIntegrity.

Root causes

1. script_data_hash never computed for CIP-0069 txs
TxBuilderImpl only triggered script_data_hash computation when redeemers.length > 0. CIP-0069 minting uses no witness-set redeemer, so the hash was omitted or a placeholder was not included in fee estimation.

2. Wrong CBOR encoding for absent redeemers
hashScriptData serialized empty redeemers as 0x80 (CBOR empty array). Conway ledger requires 0xa0 (CBOR empty map) when redeemers are absent — producing cdde88... instead of the expected 870bd0....

3. Invalid patch file hunk headers
The patch appended in a prior iteration had malformed @@ line-count headers and missing diff --git / index lines, causing pnpm install to fail with hunk header integrity check failed.

Changes (patches/@evolution-sdk__evolution@0.3.19.patch)

  • dist/utils/Hash.js + src/utils/Hash.ts — add branch in hashScriptData for the CIP-0069 case (no redeemers, no datums):

    } else if (redeemers.length === 0 && !hasDatums) {
      // Conway era: A0 (empty map) represents absent redeemers
      payload = concatBytes(new Uint8Array([0xa0]), langViewsBytes);
    } else {
  • dist/sdk/builders/TxBuilderImpl.js + src/sdk/builders/TxBuilderImpl.ts — compute script_data_hash (and include placeholder during fee estimation) whenever Plutus reference inputs are present, even with zero explicit redeemers.

  • dist/sdk/provider/internal/BlockfrostEffect.js + src/sdk/provider/internal/BlockfrostEffect.ts — forward script field on UTxOs passed to evaluateTx, required for reference script resolution.

  • Patch file regenerated from scratch using git diff --no-index against original store files, producing correct @@ hunk headers and index lines. pnpm-lock.yaml updated with new patch hash.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…r (3113)

Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Comment thread src/mint.ts
Comment thread src/nft.ts
Comment thread src/nft.ts
Copilot AI changed the title [WIP] Fix transaction balance calculation error due to unknown inputs Fix script integrity hash missing from mint transactions (error 3113) Mar 1, 2026
…s reference scripts

Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Comment thread src/mint.ts
Copilot AI changed the title Fix script integrity hash missing from mint transactions (error 3113) Fix script integrity hash mismatch (error 3113) for CIP-0069 no-redeemer minting Mar 1, 2026
…nsactions

Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Copilot AI changed the title Fix script integrity hash mismatch (error 3113) for CIP-0069 no-redeemer minting Fix error 3113: correct script_data_hash encoding for CIP-0069 no-redeemer minting Mar 1, 2026
Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Copilot AI changed the title Fix error 3113: correct script_data_hash encoding for CIP-0069 no-redeemer minting Fix script integrity hash mismatch (error 3113) for CIP-0069 no-redeemer minting Mar 1, 2026
@SynthLuvr SynthLuvr closed this Mar 2, 2026
@SynthLuvr SynthLuvr deleted the copilot/fix-transaction-balance-calculation branch March 2, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants