Skip to content

feat(stellar): Add stealth-batch-sender Soroban contract (#47)#79

Merged
truthixify merged 2 commits into
wraith-protocol:developfrom
cokehill:feat/stealth-batch-sender-issue-47
Jun 24, 2026
Merged

feat(stellar): Add stealth-batch-sender Soroban contract (#47)#79
truthixify merged 2 commits into
wraith-protocol:developfrom
cokehill:feat/stealth-batch-sender-issue-47

Conversation

@cokehill

Copy link
Copy Markdown
Contributor

Summary

Closes #47

Implements stealth-batch-sender — a new Soroban crate that sends tokens
to N pre-computed stealth addresses atomically in one transaction, matching
the EVM WraithSender.batchSendETH / batchSendERC20 functionality.

What's in this PR

  • New crate: contracts/stellar/stealth-batch-sender/
  • batch_send(from, transfers: Vec<Transfer>, asset) entrypoint
    • Transfer carries stealth_address, ephemeral_pub_key, amount
    • Single from.require_auth() covers the entire batch
  • All-or-nothing atomicity via Soroban's transaction model
  • Per-transfer ANNOUNCE event + batch-level BATCH summary event
  • MAX_BATCH_SIZE = 100 (justified: ~50M instructions vs ~100M budget)
  • max_batch_size() read-only query for SDK/UI consumers

Tests

  • ✅ Success: 3-transfer batch, verifies balances
  • ✅ Atomicity: mid-batch failure panics and rolls back all transfers
  • ✅ Max size cap: 101 transfers → panic
  • ✅ Empty batch rejected
  • ✅ Zero-amount transfer rejected
  • max_batch_size() returns 100

Resource budget comparison vs N individual stealth-sender calls

Approach Auth ops Ledger entries Approx instructions
N × stealth-sender::send N N × 2 N × ~500K
batch_send (N=100) 1 1 + N × 1 ~52M

Batch is significantly more efficient due to single auth and single
transaction envelope.

Follow-up issues to file (as noted in acceptance criteria)

  • SDK: buildBatchSendStellar builder function
  • Demo: batch-send UI screen

…l#47 chore: register stealth-batch-sender in workspace
@drips-wave

drips-wave Bot commented Jun 24, 2026

Copy link
Copy Markdown

@cokehill Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify truthixify changed the base branch from main to develop June 24, 2026 14:48
@truthixify

Copy link
Copy Markdown
Contributor

Just one conflict in stellar/Cargo.toml (workspace members list). Quick rebase:

git fetch origin
git rebase origin/develop
git push --force-with-lease

Keep both: develop's existing members plus your new stealth-batch-sender entry. The crate files themselves merge cleanly.

@cokehill

Copy link
Copy Markdown
Contributor Author

resolved

@truthixify truthixify merged commit 4478104 into wraith-protocol:develop Jun 24, 2026
@truthixify

Copy link
Copy Markdown
Contributor

Clean merge after rebase. New stealth-batch-sender crate gives Stellar atomic batch send parity with the EVM WraithSender.batchSendETH/batchSendERC20. Workspace wiring and tests look good. Thanks @cokehill.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stealth-batch-sender Soroban contract

2 participants