From: Chris Duncan Date: Wed, 15 Apr 2026 08:33:53 +0000 (-0700) Subject: Fix markdown linted issues. X-Git-Tag: v0.12.0~4^2~8 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=6659183aa63f93408a367b5094bbf0251f329ffc;p=libnemo.git Fix markdown linted issues. --- diff --git a/README.md b/README.md index 80c83dd..6ca67b2 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ npm install libnemo ## Usage -#### ⚠️ The examples below should never be used for real transactions! ⚠️ +⚠️ **The examples below should never be used for real transactions!** ⚠️ ### Wallets and accounts @@ -325,7 +325,8 @@ const privateKey = "3BE4FC2EF3F3B7374E6FC4FB6E7BB153F8A2998B3B3DAB50853EABE128024143"; const publicKey = "5B65B0E8173EE0802C2C3E6C9080D1A16B06DE1176C938A924F58670904E82C4"; -const signature = await Tools.sign(privateKey, "johndoe@example.com"); +const secretKey = privateKey + publicKey; +const signature = await Tools.sign(secretKey, "johndoe@example.com"); const isValid = await Tools.verify(publicKey, signature, "johndoe@example.com"); ``` @@ -340,26 +341,27 @@ const address = "nano_1pu7p5n3ghq1i1p4rhmek41f5add1uh34xpb94nkbxe8g4a6x1p69emk8y1d"; const privateKey = "3BE4FC2EF3F3B7374E6FC4FB6E7BB153F8A2998B3B3DAB50853EABE128024143"; -const randomData = crypto.getRandomValues(new Uint8Array(32)); - -const signature = await Tools.sign(privateKey, ...randomData); const publicKey = new Account(address).publicKey; -const isValid = await Tools.verify(publicKey, signature, ...randomData); +const secretKey = privateKey + publicKey; + +const nonce = crypto.randomUUID(); +const signature = await Tools.sign(secretKey, nonce); +const isValid = await Tools.verify(publicKey, signature, nonce); ``` ## Tests Test vectors were retrieved from the following publicly-available locations: -- Nano (BIP-44): https://docs.nano.org/integration-guides/key-management/#test-vectors -- Trezor (BIP-39): https://github.com/trezor/python-mnemonic/blob/master/vectors.json -- BIP-32: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#user-content-Test_Vectors +- Nano (BIP-44): +- Trezor (BIP-39): +- BIP-32: Another set of test vectors were created for libnemo based on the Trezor set. These extra test vectors were generated purely to test uncommon yet valid mnemonic phrase lengths like 15 or 18 words. -#### ⚠️ The test vectors should never be used for real transactions! ⚠️ +⚠️ **The test vectors should never be used for real transactions!** ⚠️ ## Building @@ -374,6 +376,4 @@ mnemonic phrase lengths like 15 or 18 words. If you find this library helpful, please consider tipping the developer. -``` -nano_1zosoqs47yt47bnfg7sdf46kj7asn58b7uzm9ek95jw7ccatq37898u1zoso -``` +`nano_1zosoqs47yt47bnfg7sdf46kj7asn58b7uzm9ek95jw7ccatq37898u1zoso`