@easy1staking/cip113-sdk-ts 0.3.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +20 -0
  2. package/blueprints/standard/v0.3.0/UPSTREAM_PIN.json +30 -0
  3. package/blueprints/standard/v0.5.0-alpha.2/UPSTREAM_PIN.json +33 -0
  4. package/blueprints/standard/v0.5.0-alpha.2/plutus.json +1010 -0
  5. package/blueprints/substandards/dummy/v0.1.0/UPSTREAM_PIN.json +29 -0
  6. package/blueprints/substandards/dummy/v0.2.0/UPSTREAM_PIN.json +36 -0
  7. package/blueprints/substandards/dummy/v0.2.0/plutus.json +84 -0
  8. package/blueprints/substandards/freeze-and-seize/v0.1.0/UPSTREAM_PIN.json +35 -0
  9. package/dist/core/cip171.d.ts +149 -0
  10. package/dist/core/cip171.d.ts.map +1 -0
  11. package/dist/core/cip171.js +284 -0
  12. package/dist/core/cip171.js.map +1 -0
  13. package/dist/core/evo-utils.d.ts +125 -17
  14. package/dist/core/evo-utils.d.ts.map +1 -1
  15. package/dist/core/evo-utils.js +149 -21
  16. package/dist/core/evo-utils.js.map +1 -1
  17. package/dist/core/ledger-order.d.ts +109 -0
  18. package/dist/core/ledger-order.d.ts.map +1 -0
  19. package/dist/core/ledger-order.js +185 -0
  20. package/dist/core/ledger-order.js.map +1 -0
  21. package/dist/core/registry.d.ts +16 -3
  22. package/dist/core/registry.d.ts.map +1 -1
  23. package/dist/core/registry.js +18 -9
  24. package/dist/core/registry.js.map +1 -1
  25. package/dist/index.d.ts +26 -2
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +54 -16
  28. package/dist/index.js.map +1 -1
  29. package/dist/standard/blueprint.d.ts +48 -1
  30. package/dist/standard/blueprint.d.ts.map +1 -1
  31. package/dist/standard/blueprint.js +71 -5
  32. package/dist/standard/blueprint.js.map +1 -1
  33. package/dist/standard/scripts.d.ts +76 -27
  34. package/dist/standard/scripts.d.ts.map +1 -1
  35. package/dist/standard/scripts.js +177 -49
  36. package/dist/standard/scripts.js.map +1 -1
  37. package/dist/substandards/dummy/index.d.ts.map +1 -1
  38. package/dist/substandards/dummy/index.js +443 -26
  39. package/dist/substandards/dummy/index.js.map +1 -1
  40. package/dist/substandards/freeze-and-seize/index.d.ts.map +1 -1
  41. package/dist/substandards/freeze-and-seize/index.js +283 -41
  42. package/dist/substandards/freeze-and-seize/index.js.map +1 -1
  43. package/dist/substandards/interface.d.ts +93 -1
  44. package/dist/substandards/interface.d.ts.map +1 -1
  45. package/dist/types.d.ts +87 -4
  46. package/dist/types.d.ts.map +1 -1
  47. package/package.json +4 -1
@@ -3,16 +3,61 @@
3
3
  */
4
4
  /**
5
5
  * Standard validator titles as they appear in the blueprint.
6
+ *
7
+ * Targets CIP-113 0.5.0-alpha.2 (upstream commit 9db7e06). See PLAN.md D-11.
8
+ *
9
+ * --- The dissolution of programmable_logic_global ------------------------
10
+ *
11
+ * Upstream #110 dissolved the PLG coordinator. Its transfer arm was RENAMED
12
+ * `transfer`; third-party (seize/clawback) logic moved to a new standalone
13
+ * `third_party`; `unfracking` is no longer reached through it. Instead
14
+ * `programmable_logic_base` dispatches straight to one of the three.
15
+ *
16
+ * The practical consequence for this table: the title
17
+ * `programmable_logic_global.programmable_logic_global.withdraw` NO LONGER
18
+ * EXISTS in any 0.5.x blueprint. Its removal is why validateStandardBlueprint()
19
+ * fails closed on the new artifact rather than silently building transactions
20
+ * against a validator that is not there — the loud failure is deliberate and
21
+ * must not be "fixed" by relaxing the check.
22
+ *
23
+ * --- Do not read upstream's CONTRACT_SURFACE_CHANGES.md for these ---------
24
+ *
25
+ * That document contains an SDK impact map naming this repository by path, and
26
+ * it is WRONG about the params datum in a way that produces malformed
27
+ * transactions (it says 6 fields; the artifact has 7, and one line is phrased
28
+ * as an instruction to build the 6-field shape). Every title, arity and field
29
+ * order here comes from the blueprint itself. See PLAN.md, W-D hazard box.
6
30
  */
