Repository navigation
Conversation
Add Chain::Nano to the bus vocabulary ("nano", alias "xno") and an
address::nano module in tinywallet-crypto behind a default-on `nano`
gate. A Nano address is `nano_` (or legacy `xrb_`) plus 60 base32
characters: 4 zero padding bits and a 32-byte ed25519 public key,
then a byte-reversed 5-byte blake2b checksum. validate, decode and
encode mirror the Solana module; address::validate dispatches to it.
The asset catalog and chain client do not cover Nano, so the
network-coverage test skips it explicitly.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
Tiny Sweeper reviewTiny Sweeper completed its review; deterministic results follow. State: Incomplete Review snapshot
Completeness: Incomplete What changedThe diff introduces Nano address support across the crate hierarchy. A new `crates/tinywallet-crypto/src/address/nano.rs` module implements decode, encode, validate, base32 packing/unpacking, and a blake2b-40 checksum, gated behind a new `nano` feature backed by an optional `blake2` dependency. `Chain::Nano` is added to the bus enum with ALL, as_str, and FromStr support including the `xno` alias. The root and crypto crates add the `nano` feature to defaults; the module crate forwards it. Dispatch in `crates/tinywallet-crypto/src/address/mod.rs#pub fn validate(chain: Chain, address: &str) -> Result<String>` gains a Nano arm, and the unused-variable allow-list is extended. Tests are added in `nano/nano_tests.rs` and `crates/tinywallet-bus/src/chain/mod_tests.rs`, the FIXTURES table in `crates/tinywallet-crypto/src/address/mod_tests.rs` grows to five chains, and the asset network table test skips Nano. Documentation in README.md, src/lib.rs, and examples/basic.rs is updated. Features
Tests
FindingsNo active actionable findings. Could not review: Cargo.toml, crates/tinywallet-crypto/Cargo.toml, crates/tinywallet-crypto/src/address/mod_tests.rs, crates/tinywallet-crypto/src/address/nano.rs, crates/tinywallet-crypto/src/address/nano/nano_tests.rs Before merge
How this fits togetherflowchart LR
n0["networks"]:::impacted
n1["catalog"]:::impacted
n2["...work_lists_exactly_one_native_asset_first"]:::impacted
n3["...token_contract_is_valid_for_its_own_chain"]:::impacted
n4["...ts_carry_no_contract_and_tokens_always_do"]:::impacted
n2 -->|calls| n0
n2 -->|tests| n0
n2 -->|calls| n1
n2 -->|tests| n1
n3 -->|calls| n0
n3 -->|tests| n0
n3 -->|calls| n1
n3 -->|tests| n1
n4 -->|calls| n0
n4 -->|tests| n0
n4 -->|calls| n1
n4 -->|tests| n1
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: Cargo.toml, crates/tinywallet-crypto/Cargo.toml, crates/tinywallet-crypto/src/address/mod_tests.rs, crates/tinywallet-crypto/src/address/nano.rs, crates/tinywallet-crypto/src/address/nano/nano_tests.rs.
$0.0125 · 1,335,138 in / 168,131 out · 320,640 cached (24%) · ladder/vectors-oai3, deepseek-v4.1-flash, · 981 embedded
critique: $0.0050 · 598,781 in / 71,850 out · 159,616 cached (27%) · deepseek-v4.1-flash
security: $0.0071 · 620,564 in / 92,380 out · 150,528 cached (24%) · deepseek-v4.1-flash,
tests: $0.0001 · 50,062 in / 791 out · 4,352 cached (9%) · deepseek-v4.1-flash
description: $0.0001 · 53,388 in / 973 out · 6,144 cached (12%) · deepseek-v4.1-flash
An agent wallet that cannot recognise a Nano address cannot be asked to pay one. Today
"nano".parse::<Chain>()returnsUnknownChain("nano"), andaddress::validatehas no Nano arm.This adds Nano beside the existing chains. Nothing about them changes.
tinywallet-bus:Chain::Nano(as_str/serde"nano", alias"xno", inChain::ALL).tinywallet-crypto:address::nanobehind a default-onnanogate. It providesvalidate,decode(returns the 32-byte ed25519 key) andencode, shaped like the Solana module. An address isnano_(or legacyxrb_) plus 60 base32 chars: 4 zero pad bits and the key, then a byte-reversed 5-byte blake2b checksum. It rejects a wrong prefix, wrong length, characters outside the alphabet, nonzero padding and a bad checksum. Addsblake20.11, which uses the samedigest0.11 as the existingsha2. No signing crates are added.address::validatedispatches to it, the module build enablesnano, and the README, lib docs andexamples/basic.rsare updated.Public API: additive.
Chainis#[non_exhaustive].Behavior note: Nano has no
asset::Networkor client queries yet, sonetworks_are_distinct_and_cover_every_chainnow skipsChain::Nano, with a comment saying why.key::derive(Chain::Nano, ..)returns the existingChainNotCompiled.Test vectors: the genesis account (its decoded key equals the published E89208DD...A65093BA), the all-zero burn address and a live account. Every checksum was checked independently with Python's
hashlib.blake2b(digest_size=5).What I ran:
cargo fmt --all -- --check: clean.cargo test --all-features: 825 passed / 3 ignored on main c154d14; 842 passed / 0 failed / 3 ignored after.bash scripts/test-features.sh: 1641 passed / 0 failed / 6 ignored (--lockedok);cargo fmt --all -- --checkclean.cargo docwith-D warnings,check-bus-boundaries.py, nano-only gated build and tests: all clean.cargo clippy --all-targets --all-features -- -D warnings: my local clippy 0.1.97 fails on unmodified main as well, withunknown lint: clippy::unused_async_trait_implin tinywallet-module. With only that lint allowed, it is clean.This is the primitive. An x402
nano:mainnetpayer leg would follow only if you want it.