]> git.codecow.com Git - libnemo.git/commitdiff
Fix markdown linted issues.
authorChris Duncan <chris@zoso.dev>
Wed, 15 Apr 2026 08:33:53 +0000 (01:33 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 15 Apr 2026 08:33:53 +0000 (01:33 -0700)
README.md

index 80c83ddab02a6da857d203f1b3e83158f8ec63e7..6ca67b2671ad9d3f101500a24460eb2e30eef164 100644 (file)
--- 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): <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>
 
 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`