Repository navigation
Description
Problem
ADR 019 §2.3 describes the on-chain node-registration step in present tense:
Both signing operations are supported by the
decdnCLI (decdn node registerprints the required parameters, signs locally, submits the transaction).
But decdn node register does not exist. The CLI only has node {peers,health,status,channels,region-stats,reputation,evict,announce,reload,drain,top} — all of which talk to the loopback admin RPC. There is no command that performs Phase 2 Step 2.3: building the bindingSignature + ed25519Signature and submitting CapacityBond.registerNode(...).
Today an operator must hand-build an EIP-712 BindNodeId signature and an ed25519 ownership signature over keccak256(abi.encodePacked(nodeId, ethAddress, chainId, registrationNonce)), then submit the transaction manually. That is error-prone on a money/security path.
Scope
Implement decdn node register covering only ADR 019 Step 2.3 (the registerNode transaction). Phase 2.1/2.2 (approve / bond / declareMbps) remain separate and are an operator precondition (the contract already reverts registerNode with BondBelowMinimum / BondBelowCurve if the bond is not posted).
The command MUST:
- Resolve
rpc_url,chain_id,capacity_bond_address,eth_keystore, anddata_dir(config file + flag overrides, mirroring the existingnodesubcommand config resolution). - Load the eth keystore signer (
decdn_incentive::eth_identity::load_signer+read_password) and the iroh nodeSecretKey(decdn_common::identity::load_or_generate).nodeId= the iroh public key. - Read
bindingNonce[ethAddress]andregistrationNonce[nodeId]fromCapacityBond. - Build
bindingSignature(EIP-712BindNodeId{nodeId, bindingNonce}, reusingdecdn_incentive::bind_sig) anded25519Signature(iroh key over the keccak ownership digest). - Pack
--multiaddrargs into the on-chain(uint16 length, bytes data)format (ADR 019 § Multiaddr encoding). - Submit
CapacityBond.registerNode(nodeId, multiaddrs, regionHint, bindingSignature, ed25519Signature), await the receipt, report tx hash + status. Support--dry-run(print the params + signatures without submitting) and--json.
Correctness anchor
The ed25519 ownership digest MUST byte-match CapacityBond._verifyEd25519OwnershipSignature — keccak256(nodeId‖operator‖chainId(uint256 BE)‖registrationNonce(uint64 BE)), 92-byte preimage. The authoritative encoding lives in contracts/test/ed25519-vectors/src/main.rs; pin a Rust unit test against the committed vector constants in contracts/test/CapacityBondRegionE2E.t.sol (REG_NODE_ID / REG_OPERATOR / REG_CHAIN_ID / REG_ED25519_SIG).
Out of scope
approve/bond/declareMbpscommands (Phase 2.1/2.2).updateMultiaddrsautomation and thedecdn setupwizard (already deferred in ADR 019 § Deferred & Open).- Phase 3 startup state-sync (separate from registration).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
feat(cli): add `decdn node register` for on-chain node registration (#…
feat(cli): add `decdn node bond` — idempotent stake-to-tier (#932)
feat(cli): add `decdn node register` for on-chain node registration (#…
feat(cli): add `decdn node bond` — idempotent stake-to-tier (#932)
fix(cli): drop duplicate alloy dep after rebase onto main
feat(cli): add `decdn node bond` — idempotent stake-to-tier (#932) (#934
fix(cli): drop duplicate alloy dep after rebase onto main
feat(cli): standalone client fetch (decdn fetch) + config-sourced rel…