@mcsherrylabs/evolver-client 0.13.0 → 0.14.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.
@@ -17,8 +17,23 @@ export declare function edSign(msg: Uint8Array, priv: Uint8Array): Uint8Array;
17
17
  * AddKey PoP before the outer tx is signed (never sign blind). */
18
18
  export declare function edVerify(msg: Uint8Array, sig: Uint8Array, pub32: Uint8Array): boolean;
19
19
  export declare function edPubToSpki(raw32: Uint8Array): Uint8Array;
20
- /** Raw 32-byte Ed25519 pubkey from either a raw key or an X.509 SPKI-wrapped one
21
- * (the on-chain `node_keys` form). The key is always the last 32 bytes. */
20
+ /**
21
+ * Raw 32-byte Ed25519 pubkey from either a raw key or an X.509 SPKI-wrapped one
22
+ * (the on-chain `node_keys` form).
23
+ *
24
+ * ⚠️ THIS REFUSES WHAT IT DOES NOT RECOGNISE, and that is the whole point. It used to read
25
+ * "the key is always the last 32 bytes" and take them from an input of ANY length — which is
26
+ * fine for the two shapes it was written for and silently wrong for every other. An identity
27
+ * holds more than one key: the default `("BLS12-381-G1","")` public key is 48 bytes, and its
28
+ * last 32 bytes are a perfectly well-formed Ed25519 point as far as anything downstream can
29
+ * tell. Rendered as an SSH key it produces a line with the correct algorithm and the correct
30
+ * constant prefix for a private key NOBODY HOLDS — authentication then fails with no
31
+ * diagnosis available anywhere, and any reconciliation loop comparing derived keys churns
32
+ * forever instead of converging.
33
+ *
34
+ * A parser that reshapes input it does not recognise is a parser that lies about its output.
35
+ * The caller passing the wrong key entry is the bug; this refusing is how they find out.
36
+ */
22
37
  export declare function edSpkiToRaw(spkiOrRaw: Uint8Array): Uint8Array;
23
38
  /** X25519 public key from an Ed25519 public key (raw 32 or SPKI). */
24
39
  export declare function edToX25519Pub(edPub: Uint8Array): Uint8Array;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/crypto/auth.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,O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AAU,CAIrE;AAID,wBAAgB,KAAK,IAAI,SAAS,CAGjC;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,UAAU,CAEpE;AAED;;mEAEmE;AACnE,wBAAgB,QAAQ,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAMrF;AAQD,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAGzD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,UAAU,CAY7D;AAcD,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU,CAE3D"}
@@ -48,10 +48,32 @@ export function edPubToSpki(raw32) {
48
48
  throw new Error("expected 32-byte ed25519 public key");
49
49
  return concatBytes(ED_SPKI_PREFIX, raw32);
50
50
  }
51
- /** Raw 32-byte Ed25519 pubkey from either a raw key or an X.509 SPKI-wrapped one
52
- * (the on-chain `node_keys` form). The key is always the last 32 bytes. */
51
+ /**
52
+ * Raw 32-byte Ed25519 pubkey from either a raw key or an X.509 SPKI-wrapped one
53
+ * (the on-chain `node_keys` form).
54
+ *
55
+ * ⚠️ THIS REFUSES WHAT IT DOES NOT RECOGNISE, and that is the whole point. It used to read
56
+ * "the key is always the last 32 bytes" and take them from an input of ANY length — which is
57
+ * fine for the two shapes it was written for and silently wrong for every other. An identity
58
+ * holds more than one key: the default `("BLS12-381-G1","")` public key is 48 bytes, and its
59
+ * last 32 bytes are a perfectly well-formed Ed25519 point as far as anything downstream can
60
+ * tell. Rendered as an SSH key it produces a line with the correct algorithm and the correct
61
+ * constant prefix for a private key NOBODY HOLDS — authentication then fails with no
62
+ * diagnosis available anywhere, and any reconciliation loop comparing derived keys churns
63
+ * forever instead of converging.
64
+ *
65
+ * A parser that reshapes input it does not recognise is a parser that lies about its output.
66
+ * The caller passing the wrong key entry is the bug; this refusing is how they find out.
67
+ */
53
68
  export function edSpkiToRaw(spkiOrRaw) {
54
- return spkiOrRaw.length === 32 ? spkiOrRaw : spkiOrRaw.subarray(spkiOrRaw.length - 32);
69
+ if (spkiOrRaw.length === 32)
70
+ return spkiOrRaw;
71
+ if (spkiOrRaw.length === ED_SPKI_PREFIX.length + 32 &&
72
+ ED_SPKI_PREFIX.every((b, i) => spkiOrRaw[i] === b)) {
73
+ return spkiOrRaw.subarray(ED_SPKI_PREFIX.length);
74
+ }
75
+ throw new Error(`not an ed25519 public key: expected 32 raw bytes or ${ED_SPKI_PREFIX.length + 32} ` +
76
+ `X.509 SPKI bytes with the ed25519 prefix, got ${spkiOrRaw.length}`);
55
77
  }
56
78
  // ── Ed25519 → X25519 (derive the key-agreement key from the identity key) ──────
57
79
  // Lets a member's existing on-chain Ed25519 identity key double as the ECDH key for
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/crypto/auth.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,wDAAwD;AACxD,EAAE;AACF,+EAA+E;AAC/E,0EAA0E;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,CAAC,MAAM,OAAO,GAAG,6CAA6C,CAAC;AAYrE,8EAA8E;AAE9E,MAAM,UAAU,MAAM;IACpB,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAChD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,OAAO,CAAC,GAAe,EAAE,IAAgB;IACvD,MAAM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AAK,CAAC,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAC,SAAqB;IAC/C,IAAI,SAAS,CAAC,MAAM,KAAK,EAAE;QAAE,OAAO,SAAS,CAAC;IAC9C,IACE,SAAS,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,GAAG,EAAE;QAC/C,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAClD,CAAC;QACD,OAAO,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IACD,MAAM,IAAI,KAAK,CACb,uDAAuD,cAAc,CAAC,MAAM,GAAG,EAAE,GAAG;QAClF,iDAAiD,SAAS,CAAC,MAAM,EAAE,CACtE,CAAC;AACJ,CAAC;AAED,kFAAkF;AAClF,oFAAoF;AACpF,8EAA8E;AAC9E,EAAE;AACF,qFAAqF;AACrF,qFAAqF;AACrF,yFAAyF;AACzF,wFAAwF;AACxF,oFAAoF;AACpF,kFAAkF;AAClF,6DAA6D;AAE7D,qEAAqE;AACrE,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC7C,OAAO,sBAAsB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;AACpD,CAAC"}
package/dist/types.d.ts CHANGED
@@ -51,6 +51,35 @@ export type FailureReason = (typeof FAILURE_REASONS)[number];
51
51
  * (see `SIDEQUEST-transaction-outcomes.md`), this becomes a union and `Fined.reason` narrows.
52
52
  */
53
53
  export declare const KNOWN_FINE_REASONS: readonly ["CHANNEL_UNAUTHORIZED", "CHANNEL_CHARGE_FAILED", "CHANNEL_TOLL_CEILING", "CHANNEL_TOLL_RECIPIENT_GONE", "CHANNEL_TOLL_UNAFFORDABLE", "CHANNEL_TOLL_OVERFLOW", "DEPENDENCY_MISSING", "OTHER"];
54
+ /**
55
+ * The ledger ids the node DISPATCHES to a core handler, which parses the body and applies what
56
+ * it finds. Everything else is a channel, whose body the core never interprets.
57
+ *
58
+ * ⚠️ THIS IS A SAFETY LIST, NOT A CATALOGUE. Anything that lets a caller name a ledger AND supply
59
+ * an opaque body has handed the caller the choice of interpreter: `ce.evolver.ledger.identity`
60
+ * with a crafted body is a transfer — or, worse, an `AddKey`, whose proof of possession is signed
61
+ * by the NEW key, so the attacker composes a complete body and the victim's signature is the only
62
+ * thing missing. The channel-id rule cannot tell the difference: a core id is alphanumeric
63
+ * segments separated by dots exactly like a channel.
64
+ *
65
+ * ⚠️ NOT THE SAME SET AS `LEDGER`, and do not merge them. `LEDGER` means "ledgers this SDK builds
66
+ * bodies for" — three of them — which is a different question with a different reason to change.
67
+ *
68
+ * ⚠️ IT CANNOT BE COMPLETE, AND THE INCOMPLETENESS IS NAMED RATHER THAN HIDDEN. The node decides
69
+ * "core" from its LIVE handler map, and its bootstrap merges application handlers and then
70
+ * asserts only that these six are a SUBSET of it — so a deployment may dispatch a seventh ledger
71
+ * under any name at all. Two things follow for a caller refusing on this list: also refuse the
72
+ * reserved `ce.evolver.` namespace, so a seventh CORE ledger fails closed with no edit here; and
73
+ * record that an application ledger under a foreign name is not covered by either.
74
+ *
75
+ * Pinned against the node's own declaration by `npm-libs/pi-evolver/test/coreledger-checks.ts`,
76
+ * which scrapes `BlockPayloadValidator.DefaultCoreLedgerIds` and fails when the two differ.
77
+ */
78
+ export declare const CORE_LEDGER_IDS: readonly ["ce.evolver.ledger.identity", "ce.evolver.ledger.quorum", "ce.evolver.ledger.owners", "ce.evolver.ledger.list", "ce.evolver.ledger.groups", "ce.evolver.ledger.tickets"];
79
+ /** The namespace the node reserves for its own ledger ids. Refusing the whole of it is what makes
80
+ * a seventh core ledger fail CLOSED — no estate channel lives here (`chat.demo`, `ui.apps`,
81
+ * `p2p.demo`, `ce.meerkat.*` are what real channels look like). */
82
+ export declare const RESERVED_LEDGER_PREFIX = "ce.evolver.";
54
83
  export interface Committed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,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,CAAC;CAClB;AAID,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAC5C"}
package/dist/types.js CHANGED
@@ -67,4 +67,40 @@ export const KNOWN_FINE_REASONS = [
67
67
  // The default. Every un-tagged `skipWithFine` call site arrives as this.
68
68
  "OTHER",
69
69
  ];
70
+ /**
71
+ * The ledger ids the node DISPATCHES to a core handler, which parses the body and applies what
72
+ * it finds. Everything else is a channel, whose body the core never interprets.
73
+ *
74
+ * ⚠️ THIS IS A SAFETY LIST, NOT A CATALOGUE. Anything that lets a caller name a ledger AND supply
75
+ * an opaque body has handed the caller the choice of interpreter: `ce.evolver.ledger.identity`
76
+ * with a crafted body is a transfer — or, worse, an `AddKey`, whose proof of possession is signed
77
+ * by the NEW key, so the attacker composes a complete body and the victim's signature is the only
78
+ * thing missing. The channel-id rule cannot tell the difference: a core id is alphanumeric
79
+ * segments separated by dots exactly like a channel.
80
+ *
81
+ * ⚠️ NOT THE SAME SET AS `LEDGER`, and do not merge them. `LEDGER` means "ledgers this SDK builds
82
+ * bodies for" — three of them — which is a different question with a different reason to change.
83
+ *
84
+ * ⚠️ IT CANNOT BE COMPLETE, AND THE INCOMPLETENESS IS NAMED RATHER THAN HIDDEN. The node decides
85
+ * "core" from its LIVE handler map, and its bootstrap merges application handlers and then
86
+ * asserts only that these six are a SUBSET of it — so a deployment may dispatch a seventh ledger
87
+ * under any name at all. Two things follow for a caller refusing on this list: also refuse the
88
+ * reserved `ce.evolver.` namespace, so a seventh CORE ledger fails closed with no edit here; and
89
+ * record that an application ledger under a foreign name is not covered by either.
90
+ *
91
+ * Pinned against the node's own declaration by `npm-libs/pi-evolver/test/coreledger-checks.ts`,
92
+ * which scrapes `BlockPayloadValidator.DefaultCoreLedgerIds` and fails when the two differ.
93
+ */
94
+ export const CORE_LEDGER_IDS = [
95
+ "ce.evolver.ledger.identity",
96
+ "ce.evolver.ledger.quorum",
97
+ "ce.evolver.ledger.owners",
98
+ "ce.evolver.ledger.list",
99
+ "ce.evolver.ledger.groups",
100
+ "ce.evolver.ledger.tickets",
101
+ ];
102
+ /** The namespace the node reserves for its own ledger ids. Refusing the whole of it is what makes
103
+ * a seventh core ledger fail CLOSED — no estate channel lives here (`chat.demo`, `ui.apps`,
104
+ * `p2p.demo`, `ce.meerkat.*` are what real channels look like). */
105
+ export const RESERVED_LEDGER_PREFIX = "ce.evolver.";
70
106
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2CAA2C;AA2B3C,gFAAgF;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,qBAAqB;IACrB,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,WAAW;IACX,mBAAmB;IACnB,sBAAsB;IACtB,uBAAuB;IACvB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,sBAAsB,EAAG,0EAA0E;IACnG,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,kFAAkF;IAClF,yEAAyE;IACzE,UAAU;CACF,CAAC;AAIX;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,8EAA8E;IAC9E,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,6BAA6B;IAC7B,2BAA2B;IAC3B,uBAAuB;IACvB,uFAAuF;IACvF,oBAAoB;IACpB,yEAAyE;IACzE,OAAO;CACC,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,2CAA2C;AA2B3C,gFAAgF;AAEhF;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,qBAAqB;IACrB,mBAAmB;IACnB,gBAAgB;IAChB,YAAY;IACZ,WAAW;IACX,mBAAmB;IACnB,sBAAsB;IACtB,uBAAuB;IACvB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,UAAU;IACV,sBAAsB;IACtB,aAAa;IACb,aAAa;IACb,aAAa;IACb,cAAc;IACd,sBAAsB,EAAG,0EAA0E;IACnG,iBAAiB;IACjB,gBAAgB;IAChB,gBAAgB;IAChB,kFAAkF;IAClF,yEAAyE;IACzE,UAAU;CACF,CAAC;AAIX;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,8EAA8E;IAC9E,sBAAsB;IACtB,uBAAuB;IACvB,sBAAsB;IACtB,6BAA6B;IAC7B,2BAA2B;IAC3B,uBAAuB;IACvB,uFAAuF;IACvF,oBAAoB;IACpB,yEAAyE;IACzE,OAAO;CACC,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,4BAA4B;IAC5B,0BAA0B;IAC1B,0BAA0B;IAC1B,wBAAwB;IACxB,0BAA0B;IAC1B,2BAA2B;CACnB,CAAC;AAEX;;oEAEoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcsherrylabs/evolver-client",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Client SDK for an Evolver node: proto3 wire codec, transaction signing (AuthBodySignable), on-chain + group crypto, and the node HTTP API.",
5
5
  "type": "module",
6
6
  "exports": {