]> git.codecow.com Git - libnemo.git/commitdiff
v0.12.0 v0.12.0
authorChris Duncan <chris@zoso.dev>
Sat, 25 Apr 2026 07:31:53 +0000 (00:31 -0700)
committerChris Duncan <chris@zoso.dev>
Sat, 25 Apr 2026 07:31:53 +0000 (00:31 -0700)
CHANGELOG.md
package-lock.json
package.json

index e65c08c61af255a6f0e26951ac1fc0cee89b87c2..086fe9e484a068e854f0c6c63b405cca27f2077a 100644 (file)
@@ -5,6 +5,67 @@ SPDX-License-Identifier: GPL-3.0-or-later
 
 # Changelog
 
+## v0.12.0
+
+### Notable Changes
+
+#### Sign arbitrary data directly
+
+Previously, the process that `libnemo` followed in order to sign arbitrary data,
+represented as one or more strings, was to first hash them all using BLAKE2b and
+outputting a 32-byte digest. However, `nano25519` interally already hashes the
+message input using BLAKE2b anyway, and it seemed inconsistent to claim the API
+support signing arbitrary data when it is in fact signing a hash of the data.
+
+Now, the input data is treated as UTF-8 strings and encoded to bytes using the
+browser built-in `TextEncoder` class, and then it is passed directly to
+`nano25519` for signing without hashing.
+
+#### Refactored Account class
+
+Now that public keys can be derived extremely quickly using `nano25519`, there
+is no need to require async loading to Account objects. The constructor is now
+accessible and accepts a Nano address string for instantiation; it also accepts
+either a public key or private key, the type of which is determined by an
+additional optional parameter (default is public), as a hex string or a byte
+array.
+
+```javascript
+// string inputs, hex strings are assumed to be public keys by default
+let acc = new Account('nano_123...890');
+acc = new Account('90af...ec65'); // defaults to public
+acc = new Account('1274...cc99', 'public');
+acc = new Account('7adf...b78a', 'private');
+
+// byte inputs, assumed to be public key by default
+acc = new Account(new Uint8Array([0x12, 0xab, ...])); // defaults to public
+acc = new Account(new Uint8Array([0x34, 0xcd, ...]), 'public')
+acc = new Account(new Uint8Array([0x78, 0xbb, ...]), 'private')
+```
+
+The `index` property has been removed from the `Account` class because it is
+intrinsic to wallets, not accounts. `Wallet` objects still keep track of their
+accounts by index as before.
+
+#### Generate PoW when transmitting Block
+
+The transmission of a block to the Nano network implies that the block is fully
+populated with the necessary data to be processed. One common stumbling block
+(pun intended) is generating proof-of-work; numerous comments from the Nano dev
+community have indicated that this step is a challenge.
+
+Now, when calling `process()` on a Block, if the `work` property is missing,
+`libnemo` will automatically generate a value using `NanoPow`. The Block's
+`pow()` method can still be called manually as before, but since processing is
+already a step that is subject to lag from network conditions, ensuring that the
+block is not rejected for missing `work` should hopefully improve the dev
+experience.
+
+### Other Changes
+
+Fixed key byte argument being zeroed by `Tools.sign()`, leaving the key handling
+to the responsibility of the consumer.
+
 ## v0.11.0
 
 ### Notable Changes
index 2c7f2d2b361847a7f1b80d7f3e3f88503a6b52ae..d2b4c74b6c5bd4e56932599f11c44575ab0a4050 100644 (file)
@@ -1,12 +1,12 @@
 {
        "name": "libnemo",
-       "version": "0.11.0",
+       "version": "0.12.0",
        "lockfileVersion": 3,
        "requires": true,
        "packages": {
                "": {
                        "name": "libnemo",
-                       "version": "0.11.0",
+                       "version": "0.12.0",
                        "license": "(GPL-3.0-or-later AND MIT AND ISC)",
                        "dependencies": {
                                "@ledgerhq/hw-transport-web-ble": "^6.33.1",
                        "license": "MIT"
                },
                "node_modules/basic-ftp": {
-                       "version": "5.2.2",
-                       "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.2.2.tgz",
-                       "integrity": "sha512-1tDrzKsdCg70WGvbFss/ulVAxupNauGnOlgpyjKzeQxzyllBLS0CGLV7tjIXTK3ZQA9/FBEm9qyFFN1bciA6pw==",
+                       "version": "5.3.0",
+                       "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.3.0.tgz",
+                       "integrity": "sha512-5K9eNNn7ywHPsYnFwjKgYH8Hf8B5emh7JKcPaVjjrMJFQQwGpwowEnZNEtHs7DfR7hCZsmaK3VA4HUK0YarT+w==",
                        "license": "MIT",
                        "optional": true,
                        "engines": {
index 43ba7f5123cf39ef9f44ab39f16a73a91feafb2a..6a4ba6bf2cef8b7d8c2c7686ac0359a100959ea3 100644 (file)
@@ -1,6 +1,6 @@
 {
        "name": "libnemo",
-       "version": "0.11.0",
+       "version": "0.12.0",
        "description": "Nano cryptocurrency wallet library.",
        "keywords": [
                "nemo",