Skip to content

feat(data): default Plutus data to PLUTUS_DATA_OPTIONS - #617

Merged
solidsnakedev merged 4 commits into
mainfrom
feat/data-default-plutus
Oct 9, 2026
Merged

solidsnakedev merged 4 commits into
mainfrom
feat/data-default-plutus

Conversation

@solidsnakedev

Copy link
Copy Markdown
Collaborator

The Plutus data default was CBOR.CML_DATA_DEFAULT_OPTIONS, which writes non-empty maps indefinite. The node writes them definite, so for any datum holding a map, Data.toDatumHash gave a hash a validator never computes on chain, and inline datums, witness datums and redeemer data carried maps in a layout the node does not produce.

Data.DEFAULT_CBOR_OPTIONS is now CBOR.PLUTUS_DATA_OPTIONS, and CBOR.TX_DEFAULT_OPTIONS.plutusData and CBOR.toTxCodecOptions follow it. Only data holding a non-empty map changes, and only in its map headers: Data.map([[1n, 2n]]) was bf0102ff and is now a10102, and the default datum hash of such data equals the node's. Explicit presets keep their bytes, decoding is unchanged, and decoded transactions keep the original bytes of their datums and redeemers. CBOR.CML_DATA_DEFAULT_OPTIONS is deprecated with a description of what it writes, and stays available to reproduce bytes and hashes made before this change.

Closes #395

@solidsnakedev
solidsnakedev merged commit 98e8b38 into main Oct 9, 2026
10 checks passed
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.

CBOR: align Data map encoding default and fix negative int bignum boundary

1 participant