7
31
  export const STANDARD_VALIDATORS = {
8
32
  ALWAYS_FAIL: "always_fail.always_fail.spend",
9
33
  PROTOCOL_PARAMS_MINT: "protocol_params_mint.protocol_params_mint.mint",
10
- PROGRAMMABLE_LOGIC_GLOBAL: "programmable_logic_global.programmable_logic_global.withdraw",
11
34
  PROGRAMMABLE_LOGIC_BASE: "programmable_logic_base.programmable_logic_base.spend",
12
35
  ISSUANCE_CBOR_HEX_MINT: "issuance_cbor_hex_mint.issuance_cbor_hex_mint.mint",
13
36
  ISSUANCE_MINT: "issuance_mint.issuance_mint.mint",
14
37
  REGISTRY_MINT: "registry_mint.registry_mint.mint",
15
38
  REGISTRY_SPEND: "registry_spend.registry_spend.spend",
39
+ /** PLG's transfer arm, renamed by #110. Withdraw-0. */
40
+ TRANSFER: "transfer.transfer.withdraw",
41
+ /** Seize / clawback, split out of PLG by #110. Withdraw-0. */
42
+ THIRD_PARTY: "third_party.third_party.withdraw",
43
+ /** Now dispatched to directly by PLB, with no PLG hop. Withdraw-0. */
44
+ UNFRACKING: "unfracking.unfracking.withdraw",
45
+ /** Holds the coordination UTxO — the live protocol wiring. Spend. */
46
+ COORDINATION_SPEND: "coordination_spend.coordination_spend.spend",
47
+ /** Reference upgrade authority; the initial `upgrade_cred` target. Withdraw-0. */
48
+ UPGRADE_MULTISIG: "upgrade_multisig.upgrade_multisig.withdraw",
49
+ };
50
+ /**
51
+ * Validator titles that existed in earlier CIP-113 releases and are GONE.
52
+ *
53
+ * Kept so that loading an old blueprint produces a diagnosis instead of a bare
54
+ * "missing required validator", which reads as a corrupt file rather than as
55
+ * "this SDK no longer targets that protocol version".
56
+ */
57
+ export const RETIRED_VALIDATORS = {
58
+ "programmable_logic_global.programmable_logic_global.withdraw": "dissolved by upstream #110 — its transfer arm is now `transfer.transfer.withdraw`, " +
59
+ "seize/clawback is `third_party.third_party.withdraw`, and unfracking is reached " +
60
+ "directly by programmable_logic_base",
16
61
  };
17
62
  /**
18
63
  * Get a validator's compiled code from a blueprint by title.
@@ -25,6 +70,14 @@ export function getValidatorCode(blueprint, title) {
25
70
  }
26
71
  return validator.compiledCode;
27
72
  }
73
+ /**
74
+ * Get a validator's un-parameterised script hash from a blueprint by title.
75
+ * This is the hash Aiken stamps in plutus.json — what CIP-171 verifiers
76
+ * reproduce by compiling the source repo at the named commit.
77
+ */
78
+ export function getValidatorHash(blueprint, title) {
79
+ return getValidator(blueprint, title).hash;
80
+ }
28
81
  /**
29
82
  * Get a validator entry from a blueprint by title.
30
83
  */
