@@ -153,11 +153,12 @@ policy_id = script_hash
153153; To compute a script hash, note that you must prepend
154154; a tag to the bytes of the script before hashing.
155155; The tag is determined by the language.
156- ; The tags in the Conway era are:
157- ; "\x00" for multisig scripts
156+ ; The tags are:
157+ ; "\x00" for multisig/native scripts
158158; "\x01" for Plutus V1 scripts
159159; "\x02" for Plutus V2 scripts
160160; "\x03" for Plutus V3 scripts
161+ ; "\x04" for Plutus V4 scripts
161162script_hash = hash28
162163
163164hash28 = bytes .size 28
@@ -436,35 +437,37 @@ network_id = 0/ 1
436437
437438;
438439; NEW:
439- ; 3: [* plutus_script ]
440+ ; 3: [* plutus_v1_script ]
440441; 4: [* plutus_data ]
441442; 5: redeemers
442443transaction_witness_set =
443444 { ? 0 : [* vkeywitness]
444445 , ? 1 : [* native_script]
445446 , ? 2 : [* bootstrap_witness]
446- , ? 3 : [* plutus_script]
447+ , ? 3 : [* plutus_v1_script]
447448 , ? 4 : [* plutus_data]
448449 , ? 5 : redeemers
449450 }
450451
451452
452453vkeywitness = [vkey, signature]
453454
454- ; Timelock validity intervals are half-open intervals [a, b).
455+ ; Allegra introduces timelock support for native scripts.
456+ ; This is the 6-variant native script format used by
457+ ; Allegra, Mary, Alonzo, Babbage, and Conway.
455458;
456- ; invalid_before:
457- ; specifies the left (included) endpoint a.
459+ ; Timelock validity intervals are half-open intervals [a, b).
460+ ; script_invalid_before: specifies the left (included) endpoint a.
461+ ; script_invalid_hereafter: specifies the right (excluded) endpoint b.
458462;
459- ; invalid_hereafter:
460- ; specifies the right (excluded) endpoint b.
463+ ; Note: Allegra switched to int64 for script_n_of_k thresholds.
461464native_script =
462465 [ script_pubkey
463466 // script_all
464467 // script_any
465468 // script_n_of_k
466- // invalid_before
467- // invalid_hereafter
469+ // script_invalid_before
470+ // script_invalid_hereafter
468471 ]
469472
470473
@@ -474,11 +477,15 @@ script_all = (1, [* native_script])
474477
475478script_any = (2, [* native_script])
476479
477- script_n_of_k = (3, n : uint , [* native_script])
480+ script_n_of_k = (3, n : int64 , [* native_script])
478481
479- invalid_before = (4, slot)
482+ ; Timelock validity intervals are half-open intervals [a, b).
483+ ; This field specifies the left (included) endpoint a.
484+ script_invalid_before = (4, slot)
480485
481- invalid_hereafter = (5, slot)
486+ ; Timelock validity intervals are half-open intervals [a, b).
487+ ; This field specifies the right (excluded) endpoint b.
488+ script_invalid_hereafter = (5, slot)
482489
483490bootstrap_witness =
484491 [ public_key : vkey
@@ -488,7 +495,19 @@ bootstrap_witness =
488495 ]
489496
490497
491- plutus_script = bytes
498+ ; Alonzo introduces Plutus smart contracts.
499+ ; Plutus V1 scripts are opaque bytestrings.
500+ plutus_v1_script = distinct_bytes
501+
502+ ; A type for distinct values.
503+ ; The type parameter must support .size, for example: bytes or uint
504+ distinct_bytes =
505+ bytes .size 8
506+ / bytes .size 16
507+ / bytes .size 20
508+ / bytes .size 24
509+ / bytes .size 30
510+ / bytes .size 32
492511
493512; NEW
494513plutus_data =
@@ -565,7 +584,7 @@ auxiliary_data_array =
565584auxiliary_scripts = [* native_script]
566585
567586auxiliary_data_map =
568- #6.259({? 0 : metadata, ? 1 : [* native_script], ? 2 : [* plutus_script ]})
587+ #6.259({? 0 : metadata, ? 1 : [* native_script], ? 2 : [* plutus_v1_script ]})
569588
570589transaction =
571590 [transaction_body, transaction_witness_set, bool, auxiliary_data/ nil]
0 commit comments