Skip to content

Webledger deposit addresses: phased design #267

Description

@melvincarvalho

Overview

Give each webledger a master keypair so users can send sats to a standard Bitcoin address instead of passing TXO URIs with private keys. Built in phases alongside the existing deposit flow.

Phase 1: Single pod address

  • Webledger gets a master keypair (generated on first --pay start, stored in .well-known/webledgers/)
  • GET /pay/.address returns the pod's taproot deposit address
  • User sends sats from any wallet, then claims: POST /pay/.deposit with {"txid": "...", "vout": 0}
  • Pod verifies on mempool API, credits the authenticated user's balance
  • No private key in the URL — pod owns the key

Phase 2: Per-user tweaked addresses

  • GET /pay/.address?user=did:nostr:abc... returns a unique address: P2TR(masterKey + SHA256(userDID))
  • Pod can map incoming transactions to users automatically
  • Enables deposits without a claim step

Phase 3: Auto-detection

  • Pod polls mempool API for known addresses
  • Credits balances automatically on confirmation
  • Address gap management for tweaked addresses

Notes

  • Existing TXO voucher deposit flow (txo:chain:txid:vout?key=) remains unchanged
  • Phase 1 reuses existing mempool verification from deposit handler
  • Key derivation primitives already exist in src/token.js
  • Pod becomes custodial (holds keys) — same as token trail already does

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions