Cardano Ledger Merges CIP-172 Script Support for Dijkstra
The ledger change would let developers publish a reference script and use it in the same transaction. Mainnet use requires a hard fork that enables the new rules.
By SongMarketCap
Updated:
Cardano ledger maintainers merged the CIP-172 implementation into the repository’s main branch on November 12 UTC. Pull request #6252 adds support in the Dijkstra ledger for validating a transaction with a reference script from an output it creates. The same change lets nested transactions share scripts from newly created outputs across a batch.
A Transaction Can Use the Script It Publishes
A Cardano transaction can store a reference script in an output for future use. Under current ledger rules, if the transaction that publishes the script also needs it for validation, it must include another copy among its witnesses, the data supplied to validate the transaction. CIP-172 lets the ledger use the copy already present in the new output. That saves the bytes taken up by the duplicate and reduces the portion of the fee tied to transaction size.
CIP-172 author Carlos Tomé Cortiñas gives the example of a decentralized application that uses a token to track its state. In the two-transaction workflow described in the proposal, one transaction publishes the reference script and a second uses it to mint the state token. Under the new rules, a developer could publish the script and mint the token in one transaction.
Nested Transactions Can Share Scripts Across a Batch
CIP-118 describes how multiple subtransactions can be submitted together. Without the CIP-172 change, a subtransaction drawing a script from another subtransaction’s output would have to come after the output that contains it. If two subtransactions each need a script from the other’s output, changing their order can resolve only one of those dependencies.
The Dijkstra implementation makes scripts in newly created outputs available to the top-level transaction and its subtransactions regardless of processing order. It also checks collateral return outputs, which specify where unused collateral would be returned if script validation fails.
[NEWSBREAK]
Mainnet Use Requires a Hard Fork
The change appears in the changelog for version 0.6.0.0 of the Dijkstra ledger package. Cardano’s CIP registry still lists CIP-172 as Proposed. Its activation plan calls for updating the formal ledger specification, implementing the rules in the Cardano node, and completing a hard fork that enables those rules on the network.