Skip to content

Commit cd3f041

Browse files
Merge branch 'release/v1.0.33'
2 parents 868a0ff + fa60d82 commit cd3f041

18 files changed

+1699
-2287
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,24 @@ COLDCARD copy correctly derives the seed but then generates addresses from a dif
130130
``` shell_session cSpell:disable
131131
$ npx verify-coldcard-dice-seed@latest
132132
Need to install the following packages:
133-
verify-coldcard-dice-seed@1.0.32
133+
verify-coldcard-dice-seed@1.0.33
134134
Ok to proceed? (y) y
135-
*** Verify COLDCARD Dice Seed v1.0.32 ***
136-
(tested with COLDCARD Mk4 firmware v5.2.2)
135+
*** Verify COLDCARD Dice Seed v1.0.33 ***
136+
(tested with COLDCARD Mk4 firmware v5.3.1)
137137
138138
This application guides you through verifying that your COLDCARD
139139
correctly derives seeds and addresses from dice rolls.
140140
141141
CAUTION: The very point of a COLDCARD is that the seed of a real wallet
142-
is never entered outside of a coldcard. You should therefore only use
143-
this application to verify the seed and address derivation of your
144-
COLDCARD. Once you are convinced that your COLDCARD works correctly, you
145-
should then generate the seed of your real wallet on your COLDCARD only.
142+
*never* appears on any other device. You should therefore only use this
143+
application to verify the seed and address derivation of your COLDCARD.
144+
Once you are convinced that your COLDCARD works correctly, you should
145+
then generate the seed of your real wallet on your COLDCARD only.
146146
147147
Generate 24 instead of the standard 12 words [y, N]?
148148
149-
Log into your COLDCARD, select 'New Seed Words', '12 Word Dice Roll'.
149+
Log into your COLDCARD, select 'New Seed Words', 'Advanced',
150+
'12 Word Dice Roll'.
150151
Press any key to continue or CTRL-C to abort:
151152
152153
To perform a realistic test you should enter exactly as many dice rolls

package-lock.json

Lines changed: 1562 additions & 2094 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "verify-coldcard-dice-seed",
3-
"version": "1.0.32",
3+
"version": "1.0.33",
44
"description": "Verify whether your COLDCARD correctly generates seeds and addresses from dice rolls.",
55
"keywords": [
66
"bitcoin",
@@ -40,9 +40,9 @@
4040
"preview": "vite build && vite preview --open",
4141
"prelint": "cspell '**' && markdownlint '**/*.md'",
4242
"lint": "eslint --ext .cjs,.ts,.tsx --report-unused-disable-directives '.'",
43-
"build": "tsc -p './tsconfig.json' && tsc -p './src/package/tsconfig.json' && tsc -p './src/site/tsconfig.json' && tsc -p './scripts/tsconfig.json'",
43+
"build": "tsc -p '.' && tsc -p './src/package' && tsc -p './src/site' && tsc -p './scripts'",
4444
"postbuild": "vite build",
45-
"test-no-coverage": "node --import tsx --test src/common/*.spec.ts src/site/*.spec.ts",
45+
"test-no-coverage": "node --import tsx --test src/common/*.spec.ts",
4646
"test-no-coverage-built": "node --test dist/common/*.spec.js",
4747
"test": "c8 --exclude 'src/common/*.spec.ts' --reporter=text --reporter=lcov npm run test-no-coverage",
4848
"test-built": "c8 --exclude 'dist/common/*.spec.js' --reporter=text --reporter=lcov npm run test-no-coverage-built",
@@ -62,22 +62,23 @@
6262
"tslib": "^2.6.2"
6363
},
6464
"devDependencies": {
65-
"@andreashuber69/eslint-config": "^1.2.6",
65+
"@andreashuber69/eslint-config": "^1.2.20",
6666
"@picocss/pico": "^1.5.13",
6767
"@preact/preset-vite": "^2.8.2",
6868
"@tsconfig/node20": "^20.1.4",
6969
"@tsconfig/strictest": "^2.0.5",
70-
"@types/node": "^20.11.30",
70+
"@types/node": "^20.14.1",
7171
"c8": "^9.1.0",
7272
"coveralls": "^3.1.1",
73-
"cspell": "^8.6.1",
74-
"markdownlint-cli": "^0.39.0",
73+
"cspell": "^8.8.4",
74+
"kiss-worker": "^3.1.0",
75+
"markdownlint-cli": "^0.41.0",
7576
"node-fetch": "^3.3.2",
76-
"preact": "^10.20.1",
77-
"tsx": "^4.7.1",
78-
"typescript": "^5.4.3",
79-
"vite": "^5.2.6",
80-
"vite-plugin-node-polyfills": "^0.21.0",
77+
"preact": "^10.22.0",
78+
"tsx": "^4.11.2",
79+
"typescript": "^5.4.5",
80+
"vite": "^5.2.12",
81+
"vite-plugin-node-polyfills": "^0.22.0",
8182
"vite-plugin-wasm": "^3.3.0"
8283
}
8384
}

src/package/InOut.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
// https://github.com/andreashuber69/verify-coldcard-dice-seed/blob/develop/README.md#----verify-coldcard-dice-seed
2+
import type EventEmitter from "node:events";
3+
24
type GenericOut<T extends keyof NodeJS.WriteStream> = Pick<NodeJS.WriteStream, T>;
35

46
export interface GenericInOut<T, U> {
57
readonly stdin: T;
68
readonly stdout: U;
79
}
810

9-
export type In = Pick<NodeJS.ReadStream, "once" | "pause" | "resume">;
11+
export type In = EventEmitter & Pick<NodeJS.ReadStream, "pause" | "resume">;
1012

1113
export type InOut = GenericInOut<In, GenericOut<"write">>;
1214

src/package/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ try {
2727
stdin.setEncoding("utf8");
2828

2929
stdout.write(`*** Verify COLDCARD Dice Seed v${version} ***\r\n`);
30-
stdout.write("(tested with COLDCARD Mk4 firmware v5.2.2)\r\n");
30+
stdout.write("(tested with COLDCARD Mk4 firmware v5.3.1)\r\n");
3131
stdout.write("\r\n");
3232
stdout.write("This application guides you through verifying that your COLDCARD\r\n");
3333
stdout.write("correctly derives seeds and addresses from dice rolls.\r\n");
@@ -42,7 +42,8 @@ try {
4242
const generate24WordsPrompt = "Generate 24 instead of the standard 12 words [y, N]? ";
4343
const generate24Words = (await waitForUser({ stdin, stdout }, generate24WordsPrompt)).toLocaleLowerCase() === "y";
4444
const wordCount = generate24Words ? 24 : 12;
45-
stdout.write(`Log into your COLDCARD, select 'New Seed Words', '${wordCount} Word Dice Roll'.\r\n`);
45+
stdout.write("Log into your COLDCARD, select 'New Seed Words', 'Advanced',\r\n");
46+
stdout.write(`'${wordCount} Word Dice Roll'.\r\n`);
4647
await waitForUser(process);
4748
const words = await verifyWords(process, await readDiceRolls(process, generate24Words), wordCount);
4849
let currentPassphrase = "";

src/site/AddressSection.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// https://github.com/andreashuber69/verify-coldcard-dice-seed/blob/develop/README.md#----verify-coldcard-dice-seed
2+
import { useEffect, useState } from "preact/hooks";
3+
import { getAddresses } from "./getAddresses.js";
4+
5+
interface AddressSectionProps {
6+
readonly mnemonic: readonly string[];
7+
readonly passphrase: string;
8+
readonly account: number;
9+
readonly change: boolean;
10+
}
11+
12+
export const AddressSection = ({ mnemonic, passphrase, account, change }: AddressSectionProps) => {
13+
const [addresses, setAddresses] = useState<ReadonlyArray<readonly [string, string]>>([]);
14+
const accountRootPath = `m/84'/0'/${account}'/${change ? 1 : 0}`;
15+
16+
useEffect(
17+
() => {
18+
const doIt = async () => setAddresses(
19+
await getAddresses(mnemonic, passphrase, accountRootPath),
20+
);
21+
22+
void doIt();
23+
},
24+
[mnemonic, passphrase, accountRootPath],
25+
);
26+
27+
return (
28+
<section>
29+
<h2>{change ? "Change" : "Receive"} Addresses</h2>
30+
<div className="monospace">
31+
{addresses.map(([p, a]) => <div key={p} className="grid"><span>{`${p} => ${a}`}</span></div>)}
32+
</div>
33+
</section>
34+
);
35+
};

src/site/Addresses.tsx

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/site/GetAddressesParams.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/site/PromiseQueue.spec.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/site/PromiseQueue.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)