@motebit/crypto 0.8.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.
package/LICENSE ADDED
@@ -0,0 +1,26 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Motebit
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ "Motebit" is a trademark of Motebit, Inc. The MIT License grants rights to
24
+ this software, not to any Motebit trademarks, logos, or branding. You may not
25
+ use Motebit branding in a way that suggests endorsement or affiliation without
26
+ written permission.
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # @motebit/crypto
2
+
3
+ Protocol cryptography for Motebit — sign and verify all artifacts.
4
+
5
+ Receipts, credentials, delegations, successions, presentations. Zero runtime dependencies. MIT licensed.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @motebit/crypto
11
+ ```
12
+
13
+ ## Verify
14
+
15
+ ```typescript
16
+ import { verify } from "@motebit/crypto";
17
+
18
+ // Identity file
19
+ const r1 = await verify(fs.readFileSync("motebit.md", "utf-8"));
20
+ if (r1.type === "identity" && r1.valid) {
21
+ console.log(r1.did); // did:key:z...
22
+ }
23
+
24
+ // Execution receipt (object or JSON string)
25
+ const r2 = await verify(receipt);
26
+ if (r2.type === "receipt" && r2.valid) {
27
+ console.log(r2.signer); // did:key of the signing agent
28
+ }
29
+
30
+ // Verifiable credential
31
+ const r3 = await verify(credential);
32
+ if (r3.type === "credential" && r3.valid) {
33
+ console.log(r3.issuer); // did:key of the issuer
34
+ }
35
+ ```
36
+
37
+ ## Sign
38
+
39
+ ```typescript
40
+ import { signExecutionReceipt, generateKeypair } from "@motebit/crypto";
41
+
42
+ const { publicKey, privateKey } = await generateKeypair();
43
+
44
+ const signed = await signExecutionReceipt(receipt, privateKey, publicKey);
45
+ // signed.signature is base64url Ed25519 over canonical JSON
46
+ ```
47
+
48
+ ```typescript
49
+ import { signDelegation } from "@motebit/crypto";
50
+
51
+ const token = await signDelegation(
52
+ {
53
+ delegator_id,
54
+ delegator_public_key,
55
+ delegate_id,
56
+ delegate_public_key,
57
+ scope,
58
+ issued_at,
59
+ expires_at,
60
+ },
61
+ delegatorPrivateKey,
62
+ );
63
+ ```
64
+
65
+ ```typescript
66
+ import { issueReputationCredential } from "@motebit/crypto";
67
+
68
+ const vc = await issueReputationCredential(
69
+ {
70
+ success_rate: 0.95,
71
+ avg_latency_ms: 120,
72
+ task_count: 50,
73
+ trust_score: 0.8,
74
+ availability: 0.99,
75
+ measured_at: Date.now(),
76
+ },
77
+ privateKey,
78
+ publicKey,
79
+ subjectDid,
80
+ );
81
+ ```
82
+
83
+ ## API
84
+
85
+ ### Verification
86
+
87
+ - **`verify(artifact, options?)`** — Verify any artifact. Detects type automatically. Returns discriminated union.
88
+ - **`verifyIdentityFile(content)`** — _(deprecated)_ Legacy identity verification. Use `verify()` instead.
89
+ - **`parse(content)`** — Parse a `motebit.md` without verifying.
90
+
91
+ ### Signing
92
+
93
+ - **`signExecutionReceipt(receipt, privateKey, publicKey?)`** — Sign a receipt with Ed25519.
94
+ - **`signSovereignPaymentReceipt(input, privateKey, publicKey)`** — Sign a sovereign onchain payment receipt.
95
+ - **`signDelegation(delegation, delegatorPrivateKey)`** — Sign a delegation token.
96
+ - **`signKeySuccession(oldPrivateKey, newPrivateKey, newPublicKey, oldPublicKey)`** — Sign a key rotation.
97
+ - **`signCollaborativeReceipt(receipt, initiatorPrivateKey)`** — Sign a collaborative receipt.
98
+ - **`signVerifiableCredential(vc, privateKey, publicKey)`** — Sign a W3C VC (eddsa-jcs-2022).
99
+ - **`signVerifiablePresentation(vp, privateKey, publicKey)`** — Sign a W3C VP.
100
+
101
+ ### Credential Issuance
102
+
103
+ - **`issueGradientCredential(snapshot, privateKey, publicKey)`** — Issue an intelligence gradient VC.
104
+ - **`issueReputationCredential(snapshot, privateKey, publicKey, subjectDid)`** — Issue a reputation VC.
105
+ - **`issueTrustCredential(trustRecord, privateKey, publicKey, subjectDid)`** — Issue a trust VC.
106
+ - **`createPresentation(credentials, privateKey, publicKey)`** — Bundle VCs into a signed VP.
107
+
108
+ ### Chain Verification
109
+
110
+ - **`verifyReceiptChain(receipt, knownKeys)`** — Recursively verify a delegation receipt tree.
111
+ - **`verifyReceiptSequence(chain)`** — Verify a flat sequence of receipts.
112
+ - **`verifyDelegation(delegation, options?)`** — Verify a delegation token signature.
113
+ - **`verifyDelegationChain(chain)`** — Verify a chain of delegations with scope narrowing.
114
+ - **`verifyKeySuccession(record, guardianPublicKeyHex?)`** — Verify a key rotation record.
115
+ - **`verifySuccessionChain(chain, guardianPublicKeyHex?)`** — Verify a full key rotation chain.
116
+
117
+ ### Primitives
118
+
119
+ - **`generateKeypair()`** — Generate an Ed25519 keypair.
120
+ - **`ed25519Sign(message, privateKey)`** — Raw Ed25519 sign.
121
+ - **`ed25519Verify(signature, message, publicKey)`** — Raw Ed25519 verify.
122
+ - **`canonicalJson(obj)`** — Deterministic JSON serialization (JCS/RFC 8785).
123
+ - **`hash(data)`** — SHA-256 hex string.
124
+ - **`createSignedToken(payload, privateKey)`** — Create a signed auth token.
125
+ - **`verifySignedToken(token, publicKey)`** — Verify a signed auth token.
126
+ - **`publicKeyToDidKey(publicKey)`** / **`didKeyToPublicKey(did)`** — did:key conversion.
127
+
128
+ ## What can it do?
129
+
130
+ | Operation | Artifacts | Format |
131
+ | --------- | ------------------------------------------------------------------------------------------ | --------------------------- |
132
+ | Sign | Receipts, delegations, credentials, presentations, successions, payment receipts | Ed25519 over canonical JSON |
133
+ | Verify | Identity files, receipts, credentials, presentations, delegation chains, succession chains | Offline — no network calls |
134
+ | Issue | Gradient, reputation, and trust credentials | W3C VC 2.0, eddsa-jcs-2022 |
135
+
136
+ All operations are **offline** — no network calls, no relay lookup, no runtime dependency. Everything needed for signing and verification is in the artifact itself.
137
+
138
+ ## License
139
+
140
+ MIT — see [LICENSE](./LICENSE).
141
+
142
+ "Motebit" is a trademark. The MIT License grants rights to this software, not to any Motebit trademarks, logos, or branding. You may not use Motebit branding in a way that suggests endorsement or affiliation without written permission.
@@ -0,0 +1,268 @@
1
+ /**
2
+ * Protocol artifact signing — receipts, delegations, successions, collaborative receipts.
3
+ *
4
+ * These functions define the canonical signing format for all Motebit protocol
5
+ * artifacts. A third party needs these to produce valid signed artifacts that
6
+ * any verifier will accept.
7
+ *
8
+ * Moved from BSL @motebit/crypto to MIT @motebit/crypto.
9
+ */
10
+ /**
11
+ * Shape of an execution receipt for signing/verification.
12
+ * Structurally compatible with @motebit/protocol ExecutionReceipt.
13
+ */
14
+ export interface SignableReceipt {
15
+ task_id: string;
16
+ motebit_id: string;
17
+ /** Signer's Ed25519 public key (hex). Enables verification without relay lookup. */
18
+ public_key?: string;
19
+ device_id: string;
20
+ submitted_at: number;
21
+ completed_at: number;
22
+ status: "completed" | "failed" | "denied";
23
+ result: string;
24
+ tools_used: string[];
25
+ memories_formed: number;
26
+ prompt_hash: string;
27
+ result_hash: string;
28
+ delegation_receipts?: SignableReceipt[];
29
+ relay_task_id?: string;
30
+ delegated_scope?: string;
31
+ signature: string;
32
+ }
33
+ /**
34
+ * Sign an execution receipt. Produces a canonical JSON representation
35
+ * of all fields except `signature`, signs it with Ed25519, and sets
36
+ * the `signature` field to the base64url-encoded result.
37
+ */
38
+ export declare function signExecutionReceipt<T extends Omit<SignableReceipt, "signature">>(receipt: T, privateKey: Uint8Array, publicKey?: Uint8Array): Promise<T & {
39
+ signature: string;
40
+ }>;
41
+ /**
42
+ * Verify an execution receipt's Ed25519 signature.
43
+ * Reconstructs the canonical JSON from all fields except `signature`
44
+ * and verifies against the provided public key.
45
+ */
46
+ export declare function verifyExecutionReceipt(receipt: SignableReceipt, publicKey: Uint8Array): Promise<boolean>;
47
+ /**
48
+ * Inputs for a sovereign payment receipt — produced by the *payee* when
49
+ * a counterparty pays them directly via an onchain wallet rail (Solana,
50
+ * future Aptos/Sui), bypassing the relay's settlement gate.
51
+ *
52
+ * The receipt is structurally an `ExecutionReceipt` with:
53
+ * - `task_id` formatted as `{rail}:tx:{txHash}` so the trust signal
54
+ * anchors to a specific, globally unique onchain payment.
55
+ * - `relay_task_id` left undefined (the field is optional precisely
56
+ * for non-relay execution paths — see protocol/index.ts).
57
+ * - All cryptography identical to relay-mediated receipts: same
58
+ * canonical JSON, same Ed25519 sign/verify, same trust ingestion.
59
+ */
60
+ export interface SovereignPaymentReceiptInput {
61
+ /** The payee's motebit ID (the worker who is signing this receipt). */
62
+ payee_motebit_id: string;
63
+ /** The payee's device ID. */
64
+ payee_device_id: string;
65
+ /** The payer's motebit ID — recorded in `result` for downstream audit. */
66
+ payer_motebit_id: string;
67
+ /** Onchain payment proof: rail name (e.g., "solana") + transaction signature. */
68
+ rail: string;
69
+ tx_hash: string;
70
+ /** Payment amount in micro-units (6 decimals for USDC). */
71
+ amount_micro: bigint;
72
+ /** Asset symbol (e.g., "USDC"). */
73
+ asset: string;
74
+ /** Brief human-readable description of the service rendered. */
75
+ service_description: string;
76
+ /** SHA-256 hash of the request payload. */
77
+ prompt_hash: string;
78
+ /** SHA-256 hash of the result payload. */
79
+ result_hash: string;
80
+ /** Tools the payee used to deliver the service. Empty array if pure payment ack. */
81
+ tools_used?: string[];
82
+ /** When the payee accepted the request. */
83
+ submitted_at: number;
84
+ /** When the payee completed the work. */
85
+ completed_at: number;
86
+ }
87
+ /**
88
+ * Construct, canonicalize, and sign a sovereign payment receipt with
89
+ * the payee's Ed25519 identity key. Returns a fully-formed
90
+ * `ExecutionReceipt` that can be passed to any standard verifier and
91
+ * fed into `bumpTrustFromReceipt` on the payer's runtime.
92
+ *
93
+ * No relay is contacted at any point. The resulting receipt is
94
+ * self-verifiable forever from the embedded `public_key` field.
95
+ */
96
+ export declare function signSovereignPaymentReceipt(input: SovereignPaymentReceiptInput, privateKey: Uint8Array, publicKey: Uint8Array): Promise<SignableReceipt>;
97
+ export interface ReceiptVerification {
98
+ task_id: string;
99
+ motebit_id: string;
100
+ verified: boolean;
101
+ error?: string;
102
+ delegations: ReceiptVerification[];
103
+ }
104
+ /**
105
+ * Known public keys map: motebit_id → Uint8Array public key.
106
+ * Used to look up the correct key for each receipt in the chain.
107
+ */
108
+ export type KnownKeys = Map<string, Uint8Array>;
109
+ /**
110
+ * Recursively verify an execution receipt and all its delegation receipts.
111
+ * Each receipt is verified against the public key found in `knownKeys` for its `motebit_id`.
112
+ * Returns a tree of verification results mirroring the delegation structure.
113
+ */
114
+ export declare function verifyReceiptChain(receipt: SignableReceipt, knownKeys: KnownKeys): Promise<ReceiptVerification>;
115
+ export interface ReceiptChainEntry {
116
+ receipt: SignableReceipt;
117
+ signer_public_key: Uint8Array;
118
+ }
119
+ /**
120
+ * Verify a flat sequence of execution receipts.
121
+ *
122
+ * A valid sequence means:
123
+ * 1. Each receipt's signature is valid against its signer's public key.
124
+ * 2. Adjacent receipts are temporally ordered: receipt[i].completed_at <= receipt[i+1].submitted_at.
125
+ *
126
+ * An empty sequence is considered valid.
127
+ * Use `verifyReceiptChain` for nested/tree-structured delegation receipts.
128
+ */
129
+ export declare function verifyReceiptSequence(chain: ReceiptChainEntry[]): Promise<{
130
+ valid: boolean;
131
+ error?: string;
132
+ index?: number;
133
+ }>;
134
+ /**
135
+ * A signed delegation token authorizing one entity to act on behalf of another.
136
+ * The delegator signs (delegator_id, delegate_id, scope, issued_at, expires_at)
137
+ * with their private key, proving they authorized the delegate.
138
+ */
139
+ export interface DelegationToken {
140
+ delegator_id: string;
141
+ delegator_public_key: string;
142
+ delegate_id: string;
143
+ delegate_public_key: string;
144
+ scope: string;
145
+ issued_at: number;
146
+ expires_at: number;
147
+ signature: string;
148
+ }
149
+ /**
150
+ * Sign a delegation token. The delegator authorizes the delegate to act
151
+ * within the given scope. The signature covers all fields except `signature`.
152
+ */
153
+ export declare function signDelegation(delegation: Omit<DelegationToken, "signature">, delegatorPrivateKey: Uint8Array): Promise<DelegationToken>;
154
+ /**
155
+ * Verify a delegation token's signature and (optionally) expiration.
156
+ *
157
+ * @param delegation - The delegation token to verify
158
+ * @param options.checkExpiry - If true (default), reject expired tokens. Pass false
159
+ * only when verifying historical chains where expiration is irrelevant.
160
+ * @param options.now - Current time in ms (default: Date.now()). For testing.
161
+ */
162
+ export declare function verifyDelegation(delegation: DelegationToken, options?: {
163
+ checkExpiry?: boolean;
164
+ now?: number;
165
+ }): Promise<boolean>;
166
+ /**
167
+ * Verify a chain of delegation tokens.
168
+ *
169
+ * A valid chain means:
170
+ * 1. Each delegation's signature is valid (signed by the delegator's key).
171
+ * 2. Adjacent delegations are linked: delegation[i].delegate_id === delegation[i+1].delegator_id
172
+ * and delegation[i].delegate_public_key === delegation[i+1].delegator_public_key.
173
+ *
174
+ * An empty chain is considered valid (no delegations to verify).
175
+ */
176
+ export declare function verifyDelegationChain(chain: DelegationToken[]): Promise<{
177
+ valid: boolean;
178
+ error?: string;
179
+ }>;
180
+ /**
181
+ * A key succession record proving that one Ed25519 key has been replaced by another.
182
+ * Normal rotation: both old and new keys sign. Guardian recovery: guardian + new key sign.
183
+ */
184
+ export interface KeySuccessionRecord {
185
+ old_public_key: string;
186
+ new_public_key: string;
187
+ timestamp: number;
188
+ reason?: string;
189
+ old_key_signature?: string;
190
+ new_key_signature: string;
191
+ /** True when succession was authorized by guardian, not old key. */
192
+ recovery?: boolean;
193
+ /** Guardian signature — present only when recovery is true. */
194
+ guardian_signature?: string;
195
+ }
196
+ /**
197
+ * Create a key succession record signed by both the old and new keys.
198
+ */
199
+ export declare function signKeySuccession(oldPrivateKey: Uint8Array, newPrivateKey: Uint8Array, newPublicKey: Uint8Array, oldPublicKey: Uint8Array, reason?: string): Promise<KeySuccessionRecord>;
200
+ /**
201
+ * Sign a guardian recovery succession record (§3.8.3).
202
+ * The guardian key signs instead of the compromised old key.
203
+ * Reason MUST include "guardian_recovery".
204
+ */
205
+ export declare function signGuardianRecoverySuccession(guardianPrivateKey: Uint8Array, newPrivateKey: Uint8Array, oldPublicKey: Uint8Array, newPublicKey: Uint8Array, reason?: string): Promise<KeySuccessionRecord>;
206
+ /**
207
+ * Verify a key succession record. For normal rotation, checks old_key_signature + new_key_signature.
208
+ * For guardian recovery (recovery: true), checks guardian_signature + new_key_signature.
209
+ */
210
+ export declare function verifyKeySuccession(record: KeySuccessionRecord, guardianPublicKeyHex?: string): Promise<boolean>;
211
+ /** Result of verifying a key succession chain. */
212
+ export interface SuccessionChainResult {
213
+ valid: boolean;
214
+ genesis_public_key: string;
215
+ current_public_key: string;
216
+ length: number;
217
+ error?: {
218
+ index: number;
219
+ message: string;
220
+ };
221
+ }
222
+ /**
223
+ * Verify a full key succession chain — an ordered array of KeySuccessionRecords
224
+ * representing a sequence of key rotations from a genesis key to the current active key.
225
+ */
226
+ export declare function verifySuccessionChain(chain: KeySuccessionRecord[], guardianPublicKeyHex?: string): Promise<SuccessionChainResult>;
227
+ /**
228
+ * Sign a guardian revocation payload — requires BOTH identity and guardian keys.
229
+ * Neither party can unilaterally dissolve the custody relationship.
230
+ */
231
+ export declare function signGuardianRevocation(identityPrivateKey: Uint8Array, guardianPrivateKey: Uint8Array, timestamp?: number): Promise<{
232
+ payload: string;
233
+ identity_signature: string;
234
+ guardian_signature: string;
235
+ timestamp: number;
236
+ }>;
237
+ /**
238
+ * Verify a guardian revocation proof — both signatures must be valid.
239
+ */
240
+ export declare function verifyGuardianRevocation(revocation: {
241
+ identity_signature: string;
242
+ guardian_signature: string;
243
+ timestamp: number;
244
+ }, identityPublicKeyHex: string, guardianPublicKeyHex: string): Promise<boolean>;
245
+ export interface SignableCollaborativeReceipt {
246
+ proposal_id: string;
247
+ plan_id: string;
248
+ participant_receipts: SignableReceipt[];
249
+ content_hash: string;
250
+ initiator_signature: string;
251
+ }
252
+ /**
253
+ * Sign a collaborative receipt. Computes a content hash over the canonical
254
+ * JSON of all participant receipts, then signs the aggregate with the
255
+ * initiator's Ed25519 private key.
256
+ */
257
+ export declare function signCollaborativeReceipt(receipt: Omit<SignableCollaborativeReceipt, "content_hash" | "initiator_signature">, initiatorPrivateKey: Uint8Array): Promise<SignableCollaborativeReceipt>;
258
+ /**
259
+ * Verify a collaborative receipt:
260
+ * 1. Recomputes content hash from participant receipts and checks it matches.
261
+ * 2. Verifies the initiator's Ed25519 signature over the aggregate.
262
+ * 3. Optionally verifies each participant receipt against known keys.
263
+ */
264
+ export declare function verifyCollaborativeReceipt(receipt: SignableCollaborativeReceipt, initiatorPublicKey: Uint8Array, participantKeys?: KnownKeys): Promise<{
265
+ valid: boolean;
266
+ error?: string;
267
+ }>;
268
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,oFAAoF;IACpF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;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