@@ -40,10 +93,23 @@ export function getValidator(blueprint, title) {
40
93
  */
41
94
  export function validateStandardBlueprint(blueprint) {
42
95
  const titles = blueprint.validators.map((v) => v.title);
43
- for (const [name, title] of Object.entries(STANDARD_VALIDATORS)) {
44
- if (!titles.includes(title)) {
45
- throw new Error(`Standard blueprint is missing required validator "${name}" (title: "${title}")`);
46
- }
96
+ const missing = Object.entries(STANDARD_VALIDATORS).filter(([, title]) => !titles.includes(title));
97
+ if (missing.length === 0)
98
+ return;
99
+ const label = `${blueprint.preamble.title} v${blueprint.preamble.version}`;
100
+ // If the blueprint carries a validator this SDK has retired, it is an OLD
101
+ // protocol version, not a damaged file. Say so — otherwise the reader spends
102
+ // the next hour looking for a corrupt artifact.
103
+ const retired = titles.filter((t) => t in RETIRED_VALIDATORS);
104
+ if (retired.length > 0) {
105
+ throw new Error(`Blueprint "${label}" targets an earlier CIP-113 protocol version that this SDK no ` +
106
+ `longer supports. It still declares ${retired.map((t) => `"${t}"`).join(", ")} — ` +
107
+ retired.map((t) => RETIRED_VALIDATORS[t]).join("; ") +
108
+ `. This SDK targets 0.5.0-alpha.2 (upstream 9db7e06); use a blueprint from ` +
109
+ `blueprints/standard/v0.5.0-alpha.2/, or an SDK release pinned to the older contracts.`);
47
110
  }
111
+ throw new Error(`Standard blueprint "${label}" is missing required validator(s): ` +
112
+ missing.map(([name, title]) => `${name} (title: "${title}")`).join(", ") +
113
+ `. Present titles: ${titles.join(", ")}`);
48
114
  }
49
115
  //# sourceMappingURL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E,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CACvC,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAEjC,MAAM,KAAK,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAE3E,0EAA0E;IAC1E,6EAA6E;IAC7E,gDAAgD;IAChD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC;IAC9D,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,cAAc,KAAK,iEAAiE;YAClF,sCAAsC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;YAClF,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YACpD,4EAA4E;YAC5E,uFAAuF,CAC1F,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CACb,uBAAuB,KAAK,sCAAsC;QAChE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,aAAa,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACxE,qBAAqB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC3C,CAAC;AACJ,CAAC"}
@@ -1,47 +1,96 @@
1
- /**
2
- * Standard script parameterization.
3
- *
4
- * Replicates the parameterization chain from ProtocolScriptBuilderService.java.
5
- * Uses Evolution SDK directly for UPLC.applyParamsToScript and ScriptHash.
6
- *
7
- * Dependency graph:
8
- *
9
- * always_fail(nonce) → hash
10
- * protocol_params_mint(utxo_ref, always_fail_hash) → hash
11
- * programmable_logic_global(protocol_params_hash) → hash
12
- * programmable_logic_base(Script(plg_hash)) → hash
13
- * issuance_cbor_hex_mint(utxo_ref, always_fail_hash) → hash
14
- * registry_mint(utxo_ref, issuance_cbor_hex_hash) → hash
15
- * registry_spend(protocol_params_hash) → hash
16
- * issuance_mint(Script(plb_hash), registry_mint_hash, Script(minting_logic_hash)) → hash
17
- */
18
- import type { DeploymentParams, HexString, PlutusBlueprint, PlutusScript, ScriptHash, TxInput } from "../types.js";
1
+ import type { DeploymentParams, HexString, PlutusBlueprint, PlutusScript, PolicyId, ScriptHash, TxInput } from "../types.js";
19
2
  export interface StandardScripts {
20
3
  alwaysFail(nonce: HexString): PlutusScript;
21
- protocolParamsMint(utxoRef: TxInput, alwaysFailHash: ScriptHash): PlutusScript;
22
- programmableLogicGlobal(protocolParamsHash: ScriptHash): PlutusScript;
23
- programmableLogicBase(plgHash: ScriptHash): PlutusScript;
4
+ /** NEW in 0.5.x — the coordination UTxO's spender; nonce is arbitrary, per deployment. */
5
+ coordinationSpend(nonce: HexString): PlutusScript;
6
+ /** 2nd param is coordination_spend's hash in 0.5.x, always_fail's in 0.3.x. */
7
+ protocolParamsMint(utxoRef: TxInput, coordinationHash: ScriptHash): PlutusScript;
8
+ /** Takes the params-NFT POLICY now, not PLG's credential. */
9
+ programmableLogicBase(paramsPolicy: PolicyId): PlutusScript;
10
+ /** PLG's transfer arm, renamed by #110. */
11
+ transfer(paramsPolicy: PolicyId): PlutusScript;
12
+ /** Seize / clawback, split out of PLG by #110. */
13
+ thirdParty(paramsPolicy: PolicyId): PlutusScript;
14
+ unfracking(paramsPolicy: PolicyId): PlutusScript;
15
+ upgradeMultisig(signers: HexString[], threshold: number | bigint): PlutusScript;
24
16
  issuanceCborHexMint(utxoRef: TxInput, alwaysFailHash: ScriptHash): PlutusScript;
25
- registryMint(utxoRef: TxInput, issuanceCborHexHash: ScriptHash): PlutusScript;
26
- registrySpend(protocolParamsHash: ScriptHash): PlutusScript;
27
- issuanceMint(plbHash: ScriptHash, registryMintHash: ScriptHash, mintingLogicHash: ScriptHash): PlutusScript;
17
+ /** Arity 2 -> 3: gained registry_spend's credential. */
18
+ registryMint(utxoRef: TxInput, issuanceCborHexPolicy: PolicyId, registrySpendHash: ScriptHash): PlutusScript;
19
+ registrySpend(paramsPolicy: PolicyId): PlutusScript;
20
+ /** Arity 3 -> 4: gained params_policy. */
21
+ issuanceMint(plbHash: ScriptHash, registryNodePolicy: PolicyId, mintingLogicHash: ScriptHash, paramsPolicy: PolicyId): PlutusScript;
28
22
  }
29
23
  /**
30
24
  * Create standard script builders from a blueprint.
31
25
  * Uses Evolution SDK directly for parameterization and hashing.
32
26
  */
33
27
  export declare function createStandardScripts(blueprint: PlutusBlueprint): StandardScripts;
28
+ /** One derived-vs-deployed script hash comparison. */
29
+ export interface ScriptHashCheck {
30
+ /** Validator name, as it appears in the parameterization chain */
31
+ name: string;
32
+ /** Hash derived from the blueprint + deployment parameters */
33
+ derived: ScriptHash;
34
+ /** Hash recorded in DeploymentParams */
35
+ deployed: ScriptHash;
36
+ }
37
+ /** Thrown when a blueprint does not reproduce its deployment's script hashes. */
38
+ export declare class DeploymentMismatchError extends Error {
39
+ readonly mismatches: ScriptHashCheck[];
40
+ constructor(mismatches: ScriptHashCheck[], blueprintTitle: string);
41
+ }
42
+ /**
43
+ * Derive every parameterizable standard script hash from the blueprint and
44
+ * check it against DeploymentParams. Throws DeploymentMismatchError on any
45
+ * difference; returns the full check list on success.
46
+ *
47
+ * Why this exists: parameterization changes are not always visible to the
48
+ * compiler. Upstream has changed a parameter's *meaning* while keeping its
49
+ * arity and type (protocol_params_mint's `always_fail_hash` became
50
+ * `coordination_addr_hash` in 0.5.0-alpha.1), so a wrong value typechecks,
51
+ * builds, and only fails when the ledger rejects the transaction. This is the
52
+ * check that catches it, and it is why buildDeploymentScripts no longer
53
+ * overwrites derived hashes with deployment values.
54
+ *
55
+ * Not covered: always_fail (its nonce is not carried in DeploymentParams),
56
+ * issuance_mint (parameterized per minting logic), and upgrade_multisig (its
57
+ * signers/threshold are an authority choice, not a derived protocol value).
58
+ * coordination_spend IS covered — DeploymentParams carries its nonce precisely
59
+ * so the lock target can be re-derived rather than trusted.
60
+ *
61
+ * WHERE THIS CHECK HAS VALUE — and where it has none.
62
+ *
63
+ * It is only meaningful when the blueprint and the deployment come from
64
+ * INDEPENDENT sources, so that they can actually disagree: a deployment loaded
65
+ * from disk, a database, or the chain, checked against the blueprint currently
66
+ * bundled. That is the case it catches, and the failure it catches is real —
67
+ * this repo shipped a blueprint swapped in place under an unchanged directory
68
+ * name, with 4 of 8 validator hashes moved.
69
+ *
70
+ * It proves NOTHING at bootstrap time. A deployment script derives the hashes,
71
+ * populates DeploymentParams from those same values, and then asserts against
72
+ * them — a tautology that cannot fail. Do not read a passing assertion inside a
73
+ * bootstrap as evidence that the deployment is correct; assert on LOAD instead.
74
+ */
75
+ export declare function assertDeploymentScripts(blueprint: PlutusBlueprint, deployment: DeploymentParams): ScriptHashCheck[];
34
76
  /**
35
77
  * Build resolved standard scripts from deployment params.
36
78
  *
37
- * IMPORTANT: Uses the known hashes from DeploymentParams (the source of truth)
38
- * rather than re-deriving them from the blueprint.
79
+ * Every derivable script hash is ASSERTED equal to its DeploymentParams value
80
+ * (see assertDeploymentScripts). Earlier versions silently overwrote the
81
+ * derived hash with the deployment's, which made a wrong parameterization
82
+ * undetectable until submission.
39
83
  */
40
84
  export declare function buildDeploymentScripts(blueprint: PlutusBlueprint, deployment: DeploymentParams): ResolvedStandardScripts;
41
85
  export interface ResolvedStandardScripts {
86
+ coordinationSpend: PlutusScript;
42
87
  protocolParamsMint: PlutusScript;
43
- programmableLogicGlobal: PlutusScript;
44
88
  programmableLogicBase: PlutusScript;
89
+ /** PLG's transfer arm, renamed by #110. */
90
+ transfer: PlutusScript;
91
+ /** Seize / clawback. */
92
+ thirdParty: PlutusScript;
93
+ unfracking: PlutusScript;
45
94
  issuanceCborHexMint: PlutusScript;
46
95
  registryMint: PlutusScript;
47
96
  registrySpend: PlutusScript;
@@ -1 +1 @@
1
- {"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../src/standard/scripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,YAAY,EACZ,UAAU,EACV,OAAO,EACR,MAAM,aAAa,CAAC;AAYrB,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,KAAK,EAAE,SAAS,GAAG,YAAY,CAAC;IAC3C,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,GAAG,YAAY,CAAC;IAC/E,uBAAuB,CAAC,kBAAkB,EAAE,UAAU,GAAG,YAAY,CAAC;IACtE,qBAAqB,CAAC,OAAO,EAAE,UAAU,GAAG,YAAY,CAAC;IACzD,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,GAAG,YAAY,CAAC;IAChF,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,UAAU,GAAG,YAAY,CAAC;IAC9E,aAAa,CAAC,kBAAkB,EAAE,UAAU,GAAG,YAAY,CAAC;IAC5D,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,GAAG,YAAY,CAAC;CAC7G;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,eAAe,GACzB,eAAe,CA4DjB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,eAAe,EAC1B,UAAU,EAAE,gBAAgB,GAC3B,uBAAuB,CAmDzB;AAED,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,EAAE,YAAY,CAAC;IACjC,uBAAuB,EAAE,YAAY,CAAC;IACtC,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;IAC5B,oEAAoE;IACpE,iBAAiB,CAAC,gBAAgB,EAAE,UAAU,GAAG,YAAY,CAAC;CAC/D"}
@@ -1,19 +1,35 @@
1
1
  /**
2
- * Standard script parameterization.
2
+ * Standard script parameterization — CIP-113 0.5.0-alpha.2 (upstream 9db7e06).
3
3
  *
4
- * Replicates the parameterization chain from ProtocolScriptBuilderService.java.
5
4
  * Uses Evolution SDK directly for UPLC.applyParamsToScript and ScriptHash.
6
5
  *
7
- * Dependency graph:
6
+ * Dependency graph. Note it is NO LONGER a single chain: upstream #110 removed
7
+ * programmable_logic_global, and PLB is now parameterised by the params-NFT
8
+ * policy rather than by PLG's credential, so everything downstream hangs off
9
+ * `params_policy` in parallel instead of in series.
8
10
  *
9
- * always_fail(nonce) hash
10
- * protocol_params_mint(utxo_ref, always_fail_hash) hash
11
- * programmable_logic_global(protocol_params_hash) hash
12
- * programmable_logic_base(Script(plg_hash)) → hash
13
- * issuance_cbor_hex_mint(utxo_ref, always_fail_hash) hash
14
- * registry_mint(utxo_ref, issuance_cbor_hex_hash) → hash
15
- * registry_spend(protocol_params_hash) hash
16
- * issuance_mint(Script(plb_hash), registry_mint_hash, Script(minting_logic_hash)) hash
11
+ * always_fail(nonce) -> hash (issuance side only now)
12
+ * coordination_spend(nonce) -> hash NEW: the lock target
13
+ * protocol_params_mint(utxo_ref, coord_hash) -> policy == params_policy
14
+ * |
15
+ * +-- programmable_logic_base(params_policy) -> hash
16
+ * +-- transfer(params_policy) -> hash (PLG's transfer arm, renamed)
17
+ * +-- third_party(params_policy) -> hash NEW: seize / clawback
18
+ * +-- unfracking(params_policy) -> hash
19
+ * +-- registry_spend(params_policy) -> hash
20
+ *
21
+ * issuance_cbor_hex_mint(utxo_ref, always_fail_hash) -> policy
22
+ * registry_mint(utxo_ref, issuance_cbor_hex_cs, registry_spend_cred) -> policy
23
+ * issuance_mint(PLB_cred, registry_node_cs, minting_logic_cred, params_policy)
24
+ * upgrade_multisig(signers, threshold) -> hash (independent)
25
+ *
26
+ * ⚠ PARAMETER TYPES ARE NOT INTERCHANGEABLE and TypeScript cannot tell them
27
+ * apart — every one of these is a hex string at the call site. `params_policy`
28
+ * is a PolicyId (a bare ByteArray); `minting_logic_cred` and friends are
29
+ * Credentials (a constructor-wrapped Script/VerificationKey). Passing a policy
30
+ * where a credential belongs produces a valid script with the wrong hash. The
31
+ * types below come from the blueprint's own parameter schemas, not from
32
+ * upstream's prose docs — see the hazard note in blueprint.ts.
17
33
  */
18
34
  import { Data } from "@evolution-sdk/evolution";
19
35
  import { getValidatorCode, STANDARD_VALIDATORS } from "./blueprint.js";
@@ -29,24 +45,36 @@ export function createStandardScripts(blueprint) {
29
45
  }
30
46
  return {
31
47
  alwaysFail(nonce) {
32
- return parameterize(STANDARD_VALIDATORS.ALWAYS_FAIL, [
33
- Data.bytearray(nonce),
34
- ]);
48
+ return parameterize(STANDARD_VALIDATORS.ALWAYS_FAIL, [Data.bytearray(nonce)]);
49
+ },
50
+ coordinationSpend(nonce) {
51
+ return parameterize(STANDARD_VALIDATORS.COORDINATION_SPEND, [Data.bytearray(nonce)]);
35
52
  },
36
- protocolParamsMint(utxoRef, alwaysFailHash) {
53
+ protocolParamsMint(utxoRef, coordinationHash) {
37
54
  return parameterize(STANDARD_VALIDATORS.PROTOCOL_PARAMS_MINT, [
38
55
  outputReference(utxoRef),
39
- Data.bytearray(alwaysFailHash),
56
+ Data.bytearray(coordinationHash),
40
57
  ]);
41
58
  },
42
- programmableLogicGlobal(protocolParamsHash) {
43
- return parameterize(STANDARD_VALIDATORS.PROGRAMMABLE_LOGIC_GLOBAL, [
44
- Data.bytearray(protocolParamsHash),
59
+ programmableLogicBase(paramsPolicy) {
60
+ // PolicyId — a bare ByteArray. It was scriptCredential(plgHash) before #110.
61
+ return parameterize(STANDARD_VALIDATORS.PROGRAMMABLE_LOGIC_BASE, [
62
+ Data.bytearray(paramsPolicy),
45
63
  ]);
46
64
  },
47
- programmableLogicBase(plgHash) {
48
- return parameterize(STANDARD_VALIDATORS.PROGRAMMABLE_LOGIC_BASE, [
49
- scriptCredential(plgHash),
65
+ transfer(paramsPolicy) {
66
+ return parameterize(STANDARD_VALIDATORS.TRANSFER, [Data.bytearray(paramsPolicy)]);
67
+ },
68
+ thirdParty(paramsPolicy) {
69
+ return parameterize(STANDARD_VALIDATORS.THIRD_PARTY, [Data.bytearray(paramsPolicy)]);
70
+ },
71
+ unfracking(paramsPolicy) {
72
+ return parameterize(STANDARD_VALIDATORS.UNFRACKING, [Data.bytearray(paramsPolicy)]);
73
+ },
74
+ upgradeMultisig(signers, threshold) {
75
+ return parameterize(STANDARD_VALIDATORS.UPGRADE_MULTISIG, [
76
+ Data.list(signers.map((s) => Data.bytearray(s))),
77
+ Data.int(BigInt(threshold)),
50
78
  ]);
51
79
  },
52
80
  issuanceCborHexMint(utxoRef, alwaysFailHash) {
@@ -55,55 +83,155 @@ export function createStandardScripts(blueprint) {
55
83
  Data.bytearray(alwaysFailHash),
56
84
  ]);
57
85
  },
58
- registryMint(utxoRef, issuanceCborHexHash) {
86
+ registryMint(utxoRef, issuanceCborHexPolicy, registrySpendHash) {
59
87
  return parameterize(STANDARD_VALIDATORS.REGISTRY_MINT, [
60
88
  outputReference(utxoRef),
61
- Data.bytearray(issuanceCborHexHash),
89
+ Data.bytearray(issuanceCborHexPolicy),
90
+ scriptCredential(registrySpendHash),
62
91
  ]);
63
92
  },
64
- registrySpend(protocolParamsHash) {
93
+ registrySpend(paramsPolicy) {
65
94
  return parameterize(STANDARD_VALIDATORS.REGISTRY_SPEND, [
66
- Data.bytearray(protocolParamsHash),
95
+ Data.bytearray(paramsPolicy),
67
96
  ]);
68
97
  },
69
- issuanceMint(plbHash, registryMintHash, mintingLogicHash) {
98
+ issuanceMint(plbHash, registryNodePolicy, mintingLogicHash, paramsPolicy) {
70
99
  return parameterize(STANDARD_VALIDATORS.ISSUANCE_MINT, [
71
100
  scriptCredential(plbHash),
72
- Data.bytearray(registryMintHash),
101
+ Data.bytearray(registryNodePolicy),
73
102
  scriptCredential(mintingLogicHash),
103
+ Data.bytearray(paramsPolicy),
74
104
  ]);
75
105
  },
76
106
  };
77
107
  }
108
+ /** Thrown when a blueprint does not reproduce its deployment's script hashes. */
109
+ export class DeploymentMismatchError extends Error {
110
+ mismatches;
111
+ constructor(mismatches, blueprintTitle) {
112
+ super(`Blueprint "${blueprintTitle}" does not reproduce this deployment. ` +
113
+ `${mismatches.length} script hash(es) differ:\n` +
114
+ mismatches
115
+ .map((m) => ` ${m.name}: derived ${m.derived}, deployment says ${m.deployed}`)
116
+ .join("\n") +
117
+ `\nThe blueprint and the DeploymentParams describe different protocol instances. ` +
118
+ `Transactions built from this pairing would be rejected at submission.`);
119
+ this.name = "DeploymentMismatchError";
120
+ this.mismatches = mismatches;
121
+ }
122
+ }
123
+ /**
124
+ * Derive every parameterizable standard script hash from the blueprint and
125
+ * check it against DeploymentParams. Throws DeploymentMismatchError on any
126
+ * difference; returns the full check list on success.
127
+ *
128
+ * Why this exists: parameterization changes are not always visible to the
129
+ * compiler. Upstream has changed a parameter's *meaning* while keeping its
130
+ * arity and type (protocol_params_mint's `always_fail_hash` became
131
+ * `coordination_addr_hash` in 0.5.0-alpha.1), so a wrong value typechecks,
132
+ * builds, and only fails when the ledger rejects the transaction. This is the
133
+ * check that catches it, and it is why buildDeploymentScripts no longer
134
+ * overwrites derived hashes with deployment values.
135
+ *
136
+ * Not covered: always_fail (its nonce is not carried in DeploymentParams),
137
+ * issuance_mint (parameterized per minting logic), and upgrade_multisig (its
138
+ * signers/threshold are an authority choice, not a derived protocol value).
139
+ * coordination_spend IS covered — DeploymentParams carries its nonce precisely
140
+ * so the lock target can be re-derived rather than trusted.
141
+ *
142
+ * WHERE THIS CHECK HAS VALUE — and where it has none.
143
+ *
144
+ * It is only meaningful when the blueprint and the deployment come from
145
+ * INDEPENDENT sources, so that they can actually disagree: a deployment loaded
146
+ * from disk, a database, or the chain, checked against the blueprint currently
147
+ * bundled. That is the case it catches, and the failure it catches is real —
148
+ * this repo shipped a blueprint swapped in place under an unchanged directory
149
+ * name, with 4 of 8 validator hashes moved.
150
+ *
151
+ * It proves NOTHING at bootstrap time. A deployment script derives the hashes,
152
+ * populates DeploymentParams from those same values, and then asserts against
153
+ * them — a tautology that cannot fail. Do not read a passing assertion inside a
154
+ * bootstrap as evidence that the deployment is correct; assert on LOAD instead.
155
+ */
156
+ export function assertDeploymentScripts(blueprint, deployment) {
157
+ const builders = createStandardScripts(blueprint);
158
+ const checks = [
159
+ {
160
+ name: "coordination_spend",
161
+ derived: builders.coordinationSpend(deployment.coordinationNonce).hash,
162
+ deployed: deployment.coordination.scriptHash,
163
+ },
164
+ {
165
+ name: "protocol_params_mint",
166
+ derived: builders.protocolParamsMint(deployment.protocolParams.txInput, deployment.protocolParams.coordinationScriptHash).hash,
167
+ deployed: deployment.protocolParams.policyId,
168
+ },
169
+ {
170
+ name: "programmable_logic_base",
171
+ derived: builders.programmableLogicBase(deployment.protocolParams.policyId).hash,
172
+ deployed: deployment.programmableLogicBase.scriptHash,
173
+ },
174
+ {
175
+ name: "transfer",
176
+ derived: builders.transfer(deployment.protocolParams.policyId).hash,
177
+ deployed: deployment.transfer.scriptHash,
178
+ },
179
+ {
180
+ name: "third_party",
181
+ derived: builders.thirdParty(deployment.protocolParams.policyId).hash,
182
+ deployed: deployment.thirdParty.scriptHash,
183
+ },
184
+ {
185
+ name: "unfracking",
186
+ derived: builders.unfracking(deployment.protocolParams.policyId).hash,
187
+ deployed: deployment.unfracking.scriptHash,
188
+ },
189
+ {
190
+ name: "issuance_cbor_hex_mint",
191
+ derived: builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash).hash,
192
+ deployed: deployment.issuance.policyId,
193
+ },
194
+ {
195
+ name: "registry_spend",
196
+ derived: builders.registrySpend(deployment.protocolParams.policyId).hash,
197
+ deployed: deployment.directorySpend.scriptHash,
198
+ },
199
+ {
200
+ name: "registry_mint",
201
+ derived: builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId, deployment.directorySpend.scriptHash).hash,
202
+ deployed: deployment.directoryMint.scriptHash,
203
+ },
204
+ ];
205
+ const mismatches = checks.filter((c) => c.derived !== c.deployed);
206
+ if (mismatches.length > 0) {
207
+ throw new DeploymentMismatchError(mismatches, blueprint.preamble.title);
208
+ }
209
+ return checks;
210
+ }
78
211
  /**
79
212
  * Build resolved standard scripts from deployment params.
80
213
  *
81
- * IMPORTANT: Uses the known hashes from DeploymentParams (the source of truth)
82
- * rather than re-deriving them from the blueprint.
214
+ * Every derivable script hash is ASSERTED equal to its DeploymentParams value
215
+ * (see assertDeploymentScripts). Earlier versions silently overwrote the
216
+ * derived hash with the deployment's, which made a wrong parameterization
217
+ * undetectable until submission.
83
218
  */
84
219
  export function buildDeploymentScripts(blueprint, deployment) {
220
+ assertDeploymentScripts(blueprint, deployment);
85
221
  const builders = createStandardScripts(blueprint);
86
- const protocolParamsMint = builders.protocolParamsMint(deployment.protocolParams.txInput, deployment.protocolParams.alwaysFailScriptHash);
87
- protocolParamsMint.hash = deployment.protocolParams.policyId;
88
- const programmableLogicGlobal = builders.programmableLogicGlobal(deployment.protocolParams.policyId);
89
- programmableLogicGlobal.hash = deployment.programmableLogicGlobal.scriptHash;
90
- const programmableLogicBase = builders.programmableLogicBase(deployment.programmableLogicGlobal.scriptHash);
91
- programmableLogicBase.hash = deployment.programmableLogicBase.scriptHash;
92
- const issuanceCborHexMint = builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash);
93
- issuanceCborHexMint.hash = deployment.issuance.policyId;
94
- const registryMint = builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId);
95
- registryMint.hash = deployment.directoryMint.scriptHash;
96
- const registrySpend = builders.registrySpend(deployment.protocolParams.policyId);
97
- registrySpend.hash = deployment.directorySpend.scriptHash;
222
+ const paramsPolicy = deployment.protocolParams.policyId;
98
223
  return {
99
- protocolParamsMint,
100
- programmableLogicGlobal,
101
- programmableLogicBase,
102
- issuanceCborHexMint,
103
- registryMint,
104
- registrySpend,
224
+ coordinationSpend: builders.coordinationSpend(deployment.coordinationNonce),
225
+ protocolParamsMint: builders.protocolParamsMint(deployment.protocolParams.txInput, deployment.protocolParams.coordinationScriptHash),
226
+ programmableLogicBase: builders.programmableLogicBase(paramsPolicy),
227
+ transfer: builders.transfer(paramsPolicy),
228
+ thirdParty: builders.thirdParty(paramsPolicy),
229
+ unfracking: builders.unfracking(paramsPolicy),
230
+ issuanceCborHexMint: builders.issuanceCborHexMint(deployment.issuance.txInput, deployment.issuance.alwaysFailScriptHash),
231
+ registryMint: builders.registryMint(deployment.directoryMint.txInput, deployment.issuance.policyId, deployment.directorySpend.scriptHash),
232
+ registrySpend: builders.registrySpend(paramsPolicy),
105
233
  buildIssuanceMint(mintingLogicHash) {
106
- return builders.issuanceMint(deployment.programmableLogicBase.scriptHash, deployment.directoryMint.scriptHash, mintingLogicHash);
234
+ return builders.issuanceMint(deployment.programmableLogicBase.scriptHash, deployment.directoryMint.scriptHash, mintingLogicHash, paramsPolicy);
107
235
  },
108
236
  };
109
237
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scripts.js","sourceRoot":"","sources":["../../src/standard/scripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAShD,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAiB9B;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAA0B;IAE1B,SAAS,YAAY,CAAC,cAAsB,EAAE,MAAmB;QAC/D,MAAM,IAAI,GAAG,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACzD,OAAO,kBAAkB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1C,CA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BAAgB,EAChB,YAAY,CACb,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/substandards/dummy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EACV,iBAAiB,EAQlB,MAAM,iBAAiB,CAAC;AA6BzB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,SAAS,EAAE,eAAe,CAAC;CAC5B,GAAG,iBAAiB,CAqJpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/substandards/dummy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAYH,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,gBAAgB,CAAC;AACpE,OAAO,KAAK,EACV,iBAAiB,EASlB,MAAM,iBAAiB,CAAC;AA8CzB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,SAAS,EAAE,eAAe,CAAC;CAC5B,GAAG,iBAAiB,CAknBpB"}