v1.48.0: auditoría en frío, parche 1 — guarda de red única, secretos en todos los campos, garantías sin comprobar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5npnUYgSPkAaHkdaeUqBr
This commit is contained in:
2026-10-25 18:11:08 +01:00
co-authored by Claude Opus 5.5
parent 541bdcb958
commit b7856c7b91
30 changed files with 559 additions and 60 deletions
+4 -2
View File
@@ -14,7 +14,8 @@ const cut = (desde, hasta) => {
if (s === -1 || e === -1) { console.error(`No se localiza ${desde}`); process.exit(1); }
return lines.slice(s, e).join("\n");
};
const Q = new Function(`${cut("// ── QR: lógica pura", "// ── fin QR")}
const Q = new Function(`${cut("// ── Lista oficial de palabras BIP-39", "// ── fin BIP-39")}
${cut("// ── QR: lógica pura", "// ── fin QR")}
return { clasificarQR, encajaQR, pareceSecretoQR, textoDeBytesQR };`)();
let pass = 0, fail = 0;
@@ -52,7 +53,8 @@ ok("xpub suelta", tipo(ZPUB) === "xpub");
const r = Q.clasificarQR(`[73c5da0a/84h/0h/0h]${ZPUB}`);
ok("xpub estática de SeedSigner: [huella/ruta]zpub", r.tipo === "xpub" && r.valor === ZPUB && r.huella === "73c5da0a" && r.ruta === "m/84h/0h/0h", JSON.stringify(r));
}
ok("xpub dentro de un descriptor", Q.clasificarQR(`wpkh([73c5da0a/84h/0h/0h]${ZPUB}/0/*)`).valor === ZPUB);
ok("descriptor por QR: se entrega ENTERO (A2-02), con la xpub aparte", Q.clasificarQR(`wpkh([73c5da0a/84h/0h/0h]${ZPUB}/0/*)#abcdefgh`).valor === `wpkh([73c5da0a/84h/0h/0h]${ZPUB}/0/*)#abcdefgh` && Q.clasificarQR(`wpkh([73c5da0a/84h/0h/0h]${ZPUB}/0/*)`).xpub === ZPUB);
ok("descriptor por QR con el comentario de Sparrow: se quita la línea #", Q.clasificarQR(`# Receive and change descriptor:\nwpkh([73c5da0a/84h/0h/0h]${ZPUB}/<0;1>/*)`).valor === `wpkh([73c5da0a/84h/0h/0h]${ZPUB}/<0;1>/*)`);
ok("PSBT en base64", tipo(PSBT) === "psbt");
ok("transacción en crudo", tipo("0200000001" + "ab".repeat(80)) === "tx");
ok("QR animado UR (crypto-psbt)", Q.clasificarQR("UR:CRYPTO-PSBT/1-3/LPADAXCSOEDTHY").urTipo === "crypto-psbt");