Conversation
🟡 Heimdall Review Status
|
Review from an operator running a production Nano x402 railI operate a live Nano rail ( 1.
|
|
Thanks — this is exactly the review the PR needed, and both problems reproduce on our side too. 1.
2. The missing receive path — agreed, and yes, please post it. 3. Work threshold by block type — agreed and will be documented. One more we should fix while here: Your three uncredited payments sitting for two weeks are the strongest argument in this thread for why the receive side has to exist before the provider ships. Thanks for reading it from the rail side. |
…eive path (addresses review) The previous Nano wallet provider built an invalid send block (plain 'type: send' with no account/previous/balance/representative/link/signature/work), which would be rejected by any real Nano node. This was flagged in review by pyfile-toolkit, an operator running a production Nano x402 rail. Changes: - Build real signed 'state' blocks with Ed25519/Blake2b signatures, proper 'previous'/'balance'/'link' fields, and work generated via RPC - Add receive() method (publish receive blocks so the agent can claim paid funds) - Add receivable() method (list pending incoming blocks) - sign_message now produces a real Ed25519/Blake2b signature - Add test seed, derive address deterministically for unit tests - Add nanohakase dependency (existing Nano library from hub.nano.org) - All 688 tests pass, ruff clean, mypy strict clean Closes the review on coinbase#1517
|
Thanks for the review - all three points are correct, and I have fixed them on the branch (commit 7753497). 1. native_transfer built an invalid block. You are right: it posted {"type": "send", "to": ..., "amount": ...}, which is not a Nano state block and is rejected by any real node. The provider now builds a proper "state" block with account, previous (from account_info), representative, the resulting balance after the debit, link set to the destination public-key hash (not the address), an Ed25519/Blake2b signature over the block hash, and work generated by the RPC (do_work: true). It also rejects a send that would exceed the available balance before building a block. 2. No receive path. Agreed - a provider that can pay but cannot learn it was paid inherits the failure mode you described. Added two methods:
3. Non-uniform work thresholds. Now documented on the provider as SEND_WORK_THRESHOLD (fffffff800000000) and RECEIVE_WORK_THRESHOLD (fffffe0000000000), and the provider asks the RPC to pick the correct work per block via do_work: true rather than hardcoding one value. Verification: the provider block hashing now matches the reference implementation (nanohakase) for identical contents, and the Ed25519/Blake2b signature verifies against the account public key derived from the address. I re-ran the suite - 688 tests pass (19 for this provider), ruff clean, mypy strict clean. The unit test mocks the RPC so no blocks are broadcast from here. Re: your offer to post the receive-side implementation as a follow-up PR - this PR now includes the receive side, but if you would still like to contribute the work-generation path (local PoW vs RPC do_work) as a follow-up, that would be genuinely useful, since you run it in production. |
Overview
Adds a new non-EVM wallet provider,
NanoWalletProvider, and a two-rail payment example. This gives AgentKit agents a feeless, self-custodial, sub-second-finality settlement rail (Nano, XNO) alongside the existing EVM and Solana providers, behind the sameWalletProviderinterface.Why
AgentKit's
WalletProviderabstraction already lets an agent express "send the native asset to this address". Nano is the one major feeless rail: no per-transfer gas, no freezeable stablecoin, no off-chain channel or liquidity management. For a budget-bound, per-call agent economy (x402 micropayments, sub-USD bounties) it removes the fee and the layer-1 gas entirely. The two-rail example settles the same $1.00 x402-priced call on the Nano rail throughNanoWalletProvider.native_transferand quotes the USDC/EVM rail, printing machine-readable fee/finality markers.What & how it's verified
coinbase_agentkit/wallet_providers/nano_wallet_provider.py— aWalletProvidersubtype (no CDP API key required; an address + a Nano RPC endpoint are enough).get_balance/native_transfercall the standard Nano JSON-RPCaccount_balance/processinterface through a thin typed helper.tests/wallet_providers/nano_wallet_provider/— 12 unit tests (address, network, balance, transfer, sign).python/examples/nano-two-rail-payment/— the runnable two-rail example.How to run the checks
Notes
processaction enabled; the example's keyless stub RPC seam is documented in its README, andNANO_RPC_URL/NANO_ADDRESSpoint the provider at a live node.