Skip to content

Kani proofs for stealth-sender: fee arithmetic + send atomicity #160

Description

@truthixify

Tier: M (2-4 days) | Type: security

Context. Wave 7 shipped Kani for stealth-registry (three invariants at stealth-registry/src/proofs/mod.rs). stealth-sender is the higher-value target (it holds user funds and does raw i128 fee arithmetic with fee_bp up to 50) and has none. Property tests exist at stealth-sender/tests/properties.rs but only sample; Kani would prove the fee bounds hold across the full input space.

Scope.

  • New stealth-sender/src/proofs/mod.rs gated by #[cfg(kani)].
  • Prove: (a) fee = amount * fee_bp / 10_000 never overflows i128 for any positive amount and fee_bp <= 50, (b) net_to_recipient + fee_to_recipient == amount for every send that reaches token-transfer, (c) withdraw_many cannot leave the contract in a state where sum(unclaimed) > sum(deposited).
  • Reuse stealth-registry/src/mock_sdk.rs shape.
  • Extend the existing stellar-kani CI job to include the sender crate.
  • Document the proofs' claim + non-goal in a new stellar/stealth-sender/PROOFS.md.

Acceptance.

  • Three named proofs pass in the stellar-kani job in under 5 minutes wall clock
  • A deliberately broken change to fee arithmetic (mutation test) fails the job
  • stellar/stealth-sender/PROOFS.md documents each proof's claim + non-goal
  • stellar/stealth-sender/README.md cross-links to PROOFS.md

Files. stellar/stealth-sender/src/proofs/mod.rs (new), stellar/stealth-sender/src/mock_sdk.rs (new), stellar/stealth-sender/PROOFS.md (new), stellar/stealth-sender/README.md, .github/workflows/ci.yml.

Activity

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdripsFunded via Drips Networkformal-verificationhelp wantedExtra attention is neededsecuritySecurity-sensitive workstellarTouches Stellar / Soroban codestellar-waveAuto-created for Wave 8wave-8Auto-created for Wave 8

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions