@bsv/dpp-core 0.3.0-beta.1
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 +58 -0
- package/README.md +95 -0
- package/dist/acceptance.d.ts +100 -0
- package/dist/acceptance.d.ts.map +1 -0
- package/dist/acceptance.js +202 -0
- package/dist/acceptance.js.map +1 -0
- package/dist/anchor.d.ts +66 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +145 -0
- package/dist/anchor.js.map +1 -0
- package/dist/attestation.d.ts +40 -0
- package/dist/attestation.d.ts.map +1 -0
- package/dist/attestation.js +111 -0
- package/dist/attestation.js.map +1 -0
- package/dist/blob.d.ts +11 -0
- package/dist/blob.d.ts.map +1 -0
- package/dist/blob.js +16 -0
- package/dist/blob.js.map +1 -0
- package/dist/canonical.d.ts +32 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +54 -0
- package/dist/canonical.js.map +1 -0
- package/dist/canonicalJson.d.ts +22 -0
- package/dist/canonicalJson.d.ts.map +1 -0
- package/dist/canonicalJson.js +60 -0
- package/dist/canonicalJson.js.map +1 -0
- package/dist/codec.d.ts +45 -0
- package/dist/codec.d.ts.map +1 -0
- package/dist/codec.js +459 -0
- package/dist/codec.js.map +1 -0
- package/dist/constants.d.ts +150 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +179 -0
- package/dist/constants.js.map +1 -0
- package/dist/did.d.ts +37 -0
- package/dist/did.d.ts.map +1 -0
- package/dist/did.js +129 -0
- package/dist/did.js.map +1 -0
- package/dist/evidence.d.ts +224 -0
- package/dist/evidence.d.ts.map +1 -0
- package/dist/evidence.js +716 -0
- package/dist/evidence.js.map +1 -0
- package/dist/evidencePackage.d.ts +114 -0
- package/dist/evidencePackage.d.ts.map +1 -0
- package/dist/evidencePackage.js +164 -0
- package/dist/evidencePackage.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/owner.d.ts +135 -0
- package/dist/owner.d.ts.map +1 -0
- package/dist/owner.js +181 -0
- package/dist/owner.js.map +1 -0
- package/dist/publisherPolicy.d.ts +70 -0
- package/dist/publisherPolicy.d.ts.map +1 -0
- package/dist/publisherPolicy.js +186 -0
- package/dist/publisherPolicy.js.map +1 -0
- package/dist/signatures.d.ts +84 -0
- package/dist/signatures.d.ts.map +1 -0
- package/dist/signatures.js +137 -0
- package/dist/signatures.js.map +1 -0
- package/dist/transition.d.ts +29 -0
- package/dist/transition.d.ts.map +1 -0
- package/dist/transition.js +117 -0
- package/dist/transition.js.map +1 -0
- package/dist/types.d.ts +135 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/verifyChain.d.ts +152 -0
- package/dist/verifyChain.d.ts.map +1 -0
- package/dist/verifyChain.js +314 -0
- package/dist/verifyChain.js.map +1 -0
- package/package.json +46 -0
- package/schemas/capabilities.schema.json +129 -0
- package/schemas/epcis-import.schema.json +212 -0
- package/schemas/evidence-export.schema.json +67 -0
- package/schemas/evidence-package.schema.json +307 -0
- package/schemas/native-evidence-extension.schema.json +66 -0
- package/schemas/paginated-history.schema.json +32 -0
- package/schemas/passport-projection.schema.json +151 -0
- package/schemas/passport-source.schema.json +370 -0
- package/schemas/profile-evidence.schema.json +706 -0
- package/schemas/publisher-policy.schema.json +173 -0
- package/schemas/verification-report.schema.json +397 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { tryParseDppOutput } from './codec.js';
|
|
2
|
+
import { MANAGED_CUSTODY_PROFILE } from './constants.js';
|
|
3
|
+
import { verifyServerSignature, verifyUserSignature } from './signatures.js';
|
|
4
|
+
import { publisherKeysAt } from './publisherPolicy.js';
|
|
5
|
+
import { checkControl, checkOwnerConsent, normaliseTransferAuthorities } from './owner.js';
|
|
6
|
+
import { checkGenesisState, checkTransition } from './transition.js';
|
|
7
|
+
/** What a reader reports when the managed-custody profile is selected and a version 2 TRANSFER carries no commitment. */
|
|
8
|
+
export const ACCEPTANCE_COMMITMENT_REFUSAL = `TRANSFER carries no authorisation_commitment under ${MANAGED_CUSTODY_PROFILE}`;
|
|
9
|
+
/**
|
|
10
|
+
* Locate THE DPP output of a transaction (§6 invariant 1: exactly one).
|
|
11
|
+
* Returns all matches; callers enforce the invariant.
|
|
12
|
+
*/
|
|
13
|
+
export function findDppOutputs(tx) {
|
|
14
|
+
const refs = [];
|
|
15
|
+
tx.outputs.forEach((output, outputIndex) => {
|
|
16
|
+
const parsed = tryParseDppOutput(output.lockingScript);
|
|
17
|
+
if (parsed != null) {
|
|
18
|
+
refs.push({ state: parsed.state, outputIndex, lockingPublicKey: parsed.lockingPublicKey });
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return refs;
|
|
22
|
+
}
|
|
23
|
+
export async function inspectChain(txs, options = {}) {
|
|
24
|
+
const states = [];
|
|
25
|
+
let anyPending = false;
|
|
26
|
+
let unavailable;
|
|
27
|
+
const stop = (index, txid, kind, message) => ({
|
|
28
|
+
states,
|
|
29
|
+
failure: { index, txid, kind, message: `state ${index} (${txid}): ${message}` },
|
|
30
|
+
complete: false,
|
|
31
|
+
anyPending,
|
|
32
|
+
...(unavailable == null ? {} : { spvUnavailable: unavailable }),
|
|
33
|
+
});
|
|
34
|
+
const staticPublisherKeys = [
|
|
35
|
+
...(options.serverIdentityKey == null ? [] : [options.serverIdentityKey]),
|
|
36
|
+
...(options.publisherKeys ?? []),
|
|
37
|
+
];
|
|
38
|
+
const policy = options.publisherPolicy != null && options.publisherPolicy.length > 0 ? options.publisherPolicy : undefined;
|
|
39
|
+
// Every state-publisher key any version of the policy ever named: a
|
|
40
|
+
// countersignature that verifies under one of these but not under a key
|
|
41
|
+
// active at the state's time is a window failure, reported as such rather
|
|
42
|
+
// than as a stranger's signature.
|
|
43
|
+
const everPolicyKeys = policy == null ? [] : [...new Set(policy.flatMap((p) => p.publishers.filter((e) => e.role === 'state-publisher').map((e) => e.key)))];
|
|
44
|
+
const publisherSelected = staticPublisherKeys.length > 0 || policy != null;
|
|
45
|
+
const publisherKeysFor = (state) => policy == null ? staticPublisherKeys : [...staticPublisherKeys, ...publisherKeysAt(policy, state.timestamp, 'state-publisher')];
|
|
46
|
+
const consentSelected = options.ownerConsent != null && options.ownerConsent !== false;
|
|
47
|
+
const consentAuthorities = typeof options.ownerConsent === 'object'
|
|
48
|
+
? normaliseTransferAuthorities(options.ownerConsent.authorities)
|
|
49
|
+
: [];
|
|
50
|
+
const controlAuthorities = options.controlAuthorities != null ? normaliseTransferAuthorities(options.controlAuthorities) : consentAuthorities;
|
|
51
|
+
let prev = null;
|
|
52
|
+
let genesis;
|
|
53
|
+
for (let i = 0; i < txs.length; i++) {
|
|
54
|
+
const tx = txs[i];
|
|
55
|
+
const txid = tx.id('hex');
|
|
56
|
+
const refs = findDppOutputs(tx);
|
|
57
|
+
if (refs.length !== 1) {
|
|
58
|
+
return stop(i, txid, 'encoding', `exactly one DPP output required, found ${refs.length}`);
|
|
59
|
+
}
|
|
60
|
+
const { state, outputIndex } = refs[0];
|
|
61
|
+
const userSignatureValid = verifyUserSignature(state);
|
|
62
|
+
const serverSignatureValid = !publisherSelected
|
|
63
|
+
? null
|
|
64
|
+
: publisherKeysFor(state).some((key) => verifyServerSignature(state, key));
|
|
65
|
+
const publisherOutsideWindow = serverSignatureValid === false && everPolicyKeys.some((key) => verifyServerSignature(state, key));
|
|
66
|
+
let linkError;
|
|
67
|
+
let controlValid = null;
|
|
68
|
+
if (prev == null) {
|
|
69
|
+
linkError = checkGenesisState(state);
|
|
70
|
+
genesis = { txid, outputIndex };
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
linkError = checkTransition(prev.state, state, prev.txid, {
|
|
74
|
+
prevOutputIndex: prev.outputIndex,
|
|
75
|
+
lineageGenesis: genesis,
|
|
76
|
+
authorities: controlAuthorities,
|
|
77
|
+
});
|
|
78
|
+
if (linkError == null) {
|
|
79
|
+
const spendsPrev = tx.inputs.some((input) => (input.sourceTransaction?.id('hex') ?? input.sourceTXID) === prev.txid &&
|
|
80
|
+
input.sourceOutputIndex === prev.outputIndex);
|
|
81
|
+
if (!spendsPrev)
|
|
82
|
+
linkError = 'state does not spend the previous tip output';
|
|
83
|
+
}
|
|
84
|
+
// The version 2 control proof is part of the link; it is reported on
|
|
85
|
+
// its own as well, so a report can say which rule a refused state broke.
|
|
86
|
+
if (state.version === '2')
|
|
87
|
+
controlValid = checkControl(prev.state, state, controlAuthorities) == null;
|
|
88
|
+
}
|
|
89
|
+
// The eighth, optional invariant of version 1 runs only where it is
|
|
90
|
+
// defined: on a TRANSFER whose link holds, under a profile that selects
|
|
91
|
+
// it. Anywhere else it reports null, so a consumer prints "not applicable"
|
|
92
|
+
// and never a pass the predicate did not earn. The managed-custody
|
|
93
|
+
// profile's requirement on a version 2 TRANSFER is reported the same way.
|
|
94
|
+
let consentError = null;
|
|
95
|
+
let ownerConsentValid = null;
|
|
96
|
+
if (prev != null && linkError == null && state.op === 'TRANSFER') {
|
|
97
|
+
if (state.version === '1' && consentSelected) {
|
|
98
|
+
consentError = checkOwnerConsent(prev.state, state, consentAuthorities);
|
|
99
|
+
ownerConsentValid = consentError == null;
|
|
100
|
+
}
|
|
101
|
+
else if (state.version === '2' && options.managedAcceptance === true && state.authorisationCommitment === '') {
|
|
102
|
+
consentError = ACCEPTANCE_COMMITMENT_REFUSAL;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
let spv;
|
|
106
|
+
let spvReason;
|
|
107
|
+
let spvFailReason = 'merkle path does not validate against block headers';
|
|
108
|
+
const tracker = options.chainTracker;
|
|
109
|
+
if (tx.merklePath == null) {
|
|
110
|
+
spv = 'pending';
|
|
111
|
+
spvReason = 'no-proof';
|
|
112
|
+
anyPending = true;
|
|
113
|
+
}
|
|
114
|
+
else if (tracker == null || tracker === 'scripts only') {
|
|
115
|
+
spv = 'pending';
|
|
116
|
+
spvReason = 'header-check-disabled';
|
|
117
|
+
anyPending = true;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
// Three outcomes, not two. `verify` returns false only when the tracker
|
|
121
|
+
// answered and the root it holds for that height is a different root:
|
|
122
|
+
// that is evidence the proof is wrong, and the chain must fail. It
|
|
123
|
+
// throws when the tracker could not answer at all (service down, rate
|
|
124
|
+
// limited, socket error), which is evidence of nothing.
|
|
125
|
+
//
|
|
126
|
+
// Both used to land on 'failed', so one header service having a bad
|
|
127
|
+
// afternoon made every passport in the demonstration read "Could not
|
|
128
|
+
// verify" - the strongest accusation the product can make about a
|
|
129
|
+
// product, published because we could not reach a website. Unchecked is
|
|
130
|
+
// 'pending', and the reason travels with the result so an operator can
|
|
131
|
+
// see the outage instead of inferring it from complaints.
|
|
132
|
+
//
|
|
133
|
+
// A proof can also refute itself before any source is asked: one that
|
|
134
|
+
// does not contain this transaction's txid fails on local inspection,
|
|
135
|
+
// deterministically, and no outage explains it. That throw used to
|
|
136
|
+
// share the tracker's catch and land on 'pending', so a chain carrying
|
|
137
|
+
// a proof for some OTHER transaction stayed valid-with-pending forever.
|
|
138
|
+
// computeRoot is pre-flighted on its own so the two throws separate.
|
|
139
|
+
let proven = null;
|
|
140
|
+
let coversTxid = true;
|
|
141
|
+
try {
|
|
142
|
+
tx.merklePath.computeRoot(txid);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
coversTxid = false;
|
|
146
|
+
}
|
|
147
|
+
if (!coversTxid) {
|
|
148
|
+
spv = 'failed';
|
|
149
|
+
spvReason = 'proof-does-not-contain-txid';
|
|
150
|
+
spvFailReason = 'merkle path does not contain this transaction';
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
try {
|
|
154
|
+
proven = await tx.merklePath.verify(txid, tracker);
|
|
155
|
+
}
|
|
156
|
+
catch (cause) {
|
|
157
|
+
proven = null;
|
|
158
|
+
unavailable ??= cause instanceof Error ? cause.message : String(cause);
|
|
159
|
+
}
|
|
160
|
+
if (proven == null) {
|
|
161
|
+
spv = 'pending';
|
|
162
|
+
spvReason = 'header-source-unavailable';
|
|
163
|
+
anyPending = true;
|
|
164
|
+
}
|
|
165
|
+
else if (proven) {
|
|
166
|
+
spv = 'verified';
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
spv = 'failed';
|
|
170
|
+
spvReason = 'proof-refuted';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
states.push({
|
|
175
|
+
index: i,
|
|
176
|
+
outputIndex,
|
|
177
|
+
state,
|
|
178
|
+
version: state.version,
|
|
179
|
+
txid,
|
|
180
|
+
op: state.op,
|
|
181
|
+
userSignatureValid,
|
|
182
|
+
serverSignatureValid,
|
|
183
|
+
...(publisherOutsideWindow ? { publisherOutsideWindow: true } : {}),
|
|
184
|
+
linkageValid: linkError == null,
|
|
185
|
+
ownerConsentValid,
|
|
186
|
+
controlValid,
|
|
187
|
+
spv,
|
|
188
|
+
linkError,
|
|
189
|
+
consentError,
|
|
190
|
+
...(spvReason == null ? {} : { spvReason }),
|
|
191
|
+
});
|
|
192
|
+
if (!userSignatureValid)
|
|
193
|
+
return stop(i, txid, 'userSignature', 'user_signature invalid');
|
|
194
|
+
if (serverSignatureValid === false) {
|
|
195
|
+
return stop(i, txid, 'serverSignature', publisherOutsideWindow
|
|
196
|
+
? `server_signature verifies under a publisher key that was not active at ${state.timestamp}`
|
|
197
|
+
: 'server_signature invalid for configured service key');
|
|
198
|
+
}
|
|
199
|
+
if (linkError != null)
|
|
200
|
+
return stop(i, txid, 'linkage', linkError);
|
|
201
|
+
if (consentError != null)
|
|
202
|
+
return stop(i, txid, 'consent', consentError);
|
|
203
|
+
if (spv === 'failed')
|
|
204
|
+
return stop(i, txid, 'inclusion', spvFailReason);
|
|
205
|
+
prev = { state, txid, outputIndex };
|
|
206
|
+
}
|
|
207
|
+
return {
|
|
208
|
+
states,
|
|
209
|
+
complete: true,
|
|
210
|
+
anyPending,
|
|
211
|
+
...(unavailable == null ? {} : { spvUnavailable: unavailable }),
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/** The `StateCheck` a `ChainVerifyResult` carries, without the inspection's extra findings. */
|
|
215
|
+
function toStateCheck(s) {
|
|
216
|
+
return {
|
|
217
|
+
txid: s.txid,
|
|
218
|
+
op: s.op,
|
|
219
|
+
userSignatureValid: s.userSignatureValid,
|
|
220
|
+
serverSignatureValid: s.serverSignatureValid,
|
|
221
|
+
linkageValid: s.linkageValid,
|
|
222
|
+
ownerConsentValid: s.ownerConsentValid,
|
|
223
|
+
spv: s.spv,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Verify a full passport chain, ordered genesis → tip (§6 + §8).
|
|
228
|
+
*
|
|
229
|
+
* What "Authentic ✓" means (§8): (1) the genesis maker signature is valid;
|
|
230
|
+
* (2) every link satisfies invariants 1–5, checked here both structurally
|
|
231
|
+
* (the next state spends the previous DPP output) and on the readable field
|
|
232
|
+
* (previous_txid equality); (3) SPV - each mined transaction's merkle path
|
|
233
|
+
* validates against block headers via the chain tracker. An unmined state
|
|
234
|
+
* passes with SPV 'pending'. Any failure ⇒ valid: false ("Could not verify").
|
|
235
|
+
*
|
|
236
|
+
* Script execution of spends is enforced by the network and is not
|
|
237
|
+
* re-evaluated here; the in-app checks are exactly the three above.
|
|
238
|
+
*
|
|
239
|
+
* This is supplied-history verification and nothing more: it says whether the
|
|
240
|
+
* states handed to it form a valid chain, not that the last one is the current
|
|
241
|
+
* tip, that its genesis was authorised, or that the attestation rail was
|
|
242
|
+
* checked. `verifyPassportEvidence` (evidence.ts) is the report that keeps
|
|
243
|
+
* those findings apart; this function keeps its one Boolean for the callers
|
|
244
|
+
* that mean exactly what it says.
|
|
245
|
+
*/
|
|
246
|
+
export async function verifyChain(txs, options = {}) {
|
|
247
|
+
// 'verified' is a claim that every mined state proved against block headers,
|
|
248
|
+
// and a failed chain never makes it, whatever its proofs said. It used to:
|
|
249
|
+
// first because the summary read only `anyPending`, then because it guarded
|
|
250
|
+
// a flag that only an SPV failure set, so a chain failing on a signature or
|
|
251
|
+
// on linkage - every proof good - still came back
|
|
252
|
+
// `{ valid: false, spv: 'verified' }`, and a consumer showing the two
|
|
253
|
+
// separately printed "inclusion proved" beside "did not check out". The
|
|
254
|
+
// failure path now says 'pending' outright; the per-state truth, including
|
|
255
|
+
// 'failed' where a proof was refuted, stays in `states`.
|
|
256
|
+
if (txs.length === 0)
|
|
257
|
+
return { valid: false, spv: 'pending', states: [], error: 'empty chain' };
|
|
258
|
+
const inspection = await inspectChain(txs, options);
|
|
259
|
+
const states = inspection.states.map(toStateCheck);
|
|
260
|
+
const unavailable = inspection.spvUnavailable == null ? {} : { spvUnavailable: inspection.spvUnavailable };
|
|
261
|
+
if (inspection.failure != null) {
|
|
262
|
+
return { valid: false, spv: 'pending', states, error: inspection.failure.message, ...unavailable };
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
valid: true,
|
|
266
|
+
spv: inspection.anyPending ? 'pending' : 'verified',
|
|
267
|
+
states,
|
|
268
|
+
...unavailable,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Reconstruct the ordered passport chain (genesis → tip) from a BEEF, e.g.
|
|
273
|
+
* as returned by the ls_dpp lookup. Transactions come out hydrated: merkle
|
|
274
|
+
* paths attached, input source transactions linked - ready for verifyChain.
|
|
275
|
+
* States of either version link by `previousTxid`; a version 2 state also
|
|
276
|
+
* carries the predecessor's output index, which the verifier checks.
|
|
277
|
+
*/
|
|
278
|
+
export function chainFromBeef(beef, passportId) {
|
|
279
|
+
const entries = [];
|
|
280
|
+
for (const beefTx of beef.txs) {
|
|
281
|
+
const tx = beefTx.tx;
|
|
282
|
+
if (tx == null)
|
|
283
|
+
continue;
|
|
284
|
+
const refs = findDppOutputs(tx);
|
|
285
|
+
const ref = refs.find((r) => passportId == null || r.state.passportId === passportId);
|
|
286
|
+
if (ref != null)
|
|
287
|
+
entries.push({ txid: beefTx.txid, state: ref.state });
|
|
288
|
+
}
|
|
289
|
+
if (entries.length === 0) {
|
|
290
|
+
throw new Error('BEEF contains no DPP states' + (passportId ? ` for ${passportId}` : ''));
|
|
291
|
+
}
|
|
292
|
+
const genesis = entries.filter((e) => e.state.previousTxid === '');
|
|
293
|
+
if (genesis.length !== 1) {
|
|
294
|
+
throw new Error(`expected exactly one genesis state, found ${genesis.length}`);
|
|
295
|
+
}
|
|
296
|
+
const byPrev = new Map(entries
|
|
297
|
+
.filter((e) => e.state.previousTxid !== '')
|
|
298
|
+
.map((e) => [e.state.previousTxid, e]));
|
|
299
|
+
const ordered = [];
|
|
300
|
+
let current = genesis[0];
|
|
301
|
+
while (current != null) {
|
|
302
|
+
const hydrated = beef.findAtomicTransaction(current.txid);
|
|
303
|
+
if (hydrated == null) {
|
|
304
|
+
throw new Error(`BEEF is missing transaction ${current.txid}`);
|
|
305
|
+
}
|
|
306
|
+
ordered.push(hydrated);
|
|
307
|
+
current = byPrev.get(current.txid);
|
|
308
|
+
}
|
|
309
|
+
if (ordered.length !== entries.length) {
|
|
310
|
+
throw new Error('BEEF contains DPP states that do not link into one chain');
|
|
311
|
+
}
|
|
312
|
+
return ordered;
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=verifyChain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyChain.js","sourceRoot":"","sources":["../src/verifyChain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAwB,MAAM,sBAAsB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAA;AA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B,MAAM,IAAI,KAAK,CAAC,6CAA6C,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAChF,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,OAAO;SACJ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC;SAC1C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CACzC,CAAA;IACD,MAAM,OAAO,GAAkB,EAAE,CAAA;IACjC,IAAI,OAAO,GAAkD,OAAO,CAAC,CAAC,CAAC,CAAA;IACvE,OAAO,OAAO,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACzD,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,+BAA+B,OAAO,CAAC,IAAI,EAAE,CAAC,CAAA;QAChE,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACtB,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;IAC7E,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bsv/dpp-core",
|
|
3
|
+
"version": "0.3.0-beta.1",
|
|
4
|
+
"description": "Experimental prerelease: DPP standard reference implementation: record versions 1 and 2, signature preimages, chain verification with SPV, the verification report, the native lifecycle claim, the generic anchor, the managed acceptance record, publisher key policy and the evidence package manifest",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./schemas/*": "./schemas/*"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"schemas"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc -p tsconfig.json && node ../../scripts/package-schemas.mjs",
|
|
22
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"test:watch": "vitest"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@bsv/sdk": "2.4.2"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript": "^5.9.3",
|
|
31
|
+
"vitest": "4.1.11"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/bsv-blockchain/dpp.git",
|
|
36
|
+
"directory": "packages/dpp-core"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/",
|
|
41
|
+
"tag": "next"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://bsv-blockchain.github.io/dpp/contracts/capabilities.schema.json",
|
|
4
|
+
"title": "DPP capability document, version 1",
|
|
5
|
+
"description": "What one implementation declares it supports (spec/conformance.md section 4): roles, protocol versions, exact profiles with artefact digests, representations, proof suites, anchor formats, topics and services, limits, and what it explicitly does not support. A claim of support, checkable against the ledger; never proof of authority or conformance.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["capabilitiesVersion", "implementation", "roles", "protocols", "profiles", "representations", "proofSuites", "anchorFormats", "unsupported"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"capabilitiesVersion": { "const": "1" },
|
|
11
|
+
"implementation": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"required": ["name", "version"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"name": { "type": "string", "minLength": 1 },
|
|
17
|
+
"version": { "type": "string", "minLength": 1 },
|
|
18
|
+
"sourceRevision": { "type": "string", "pattern": "^[0-9a-f]{7,64}$" },
|
|
19
|
+
"baselineId": { "type": "string", "description": "The recommended baseline claimed, for example native-baseline@1." }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"roles": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"minItems": 1,
|
|
25
|
+
"uniqueItems": true,
|
|
26
|
+
"items": { "enum": ["passport-reader", "attestation-verifier", "passport-writer", "attestation-issuer", "registry", "overlay"] }
|
|
27
|
+
},
|
|
28
|
+
"protocols": {
|
|
29
|
+
"type": "array",
|
|
30
|
+
"items": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": false,
|
|
33
|
+
"required": ["id", "version"],
|
|
34
|
+
"properties": {
|
|
35
|
+
"id": { "type": "string", "minLength": 1, "description": "For example dpp-record, dpp-lifecycle, bsv-attestation-anchor, overlay-http, registry-http, verification-report." },
|
|
36
|
+
"version": { "type": "string", "minLength": 1 }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"profiles": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"items": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"additionalProperties": false,
|
|
45
|
+
"required": ["id", "version", "kind"],
|
|
46
|
+
"properties": {
|
|
47
|
+
"id": { "type": "string", "minLength": 1 },
|
|
48
|
+
"version": { "type": "string", "minLength": 1 },
|
|
49
|
+
"kind": { "enum": ["industry", "exchange", "operator", "custody"] },
|
|
50
|
+
"artefactDigests": {
|
|
51
|
+
"type": "object",
|
|
52
|
+
"additionalProperties": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
|
|
53
|
+
"description": "SHA-256 per artefact path or identifier the profile publishes."
|
|
54
|
+
},
|
|
55
|
+
"options": { "type": "object", "additionalProperties": true, "description": "The named options selected under the profile, for example ownerConsent or transferAuthorities." }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"representations": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"additionalProperties": false,
|
|
64
|
+
"required": ["id", "mediaType", "verification"],
|
|
65
|
+
"properties": {
|
|
66
|
+
"id": { "type": "string", "minLength": 1 },
|
|
67
|
+
"mediaType": { "type": "string", "minLength": 1 },
|
|
68
|
+
"verification": { "enum": ["content", "commitment-only"], "description": "content: the representation's own rules are implemented; commitment-only: anchors are indexed and content verification returns unsupported." }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"proofSuites": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
73
|
+
"anchorFormats": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"additionalProperties": false,
|
|
78
|
+
"required": ["prefix", "status"],
|
|
79
|
+
"properties": {
|
|
80
|
+
"prefix": { "type": "string", "minLength": 1 },
|
|
81
|
+
"status": { "enum": ["current", "historical", "refused"] }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"topics": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
86
|
+
"services": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
87
|
+
"publisherPolicy": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"description": "How an overlay or registry authorises publishers and anchoring services, separately from its own identity.",
|
|
91
|
+
"properties": {
|
|
92
|
+
"policyVersion": { "type": "string" },
|
|
93
|
+
"publisherKeys": { "type": "array", "items": { "type": "string", "pattern": "^0[23][0-9a-f]{64}$" } },
|
|
94
|
+
"anchoringServices": { "type": "array", "items": { "type": "string", "pattern": "^0[23][0-9a-f]{64}$" } },
|
|
95
|
+
"ownerConsent": { "enum": ["not-selected", "required"] },
|
|
96
|
+
"transferAuthorities": { "type": "array", "items": { "type": "string", "pattern": "^0[23][0-9a-f]{64}$" } }
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"synchronisation": {
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"description": "The operator profile actually configured, so a client knows whether a second operator can be expected to hold the same evidence.",
|
|
103
|
+
"required": ["profile"],
|
|
104
|
+
"properties": {
|
|
105
|
+
"profile": { "type": "string", "minLength": 1, "description": "For example single-operator@1 or federated-operators@1." },
|
|
106
|
+
"discovery": { "enum": ["none", "ship-slap", "static-peers"] },
|
|
107
|
+
"gasp": { "type": "boolean" },
|
|
108
|
+
"peers": { "type": "array", "items": { "type": "string", "format": "uri" } }
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"limits": {
|
|
112
|
+
"type": "object",
|
|
113
|
+
"additionalProperties": { "type": ["integer", "string"] },
|
|
114
|
+
"description": "Named service limits, for example maxLookupResults, defaultPageSize, maxBodyBytes, statusFetchTimeoutMs."
|
|
115
|
+
},
|
|
116
|
+
"unsupported": {
|
|
117
|
+
"type": "array",
|
|
118
|
+
"items": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": ["id", "reason"],
|
|
122
|
+
"properties": {
|
|
123
|
+
"id": { "type": "string", "minLength": 1 },
|
|
124
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|