Skip to content

All state locktimes are always already-final; stale updates have no time disadvantage #22

Description

@Rob1Ham

Component: lib/src/bip448_statechain/script.rs (constants), lib/src/bip448_statechain/deposit.rs (sample_initial_state_locktime)
Severity: Design risk (makes the missing watcher the entire theft defense)

Summary

State locktimes are sampled from INITIAL_STATE_LOCKTIME_MIN..=MAX = 500_000_000..1_000_000_000 (timestamps in 1985–2001), and future strides are ≤ 65,536 seconds. As a result:

  1. Every state-update CLTV gate (L+1) is satisfiable at all times on any present-day chain.
  2. validate_immediately_final is vacuous in practice — every state is "immediately final" the moment it's created.
  3. A stale owner can broadcast an old update U(k) at any moment, with no time disadvantage whatsoever. The only defenses are signature-count ordering and the newest owner rebinding a newer update over the confirmed stale state.

Combined with the missing stale-state watcher (see tracking issue), the ratchet provides no time-based protection at all; protection is purely reactive.

Suggested direction

Consider whether future states should carry genuinely future locktimes (e.g., initial locktime near deposit time + per-state stride), so a stale update at least races the honest party's clock rather than being permanently open. This changes the recovery-finality model, so it needs a design decision.

Found during security review of feature/bip448-web-wallet-mutinynet @ 64d2423.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions