dero-mcp-server 0.2.2 → 0.4.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/POSITIONING.md +94 -0
- package/README.md +125 -24
- package/SKILL.md +264 -0
- package/data/docs-index.json +264 -260
- package/dist/bn254.d.ts +74 -0
- package/dist/bn254.d.ts.map +1 -0
- package/dist/bn254.js +205 -0
- package/dist/bn254.js.map +1 -0
- package/dist/citations.d.ts +70 -0
- package/dist/citations.d.ts.map +1 -1
- package/dist/citations.js +161 -1
- package/dist/citations.js.map +1 -1
- package/dist/composites/_shared.d.ts +1 -1
- package/dist/composites/_shared.js +1 -1
- package/dist/composites/audit-chain-artifact-claim.d.ts +128 -0
- package/dist/composites/audit-chain-artifact-claim.d.ts.map +1 -0
- package/dist/composites/audit-chain-artifact-claim.js +305 -0
- package/dist/composites/audit-chain-artifact-claim.js.map +1 -0
- package/dist/composites/diagnose-chain-health.d.ts +1 -1
- package/dist/composites/diagnose-chain-health.js +1 -1
- package/dist/composites/estimate-deploy-cost.d.ts +1 -1
- package/dist/composites/estimate-deploy-cost.js +1 -1
- package/dist/composites/explain-smart-contract.d.ts +1 -1
- package/dist/composites/explain-smart-contract.js +1 -1
- package/dist/composites/forge-demo-proof.d.ts +81 -0
- package/dist/composites/forge-demo-proof.d.ts.map +1 -0
- package/dist/composites/forge-demo-proof.js +204 -0
- package/dist/composites/forge-demo-proof.js.map +1 -0
- package/dist/composites/recommend-docs-path.d.ts +1 -1
- package/dist/composites/recommend-docs-path.js +1 -1
- package/dist/composites/trace-transaction-with-context.d.ts +1 -1
- package/dist/composites/trace-transaction-with-context.js +1 -1
- package/dist/daemon-base.d.ts +28 -0
- package/dist/daemon-base.d.ts.map +1 -0
- package/dist/daemon-base.js +62 -0
- package/dist/daemon-base.js.map +1 -0
- package/dist/dero-curve.d.ts +79 -0
- package/dist/dero-curve.d.ts.map +1 -0
- package/dist/dero-curve.js +79 -0
- package/dist/dero-curve.js.map +1 -0
- package/dist/docs-parse.d.ts.map +1 -1
- package/dist/docs-parse.js +18 -2
- package/dist/docs-parse.js.map +1 -1
- package/dist/http-server.d.ts +37 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +139 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.js +18 -11
- package/dist/index.js.map +1 -1
- package/dist/proof-decode.d.ts +125 -0
- package/dist/proof-decode.d.ts.map +1 -0
- package/dist/proof-decode.js +619 -0
- package/dist/proof-decode.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +89 -11
- package/dist/server.js.map +1 -1
- package/dist/tool-descriptions.d.ts +3 -0
- package/dist/tool-descriptions.d.ts.map +1 -1
- package/dist/tool-descriptions.js +39 -0
- package/dist/tool-descriptions.js.map +1 -1
- package/dist/tx-parse.d.ts +63 -0
- package/dist/tx-parse.d.ts.map +1 -0
- package/dist/tx-parse.js +183 -0
- package/dist/tx-parse.js.map +1 -0
- package/package.json +24 -3
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decoder for DERO `deroproof…` / `dero…` / `deroi…` / `deto…` / `detoi…` bech32 strings.
|
|
3
|
+
*
|
|
4
|
+
* Implements the same wire format as `rpc/address.go` + `rpc/rpc.go` in DEROHE:
|
|
5
|
+
*
|
|
6
|
+
* bech32 → convertbits(5→8, no pad) → version byte (=1) → 33-byte compressed point
|
|
7
|
+
* → optional CBOR map of arguments (only present for HRPs `deroi`, `detoi`, `deroproof`).
|
|
8
|
+
*
|
|
9
|
+
* The CBOR map keys are `Name + DataType` ASCII strings (e.g. `"VU"` for
|
|
10
|
+
* `RPC_VALUE_TRANSFER` + `DataUint64`). Values are typed CBOR primitives.
|
|
11
|
+
*
|
|
12
|
+
* No new npm dependencies — bech32 + the minimum-needed CBOR subset are hand-rolled
|
|
13
|
+
* (~zero kB install delta for the MCP server, which is published for `npx` use).
|
|
14
|
+
*
|
|
15
|
+
* Verified against the publicly-cited 2022 inflation-claim proof string:
|
|
16
|
+
* embedded `uint64` = 18446743853709551435 = signed -2,200,000.00181 DERO.
|
|
17
|
+
*/
|
|
18
|
+
const BECH32_CHARSET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l';
|
|
19
|
+
const BECH32_CHARSET_INDEX = Object.fromEntries(Array.from(BECH32_CHARSET).map((c, i) => [c, i]));
|
|
20
|
+
/** Polymod step from BIP-0173. */
|
|
21
|
+
function bech32Polymod(values) {
|
|
22
|
+
const generators = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3];
|
|
23
|
+
let chk = 1;
|
|
24
|
+
for (const v of values) {
|
|
25
|
+
const top = chk >>> 25;
|
|
26
|
+
chk = ((chk & 0x1ffffff) << 5) ^ v;
|
|
27
|
+
for (let i = 0; i < 5; i++) {
|
|
28
|
+
if ((top >>> i) & 1)
|
|
29
|
+
chk ^= generators[i];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return chk;
|
|
33
|
+
}
|
|
34
|
+
function bech32HrpExpand(hrp) {
|
|
35
|
+
const out = [];
|
|
36
|
+
for (let i = 0; i < hrp.length; i++)
|
|
37
|
+
out.push(hrp.charCodeAt(i) >>> 5);
|
|
38
|
+
out.push(0);
|
|
39
|
+
for (let i = 0; i < hrp.length; i++)
|
|
40
|
+
out.push(hrp.charCodeAt(i) & 31);
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
function bech32VerifyChecksum(hrp, data) {
|
|
44
|
+
return bech32Polymod([...bech32HrpExpand(hrp), ...data]) === 1;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Decode a bech32 string. Throws on invalid input.
|
|
48
|
+
* Returns `{ hrp, data }` where data is the 5-bit values WITHOUT the 6-byte checksum.
|
|
49
|
+
*/
|
|
50
|
+
export function bech32Decode(input) {
|
|
51
|
+
if (input.length < 8 || input.length > 1023) {
|
|
52
|
+
throw new Error(`bech32: invalid length ${input.length}`);
|
|
53
|
+
}
|
|
54
|
+
const hasLower = /[a-z]/.test(input);
|
|
55
|
+
const hasUpper = /[A-Z]/.test(input);
|
|
56
|
+
if (hasLower && hasUpper)
|
|
57
|
+
throw new Error('bech32: mixed case not allowed');
|
|
58
|
+
const lower = input.toLowerCase();
|
|
59
|
+
const sep = lower.lastIndexOf('1');
|
|
60
|
+
if (sep < 1 || sep + 7 > lower.length) {
|
|
61
|
+
throw new Error('bech32: separator not found or too close to ends');
|
|
62
|
+
}
|
|
63
|
+
const hrp = lower.slice(0, sep);
|
|
64
|
+
const dataPart = lower.slice(sep + 1);
|
|
65
|
+
const data = [];
|
|
66
|
+
for (const ch of dataPart) {
|
|
67
|
+
const v = BECH32_CHARSET_INDEX[ch];
|
|
68
|
+
if (v === undefined)
|
|
69
|
+
throw new Error(`bech32: invalid char "${ch}"`);
|
|
70
|
+
data.push(v);
|
|
71
|
+
}
|
|
72
|
+
if (!bech32VerifyChecksum(hrp, data)) {
|
|
73
|
+
throw new Error('bech32: invalid checksum');
|
|
74
|
+
}
|
|
75
|
+
return { hrp, data: data.slice(0, -6) };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Repack a bit-stream from `fromBits` to `toBits`. Mirrors DEROHE's `convertbits`
|
|
79
|
+
* (in turn from BIP-0173 reference impl).
|
|
80
|
+
*/
|
|
81
|
+
export function convertBits(data, fromBits, toBits, pad) {
|
|
82
|
+
let acc = 0;
|
|
83
|
+
let bits = 0;
|
|
84
|
+
const out = [];
|
|
85
|
+
const maxv = (1 << toBits) - 1;
|
|
86
|
+
for (const value of data) {
|
|
87
|
+
if (value < 0 || value >>> fromBits !== 0) {
|
|
88
|
+
throw new Error(`convertBits: value out of range: ${value}`);
|
|
89
|
+
}
|
|
90
|
+
acc = (acc << fromBits) | value;
|
|
91
|
+
bits += fromBits;
|
|
92
|
+
while (bits >= toBits) {
|
|
93
|
+
bits -= toBits;
|
|
94
|
+
out.push((acc >>> bits) & maxv);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (pad) {
|
|
98
|
+
if (bits > 0)
|
|
99
|
+
out.push((acc << (toBits - bits)) & maxv);
|
|
100
|
+
}
|
|
101
|
+
else if (bits >= fromBits || ((acc << (toBits - bits)) & maxv) !== 0) {
|
|
102
|
+
throw new Error('convertBits: non-zero padding bits');
|
|
103
|
+
}
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
107
|
+
// Minimal CBOR decoder
|
|
108
|
+
//
|
|
109
|
+
// Implements only the subset DEROHE actually serializes for `Arguments`:
|
|
110
|
+
// - major type 0 (unsigned int) → uint64 (bigint when ≥ 2^53)
|
|
111
|
+
// - major type 1 (negative int) → int64 (bigint when needed)
|
|
112
|
+
// - major type 2 (byte string) → Uint8Array
|
|
113
|
+
// - major type 3 (text string) → string
|
|
114
|
+
// - major type 4 (array) → unknown[] (rare here, supported)
|
|
115
|
+
// - major type 5 (map) → Record<string, unknown>
|
|
116
|
+
// - major type 7: float16/32/64, true/false/null/undefined
|
|
117
|
+
//
|
|
118
|
+
// Indefinite-length and tagged values are not supported (DEROHE config forbids
|
|
119
|
+
// indefinite-length and only uses one tag for time, which Arguments doesn't carry
|
|
120
|
+
// through deroproof payloads).
|
|
121
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
122
|
+
class CborReader {
|
|
123
|
+
bytes;
|
|
124
|
+
offset = 0;
|
|
125
|
+
constructor(bytes) {
|
|
126
|
+
this.bytes = bytes;
|
|
127
|
+
}
|
|
128
|
+
readByte() {
|
|
129
|
+
if (this.offset >= this.bytes.length)
|
|
130
|
+
throw new Error('cbor: unexpected EOF');
|
|
131
|
+
return this.bytes[this.offset++];
|
|
132
|
+
}
|
|
133
|
+
readUint(extra) {
|
|
134
|
+
if (extra < 24)
|
|
135
|
+
return extra;
|
|
136
|
+
if (extra === 24)
|
|
137
|
+
return this.readByte();
|
|
138
|
+
if (extra === 25)
|
|
139
|
+
return (this.readByte() << 8) | this.readByte();
|
|
140
|
+
if (extra === 26) {
|
|
141
|
+
const a = this.readByte(), b = this.readByte(), c = this.readByte(), d = this.readByte();
|
|
142
|
+
return a * 0x1000000 + ((b << 16) | (c << 8) | d);
|
|
143
|
+
}
|
|
144
|
+
if (extra === 27) {
|
|
145
|
+
let v = 0n;
|
|
146
|
+
for (let i = 0; i < 8; i++)
|
|
147
|
+
v = (v << 8n) | BigInt(this.readByte());
|
|
148
|
+
return v <= BigInt(Number.MAX_SAFE_INTEGER) ? Number(v) : v;
|
|
149
|
+
}
|
|
150
|
+
throw new Error(`cbor: unsupported additional info ${extra}`);
|
|
151
|
+
}
|
|
152
|
+
readBytes(len) {
|
|
153
|
+
if (this.offset + len > this.bytes.length)
|
|
154
|
+
throw new Error('cbor: truncated byte string');
|
|
155
|
+
const out = this.bytes.slice(this.offset, this.offset + len);
|
|
156
|
+
this.offset += len;
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
read() {
|
|
160
|
+
const initial = this.readByte();
|
|
161
|
+
const major = initial >>> 5;
|
|
162
|
+
const extra = initial & 0x1f;
|
|
163
|
+
switch (major) {
|
|
164
|
+
case 0:
|
|
165
|
+
return this.readUint(extra);
|
|
166
|
+
case 1: {
|
|
167
|
+
const u = this.readUint(extra);
|
|
168
|
+
if (typeof u === 'bigint')
|
|
169
|
+
return -1n - u;
|
|
170
|
+
return -1 - u;
|
|
171
|
+
}
|
|
172
|
+
case 2: {
|
|
173
|
+
const len = this.readUint(extra);
|
|
174
|
+
if (typeof len === 'bigint')
|
|
175
|
+
throw new Error('cbor: byte string too large');
|
|
176
|
+
return this.readBytes(len);
|
|
177
|
+
}
|
|
178
|
+
case 3: {
|
|
179
|
+
const len = this.readUint(extra);
|
|
180
|
+
if (typeof len === 'bigint')
|
|
181
|
+
throw new Error('cbor: text string too large');
|
|
182
|
+
return new TextDecoder('utf-8').decode(this.readBytes(len));
|
|
183
|
+
}
|
|
184
|
+
case 4: {
|
|
185
|
+
const len = this.readUint(extra);
|
|
186
|
+
if (typeof len === 'bigint')
|
|
187
|
+
throw new Error('cbor: array too large');
|
|
188
|
+
const arr = [];
|
|
189
|
+
for (let i = 0; i < len; i++)
|
|
190
|
+
arr.push(this.read());
|
|
191
|
+
return arr;
|
|
192
|
+
}
|
|
193
|
+
case 5: {
|
|
194
|
+
const len = this.readUint(extra);
|
|
195
|
+
if (typeof len === 'bigint')
|
|
196
|
+
throw new Error('cbor: map too large');
|
|
197
|
+
const map = {};
|
|
198
|
+
for (let i = 0; i < len; i++) {
|
|
199
|
+
const k = this.read();
|
|
200
|
+
if (typeof k !== 'string') {
|
|
201
|
+
throw new Error(`cbor: map key must be string for DERO Arguments, got ${typeof k}`);
|
|
202
|
+
}
|
|
203
|
+
map[k] = this.read();
|
|
204
|
+
}
|
|
205
|
+
return map;
|
|
206
|
+
}
|
|
207
|
+
case 7: {
|
|
208
|
+
if (extra === 20)
|
|
209
|
+
return false;
|
|
210
|
+
if (extra === 21)
|
|
211
|
+
return true;
|
|
212
|
+
if (extra === 22)
|
|
213
|
+
return null;
|
|
214
|
+
if (extra === 23)
|
|
215
|
+
return undefined;
|
|
216
|
+
// floats are not used in deroproof arguments — bail explicitly.
|
|
217
|
+
throw new Error(`cbor: unsupported simple/float type (extra=${extra})`);
|
|
218
|
+
}
|
|
219
|
+
default:
|
|
220
|
+
throw new Error(`cbor: unsupported major type ${major}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
done() {
|
|
224
|
+
return this.offset >= this.bytes.length;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
export function cborDecode(bytes) {
|
|
228
|
+
const r = new CborReader(bytes);
|
|
229
|
+
const v = r.read();
|
|
230
|
+
// Trailing bytes are not expected in a DERO arguments payload.
|
|
231
|
+
return v;
|
|
232
|
+
}
|
|
233
|
+
const DATA_TYPE_LABEL = {
|
|
234
|
+
I: 'int64',
|
|
235
|
+
U: 'uint64',
|
|
236
|
+
S: 'string',
|
|
237
|
+
H: 'hash (32 bytes)',
|
|
238
|
+
A: 'address (33-byte compressed point)',
|
|
239
|
+
F: 'float64',
|
|
240
|
+
T: 'time',
|
|
241
|
+
};
|
|
242
|
+
/** Known DERO argument name conventions (subset; not exhaustive). */
|
|
243
|
+
const KNOWN_ARGUMENT_NAMES = {
|
|
244
|
+
V: 'RPC_VALUE_TRANSFER',
|
|
245
|
+
S: 'RPC_SOURCE_PORT',
|
|
246
|
+
D: 'RPC_DESTINATION_PORT',
|
|
247
|
+
C: 'RPC_COMMENT',
|
|
248
|
+
N: 'RPC_NEEDED_REPLY_BACK',
|
|
249
|
+
E: 'RPC_EXPIRY',
|
|
250
|
+
R: 'RPC_REPLYBACK_ADDRESS',
|
|
251
|
+
T: 'RPC_TRANSACTION_REASON',
|
|
252
|
+
};
|
|
253
|
+
const UINT64_MAX = (1n << 64n) - 1n;
|
|
254
|
+
const UINT64_SIGN_BIT = 1n << 63n;
|
|
255
|
+
/**
|
|
256
|
+
* Interpret a uint64 transfer value as both unsigned and signed-wraparound.
|
|
257
|
+
*
|
|
258
|
+
* DERO transfer amounts are stored as `uint64` atomic units (1 DERO = 100,000 atoms).
|
|
259
|
+
* A "negative" transfer is the wraparound of a huge unsigned value; this helper
|
|
260
|
+
* surfaces both views without taking a position on which is "correct" — that's
|
|
261
|
+
* what the cited rebuttal docs are for.
|
|
262
|
+
*/
|
|
263
|
+
export function interpretValueTransfer(value) {
|
|
264
|
+
if (value < 0n || value > UINT64_MAX) {
|
|
265
|
+
throw new Error(`uint64 out of range: ${value}`);
|
|
266
|
+
}
|
|
267
|
+
const isNegative = (value & UINT64_SIGN_BIT) !== 0n;
|
|
268
|
+
const signedAtoms = isNegative ? value - (1n << 64n) : value;
|
|
269
|
+
// Format signed DERO with 5 fractional digits.
|
|
270
|
+
const ATOMIC = 100000n;
|
|
271
|
+
const abs = signedAtoms < 0n ? -signedAtoms : signedAtoms;
|
|
272
|
+
const whole = abs / ATOMIC;
|
|
273
|
+
const frac = abs % ATOMIC;
|
|
274
|
+
const sign = signedAtoms < 0n ? '-' : '';
|
|
275
|
+
const dero = `${sign}${whole.toString()}.${frac.toString().padStart(5, '0')}`;
|
|
276
|
+
return {
|
|
277
|
+
uint64: value.toString(),
|
|
278
|
+
signed_int64: signedAtoms.toString(),
|
|
279
|
+
is_negative_wraparound: isNegative,
|
|
280
|
+
signed_atoms: signedAtoms.toString(),
|
|
281
|
+
dero,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
function parseArgumentEntry(rawKey, rawValue) {
|
|
285
|
+
if (rawKey.length < 2) {
|
|
286
|
+
throw new Error(`invalid argument key "${rawKey}" (must be ≥2 chars: name + type)`);
|
|
287
|
+
}
|
|
288
|
+
const type = rawKey[rawKey.length - 1];
|
|
289
|
+
const name = rawKey.slice(0, -1);
|
|
290
|
+
const typeLabel = DATA_TYPE_LABEL[type] ?? `unknown(${type})`;
|
|
291
|
+
const semanticName = KNOWN_ARGUMENT_NAMES[name];
|
|
292
|
+
let value;
|
|
293
|
+
switch (type) {
|
|
294
|
+
case 'U': {
|
|
295
|
+
// CBOR yields number or bigint; normalize to bigint so callers don't lose precision.
|
|
296
|
+
if (typeof rawValue === 'bigint')
|
|
297
|
+
value = rawValue;
|
|
298
|
+
else if (typeof rawValue === 'number')
|
|
299
|
+
value = BigInt(rawValue);
|
|
300
|
+
else
|
|
301
|
+
throw new Error(`argument "${rawKey}" expected uint64, got ${typeof rawValue}`);
|
|
302
|
+
break;
|
|
303
|
+
}
|
|
304
|
+
case 'I': {
|
|
305
|
+
if (typeof rawValue === 'bigint')
|
|
306
|
+
value = rawValue;
|
|
307
|
+
else if (typeof rawValue === 'number')
|
|
308
|
+
value = BigInt(rawValue);
|
|
309
|
+
else
|
|
310
|
+
throw new Error(`argument "${rawKey}" expected int64, got ${typeof rawValue}`);
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
case 'S': {
|
|
314
|
+
if (typeof rawValue !== 'string') {
|
|
315
|
+
throw new Error(`argument "${rawKey}" expected string, got ${typeof rawValue}`);
|
|
316
|
+
}
|
|
317
|
+
value = rawValue;
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
case 'H': {
|
|
321
|
+
if (!(rawValue instanceof Uint8Array)) {
|
|
322
|
+
throw new Error(`argument "${rawKey}" expected byte string for hash, got ${typeof rawValue}`);
|
|
323
|
+
}
|
|
324
|
+
value = bytesToHex(rawValue);
|
|
325
|
+
break;
|
|
326
|
+
}
|
|
327
|
+
case 'A': {
|
|
328
|
+
if (!(rawValue instanceof Uint8Array)) {
|
|
329
|
+
throw new Error(`argument "${rawKey}" expected byte string for address, got ${typeof rawValue}`);
|
|
330
|
+
}
|
|
331
|
+
// 33-byte compressed point; surface as hex (re-encoding to bech32 needs network context).
|
|
332
|
+
value = bytesToHex(rawValue);
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
case 'F':
|
|
336
|
+
case 'T':
|
|
337
|
+
default:
|
|
338
|
+
value = rawValue;
|
|
339
|
+
}
|
|
340
|
+
return {
|
|
341
|
+
name,
|
|
342
|
+
type,
|
|
343
|
+
type_label: typeLabel,
|
|
344
|
+
...(semanticName ? { semantic_name: semanticName } : {}),
|
|
345
|
+
value: typeof value === 'bigint' ? value.toString() : value,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
function bytesToHex(bytes) {
|
|
349
|
+
let hex = '';
|
|
350
|
+
for (const b of bytes)
|
|
351
|
+
hex += b.toString(16).padStart(2, '0');
|
|
352
|
+
return hex;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Decode a full `deroproof…` / `dero…` / `deroi…` / `deto…` / `detoi…` bech32 string.
|
|
356
|
+
*
|
|
357
|
+
* Mirrors `rpc.NewAddress` from DEROHE: validates HRP, runs 5→8 bit repack,
|
|
358
|
+
* checks version byte, splits compressed point + (optional) CBOR arguments.
|
|
359
|
+
*/
|
|
360
|
+
export function decodeDeroBech32(input) {
|
|
361
|
+
const { hrp, data } = bech32Decode(input.trim());
|
|
362
|
+
const validHrps = ['dero', 'deto', 'deroi', 'detoi', 'deroproof'];
|
|
363
|
+
if (!validHrps.includes(hrp)) {
|
|
364
|
+
throw new Error(`invalid HRP "${hrp}" (expected one of ${validHrps.join(', ')})`);
|
|
365
|
+
}
|
|
366
|
+
// 5-bit → 8-bit (no pad), per DEROHE.
|
|
367
|
+
const repacked = convertBits(data, 5, 8, false);
|
|
368
|
+
if (repacked.length < 1)
|
|
369
|
+
throw new Error('decoded payload too short for version byte');
|
|
370
|
+
if (repacked[0] !== 1)
|
|
371
|
+
throw new Error(`invalid address version: ${repacked[0]} (expected 1)`);
|
|
372
|
+
const body = repacked.slice(1);
|
|
373
|
+
if (body.length < 33) {
|
|
374
|
+
throw new Error(`decoded payload too short for compressed point: ${body.length} < 33 bytes`);
|
|
375
|
+
}
|
|
376
|
+
const pointBytes = new Uint8Array(body.slice(0, 33));
|
|
377
|
+
const argBytes = new Uint8Array(body.slice(33));
|
|
378
|
+
const publicKeyHex = bytesToHex(pointBytes);
|
|
379
|
+
const mainnet = hrp === 'dero' || hrp === 'deroi' || hrp === 'deroproof';
|
|
380
|
+
const isProof = hrp === 'deroproof';
|
|
381
|
+
// Plain `dero` / `deto` have no arguments. `deroi` / `detoi` / `deroproof` always do.
|
|
382
|
+
const hasArguments = hrp === 'deroi' || hrp === 'detoi' || hrp === 'deroproof';
|
|
383
|
+
const args = [];
|
|
384
|
+
if (hasArguments) {
|
|
385
|
+
if (argBytes.length === 0) {
|
|
386
|
+
// Some integrated addresses can carry zero-length arguments; treat as empty map.
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
const decoded = cborDecode(argBytes);
|
|
390
|
+
if (typeof decoded !== 'object' || decoded === null || Array.isArray(decoded)) {
|
|
391
|
+
throw new Error(`CBOR root must be a map, got ${typeof decoded}`);
|
|
392
|
+
}
|
|
393
|
+
for (const [k, v] of Object.entries(decoded)) {
|
|
394
|
+
args.push(parseArgumentEntry(k, v));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const valueTransfer = args.find((a) => a.name === 'V' && a.type === 'U');
|
|
399
|
+
return {
|
|
400
|
+
hrp: hrp,
|
|
401
|
+
mainnet,
|
|
402
|
+
is_proof: isProof,
|
|
403
|
+
public_key_hex: publicKeyHex,
|
|
404
|
+
arguments: args,
|
|
405
|
+
...(valueTransfer ? { value_transfer_uint64: BigInt(valueTransfer.value) } : {}),
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
409
|
+
// Encoders — bech32 + deterministic CBOR
|
|
410
|
+
//
|
|
411
|
+
// Inverse of the decoder block above. Two responsibilities:
|
|
412
|
+
// 1. bech32Encode(hrp, 5-bit data) — checksum + charset mapping (BIP-0173).
|
|
413
|
+
// 2. cborEncode(value) — minimal canonical CBOR for what DERO actually
|
|
414
|
+
// serializes in deroproof argument maps. DEROHE uses
|
|
415
|
+
// cbor.SortCoreDeterministic, so we must:
|
|
416
|
+
// - encode every integer in shortest form
|
|
417
|
+
// - sort map keys by encoded-key bytes (length, then lex)
|
|
418
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
419
|
+
function bech32CreateChecksum(hrp, data) {
|
|
420
|
+
const values = [...bech32HrpExpand(hrp), ...data, 0, 0, 0, 0, 0, 0];
|
|
421
|
+
const polymod = bech32Polymod(values) ^ 1;
|
|
422
|
+
const out = [];
|
|
423
|
+
for (let i = 0; i < 6; i++)
|
|
424
|
+
out.push((polymod >>> (5 * (5 - i))) & 31);
|
|
425
|
+
return out;
|
|
426
|
+
}
|
|
427
|
+
/** Encode HRP + 5-bit data array to a bech32 string. Inverse of `bech32Decode`. */
|
|
428
|
+
export function bech32Encode(hrp, data) {
|
|
429
|
+
const checksum = bech32CreateChecksum(hrp, data);
|
|
430
|
+
const combined = [...data, ...checksum];
|
|
431
|
+
let out = hrp + '1';
|
|
432
|
+
for (const v of combined) {
|
|
433
|
+
if (v < 0 || v >= 32)
|
|
434
|
+
throw new Error(`bech32Encode: value out of range ${v}`);
|
|
435
|
+
out += BECH32_CHARSET[v];
|
|
436
|
+
}
|
|
437
|
+
return out;
|
|
438
|
+
}
|
|
439
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
440
|
+
// CBOR encoder
|
|
441
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
442
|
+
/** Encode `value` as CBOR head (major type + length/value). Always shortest form. */
|
|
443
|
+
function cborEncodeHead(major, value) {
|
|
444
|
+
const mt = major << 5;
|
|
445
|
+
if (value < 0n)
|
|
446
|
+
throw new Error(`cborEncodeHead: negative value ${value}`);
|
|
447
|
+
if (value < 24n)
|
|
448
|
+
return new Uint8Array([mt | Number(value)]);
|
|
449
|
+
if (value < 1n << 8n)
|
|
450
|
+
return new Uint8Array([mt | 24, Number(value)]);
|
|
451
|
+
if (value < 1n << 16n) {
|
|
452
|
+
const v = Number(value);
|
|
453
|
+
return new Uint8Array([mt | 25, (v >>> 8) & 0xff, v & 0xff]);
|
|
454
|
+
}
|
|
455
|
+
if (value < 1n << 32n) {
|
|
456
|
+
const v = Number(value);
|
|
457
|
+
return new Uint8Array([mt | 26, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff]);
|
|
458
|
+
}
|
|
459
|
+
if (value < 1n << 64n) {
|
|
460
|
+
const out = new Uint8Array(9);
|
|
461
|
+
out[0] = mt | 27;
|
|
462
|
+
let v = value;
|
|
463
|
+
for (let i = 8; i >= 1; i--) {
|
|
464
|
+
out[i] = Number(v & 0xffn);
|
|
465
|
+
v >>= 8n;
|
|
466
|
+
}
|
|
467
|
+
return out;
|
|
468
|
+
}
|
|
469
|
+
throw new Error(`cborEncodeHead: value out of uint64 range ${value}`);
|
|
470
|
+
}
|
|
471
|
+
function concatBytes(parts) {
|
|
472
|
+
let total = 0;
|
|
473
|
+
for (const p of parts)
|
|
474
|
+
total += p.length;
|
|
475
|
+
const out = new Uint8Array(total);
|
|
476
|
+
let offset = 0;
|
|
477
|
+
for (const p of parts) {
|
|
478
|
+
out.set(p, offset);
|
|
479
|
+
offset += p.length;
|
|
480
|
+
}
|
|
481
|
+
return out;
|
|
482
|
+
}
|
|
483
|
+
/** Compare two byte sequences lexicographically (shorter first, then bytewise). */
|
|
484
|
+
function compareCanonicalKeys(a, b) {
|
|
485
|
+
if (a.length !== b.length)
|
|
486
|
+
return a.length - b.length;
|
|
487
|
+
for (let i = 0; i < a.length; i++) {
|
|
488
|
+
if (a[i] !== b[i])
|
|
489
|
+
return a[i] - b[i];
|
|
490
|
+
}
|
|
491
|
+
return 0;
|
|
492
|
+
}
|
|
493
|
+
/** Deterministic-CBOR encode a value (RFC 8949 core deterministic). */
|
|
494
|
+
export function cborEncode(value) {
|
|
495
|
+
if (value === null)
|
|
496
|
+
return new Uint8Array([0xf6]);
|
|
497
|
+
if (value === true)
|
|
498
|
+
return new Uint8Array([0xf5]);
|
|
499
|
+
if (value === false)
|
|
500
|
+
return new Uint8Array([0xf4]);
|
|
501
|
+
if (typeof value === 'bigint' || typeof value === 'number') {
|
|
502
|
+
const big = typeof value === 'bigint' ? value : BigInt(value);
|
|
503
|
+
if (big < 0n) {
|
|
504
|
+
// major type 1: negative integer, value = -1 - n → encode n.
|
|
505
|
+
const n = -1n - big;
|
|
506
|
+
return cborEncodeHead(1, n);
|
|
507
|
+
}
|
|
508
|
+
return cborEncodeHead(0, big);
|
|
509
|
+
}
|
|
510
|
+
if (typeof value === 'string') {
|
|
511
|
+
const utf8 = new TextEncoder().encode(value);
|
|
512
|
+
return concatBytes([cborEncodeHead(3, BigInt(utf8.length)), utf8]);
|
|
513
|
+
}
|
|
514
|
+
if (value instanceof Uint8Array) {
|
|
515
|
+
return concatBytes([cborEncodeHead(2, BigInt(value.length)), value]);
|
|
516
|
+
}
|
|
517
|
+
if (Array.isArray(value)) {
|
|
518
|
+
const parts = [cborEncodeHead(4, BigInt(value.length))];
|
|
519
|
+
for (const item of value)
|
|
520
|
+
parts.push(cborEncode(item));
|
|
521
|
+
return concatBytes(parts);
|
|
522
|
+
}
|
|
523
|
+
if (typeof value === 'object') {
|
|
524
|
+
const entries = Object.entries(value).map(([k, v]) => [cborEncode(k), cborEncode(v)]);
|
|
525
|
+
entries.sort((a, b) => compareCanonicalKeys(a[0], b[0]));
|
|
526
|
+
const parts = [cborEncodeHead(5, BigInt(entries.length))];
|
|
527
|
+
for (const [k, v] of entries) {
|
|
528
|
+
parts.push(k);
|
|
529
|
+
parts.push(v);
|
|
530
|
+
}
|
|
531
|
+
return concatBytes(parts);
|
|
532
|
+
}
|
|
533
|
+
throw new Error(`cborEncode: unsupported value type ${typeof value}`);
|
|
534
|
+
}
|
|
535
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
536
|
+
// High-level deroproof / deroi encoder
|
|
537
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
538
|
+
function hexToBytesLocal(hex) {
|
|
539
|
+
if (hex.length % 2 !== 0)
|
|
540
|
+
throw new Error(`hex: odd length ${hex.length}`);
|
|
541
|
+
const out = new Uint8Array(hex.length / 2);
|
|
542
|
+
for (let i = 0; i < out.length; i++) {
|
|
543
|
+
out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
544
|
+
}
|
|
545
|
+
return out;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Build a `deroproof…` / `deroi…` / `detoi…` bech32 string from a compressed
|
|
549
|
+
* public-key point (the embedded blinder, for proofs) and a typed argument map.
|
|
550
|
+
*
|
|
551
|
+
* Arguments are passed as a plain object whose keys are `Name + DataType`
|
|
552
|
+
* (e.g. `HH` for hash, `VU` for uint64 value transfer). Values are typed:
|
|
553
|
+
* - `U` / `I`: bigint
|
|
554
|
+
* - `H` / `A`: Uint8Array (32 bytes for hash, 33 for address)
|
|
555
|
+
* - `S`: string
|
|
556
|
+
*/
|
|
557
|
+
export function encodeDeroBech32(hrp, pointBytes33, args) {
|
|
558
|
+
if (pointBytes33.length !== 33) {
|
|
559
|
+
throw new Error(`encodeDeroBech32: point must be 33 bytes, got ${pointBytes33.length}`);
|
|
560
|
+
}
|
|
561
|
+
const wantsArgs = hrp === 'deroi' || hrp === 'detoi' || hrp === 'deroproof';
|
|
562
|
+
const argBytes = wantsArgs && args ? cborEncode(args) : new Uint8Array(0);
|
|
563
|
+
const body = new Uint8Array(1 + 33 + argBytes.length);
|
|
564
|
+
body[0] = 1; // version
|
|
565
|
+
body.set(pointBytes33, 1);
|
|
566
|
+
body.set(argBytes, 34);
|
|
567
|
+
const data5 = convertBits(Array.from(body), 8, 5, true);
|
|
568
|
+
return bech32Encode(hrp, data5);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Build a deroproof string for a forged amount. Convenience wrapper around
|
|
572
|
+
* `encodeDeroBech32` that handles the canonical `{HH, VU}` arg shape.
|
|
573
|
+
*
|
|
574
|
+
* HH = 32 zero bytes (the docs forge code uses `crypto.Hash{}` here)
|
|
575
|
+
* VU = uint64 amount
|
|
576
|
+
*/
|
|
577
|
+
export function encodeForgeProofString(blinderCompressed33, amountUint64, hrp = 'deroproof') {
|
|
578
|
+
if (amountUint64 < 0n || amountUint64 >= 1n << 64n) {
|
|
579
|
+
throw new Error(`encodeForgeProofString: amount out of uint64 range ${amountUint64}`);
|
|
580
|
+
}
|
|
581
|
+
return encodeDeroBech32(hrp, blinderCompressed33, {
|
|
582
|
+
HH: new Uint8Array(32),
|
|
583
|
+
VU: amountUint64,
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
587
|
+
// Round-trip self-tests
|
|
588
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
589
|
+
/** Citation: the 2022 inflation-claim payload proof. Used by self-tests. */
|
|
590
|
+
export const CITED_2022_PROOF_STRING = 'deroproof1qyyj0cgu3htmkumr79sgca75vwsx8kx7zkrjg0nfez46w36qyx4kwq9zvfyyskpqvdpcfhkhk4m7y9d77ehyj7yhnnrv9z0tjr9m5fqe2yx9t27dwtdxy4j4r0llll7vcmaxwjcl8jzfq';
|
|
591
|
+
/**
|
|
592
|
+
* Decode the cited 2022 proof string, re-encode it with the **same decoded
|
|
593
|
+
* arguments** (the real H hash, not zeros), and confirm byte-equal output.
|
|
594
|
+
*
|
|
595
|
+
* If this fails, the encoder is not faithful to DERO's canonical CBOR + bech32
|
|
596
|
+
* wire format and forging anything else is unsafe to surface.
|
|
597
|
+
*
|
|
598
|
+
* (The forge path defaults H to 32 zero bytes — see `encodeForgeProofString`.
|
|
599
|
+
* That's correct for the docs-page demo but would not reproduce a real
|
|
600
|
+
* wallet-generated proof, which has a real shared-key hash in H.)
|
|
601
|
+
*/
|
|
602
|
+
export function verifyProofEncoderRoundtrip() {
|
|
603
|
+
const decoded = decodeDeroBech32(CITED_2022_PROOF_STRING);
|
|
604
|
+
if (decoded.value_transfer_uint64 === undefined) {
|
|
605
|
+
throw new Error('roundtrip: cited 2022 proof missing V — decoder regression');
|
|
606
|
+
}
|
|
607
|
+
const hArg = decoded.arguments.find((a) => a.name === 'H' && a.type === 'H');
|
|
608
|
+
if (!hArg)
|
|
609
|
+
throw new Error('roundtrip: cited 2022 proof missing H — decoder regression');
|
|
610
|
+
const point = hexToBytesLocal(decoded.public_key_hex);
|
|
611
|
+
const reencoded = encodeDeroBech32('deroproof', point, {
|
|
612
|
+
HH: hexToBytesLocal(hArg.value),
|
|
613
|
+
VU: decoded.value_transfer_uint64,
|
|
614
|
+
});
|
|
615
|
+
if (reencoded !== CITED_2022_PROOF_STRING) {
|
|
616
|
+
throw new Error(`roundtrip: cited 2022 proof mismatch\n in: ${CITED_2022_PROOF_STRING}\n out: ${reencoded}`);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
//# sourceMappingURL=proof-decode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proof-decode.js","sourceRoot":"","sources":["../src/proof-decode.ts"],"names":[],"mappings":"AAAA;;;;;;;;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AAG,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE;QACrD,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,KAAe,CAAC;QACzC,EAAE,EAAE,OAAO,CAAC,qBAAqB;KAClC,CAAC,CAAA;IACF,IAAI,SAAS,KAAK,uBAAuB,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CACb,gDAAgD,uBAAuB,YAAY,SAAS,EAAE,CAC/F,CAAA;IACH,CAAC;AACH,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AA2SnE,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAs2BpE"}
|