Skip to content

Implement cross-chain bridge payment relay for invoices #343

Open

Description

@Kingsman-99

Overview

Add support for accepting invoice payments relayed from other chains (e.g. Ethereum, Solana) via a trusted bridge contract. The StellarSplit contract must verify a signed relay proof before crediting the payment, so no funds can be injected without a valid cross-chain attestation.

Requirements

  • Define a bridge_pay entry point that accepts a relay proof struct (BridgeProof) containing: source chain ID, source tx hash, sender address bytes, amount, and a bridge authority signature
  • Verify the signature against a stored bridge_authority admin key before crediting
  • Emit a BridgePaymentReceived event with full proof metadata
  • Integrate with the existing payment flow — trigger auto-release if the invoice becomes fully funded
  • Reject replayed proofs (store consumed tx hashes)
  • Write unit tests covering: valid relay, invalid signature, replayed proof, wrong invoice, wrong amount

Acceptance Criteria

  • bridge_pay entry point implemented and callable
  • Signature verification passes for valid proofs and rejects tampered ones
  • Replay protection: second call with same tx hash panics with AlreadyConsumed
  • Auto-release triggers correctly when bridge payment fully funds an invoice
  • All existing tests continue to pass
  • New tests cover all acceptance criteria above
  • cargo test --workspace passes with zero failures
  • cargo clippy --all-targets -- -D warnings produces zero warnings

Definition of Done

All CI checks must pass before the PR is reviewed. PRs with failing tests or clippy warnings will not be merged.

Activity

  1. added
    complexity: highComplex feature requiring deep knowledge - 200 pts
    Maybe RewardedIssue may be eligible for a GrantFox reward
    GrantFox OSSIssue tracked in GrantFox OSS
    grantfoxIssue for GrantFox program
    featureNew contract feature or operation
    on Jul 16, 2026
  2. nurudeenheroic commented on Jul 16, 2026

    @nurudeenheroic

    Hi! I'd love to work on this. I'm confident I can deliver a clean solution.

  3. Achievers-sketch commented on Jul 16, 2026

    @Achievers-sketch

    Experienced building Soroban smart contracts, secure cross-chain payment relays, signature verification, replay protection, event handling, and comprehensive Rust test suites.

  4. guptakumarranjeet150 commented on Sep 13, 2026

    @guptakumarranjeet150

    Hi everyone,

    I would love to take this on. My planned approach:

    • Implement Implement cross-chain bridge payment relay for invoices with explicit require_auth checks, clean storage layouts, and robust Soroban contract logic.
    • Add comprehensive unit tests verifying both happy-path invocations and unauthorized revert scenarios.

    Happy to pick this up today—please assign to me!

  5. ranjeet150 commented on Sep 14, 2026

    @ranjeet150

    Hi maintainers,

    I would like to resolve this issue. Here is my proposed execution plan:

    • Implementation: Implement Implement cross-chain bridge payment relay for invoices with explicit require_auth checks, clean storage layouts, and robust Soroban contract logic.
    • Testing & Verification: Add comprehensive unit tests verifying both happy-path invocations and unauthorized revert scenarios.
    • Delivery: Ready to ship a thoroughly tested PR within 12–24 hours with passing CI.

    Looking forward to contributing—please feel free to assign!

  6. shobhamerabacha-star commented on Sep 14, 2026

    @shobhamerabacha-star

    Hello! I'd like to work on this issue.

    I would like to resolve this issue. Here is my proposed execution plan:

    • Implementation: Implement Implement cross-chain bridge payment relay for invoices with explicit require_auth checks, clean storage layouts, and robust Soroban contract logic.
    • Testing & Verification: Add comprehensive unit tests verifying both happy-path invocations and unauthorized revert scenarios.
    • Delivery: Ready to ship a thoroughly tested PR within 12–24 hours with passing CI.

    Happy to pick this up today—please assign to me!

  7. huangji6693-max commented on Oct 26, 2026

    @huangji6693-max

    Hi maintainers! I have implemented the cross-chain bridge payment relay for invoices (bridge_pay, BridgeProof, set_bridge_authority, BridgePaymentReceived) and submitted PR: #1061

    Summary:

    • Entry Points & Proof Verification: bridge_pay(env, payer, invoice_id, amount, proof: BridgeProof) verifies the Ed25519 signature against the stored bridge_authority key (set_bridge_authority), enforces replay protection on source_tx_hash (AlreadyConsumed), emits BridgePaymentReceived, and auto-releases when fully funded.
    • Verification: All 5 unit tests covering valid relay + auto-release, invalid signature, replayed proof, wrong invoice, and wrong amount pass (cargo test -p split issue_343_tests & cargo test -p split storage_snapshot).
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

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignOfficial Campaign | FWC26Campaign: Official Campaign | FWC26complexity: highComplex feature requiring deep knowledge - 200 ptsfeatureNew contract feature or operationgrantfoxIssue for GrantFox program

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions