Skip to content

Implement on-chain CapacityBond and PaymentChannel contract integration #327

Closed

Description

@alpergundogdu

Context

ADRs 003 and 004 specify on-chain integration with StablePaymentChannel and StakingRegistry contracts on Arbitrum Sepolia. Required for payment settlement and node registration verification.

Scope (crates/incentive)

PaymentChannel contract

  • openChannel(recipient, deposit)
  • closeChannel(channel_id, voucher)
  • disputeChannel(channel_id, voucher) — watchtower path
  • settleChannel(channel_id) — after dispute window
  • Event monitoring: ChannelOpened, ChannelCloseInitiated, ChannelDisputed, ChannelSettled

StakingRegistry contract

  • registerNode(node_id, stake_amount)
  • Node registration verification (validate peer is staked before accepting announces)
  • Stake-weighted fee tiers (3% standard, 1.5% for ≥10x minimum stake)

Runtime integration

  • RPC polling loop for contract events
  • Alloy provider + signer wiring (config already has rpc_url and eth_keystore)
  • Startup self-check: verify contract addresses are valid and reachable

References

Activity

  1. alpergundogdu commented on Apr 27, 2026

    @alpergundogdu
    ContributorAuthor

    Relabeled as poc-blocking: bootstrap depends on the registry query (per ADR 012 §Bootstrap step 3 — getActiveNodes(offset, 100) paginated lookup). Without it a freshly-installed client has no way to discover any node, so this gates #318/#320/#317.

    Scope can be narrowed for PoC:

  2. added
    status:blocked
    on May 16, 2026
  3. changed the title [-]Implement on-chain StakingRegistry and PaymentChannel contract integration[/-] [+]Implement on-chain CapacityBond and PaymentChannel contract integration[/+] on May 29, 2026
  4. alpergundogdu commented on May 29, 2026

    @alpergundogdu
    ContributorAuthor

    Title renamed StakingRegistry → CapacityBond — the operator-registry contract under the work-token rewrite of ADR 026.

    The body still carries drift from when it was filed. Flagging rather than rewriting, since the final Rust shape depends on the not-yet-built PaymentChannel / CapacityBond contract APIs (#452):

    • ADR 004 → ADR 026. ADR 004 is superseded; tokenomics live in ADR 026.
    • StablePaymentChannel → PaymentChannel, USDC-only (single immutable token set at deployment, not multi-token).
    • registerNode(node_id, stake_amount) → capacity-bond register. The bond follows the curve k·Mbps^α against declared capacity, not a flat stake amount; isActive semantics per ADR 003.
    • Stake-weighted fee tiers (3% / 1.5%) are gone. Settlement routes through the 3-bucket FeeRouter (60/30/10) with served-bytes accounting; there are no stake-weighted fee tiers.

    Stays blocked on the PaymentChannel contract landing under #452. Worth a full body refresh once those contracts merge.

  5. self-assigned this
    on May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

prio:highstatus:blocked

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions