## Usage
-#### ⚠️ The examples below should never be used for real transactions! ⚠️
+⚠️ **The examples below should never be used for real transactions!** ⚠️
### Wallets and accounts
"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");
```
"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
If you find this library helpful, please consider tipping the developer.
-```
-nano_1zosoqs47yt47bnfg7sdf46kj7asn58b7uzm9ek95jw7ccatq37898u1zoso
-```
+`nano_1zosoqs47yt47bnfg7sdf46kj7asn58b7uzm9ek95jw7ccatq37898u1zoso`