[FEAT] Cross-Ledger Settlement Time-Lock Atomic Swap Dispute Bridge (#446) - #447
Draft
s6pa1rta3n-lab wants to merge 2 commits into
Draft
[FEAT] Cross-Ledger Settlement Time-Lock Atomic Swap Dispute Bridge (#446)#447s6pa1rta3n-lab wants to merge 2 commits into
s6pa1rta3n-lab wants to merge 2 commits into
Conversation
|
@s6pa1rta3n-lab is attempting to deploy a commit to the jotelfootball-tech's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Hey @s6pa1rta3n-lab, saw this is still in draft — no rush, just flagging that it currently has conflicts across 9 files including |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Resolves #446 by implementing a production-grade Cross-Ledger Settlement Time-Lock Atomic Swap Dispute Bridge for EVM <-> Stellar cross-chain trades.
Database & Schema Migration:
apps/api/src/db/migrations/029_add_atomic_swap_dispute_bridge.sqlwithswap_dispute_stateenum (ACTIVE,SECRET_EXTRACTED,REFUND_CLAIMABLE,RESOLVED) andatomic_swap_dispute_bridgestable with indexing.Core Worker & Store Architecture:
apps/api/src/lib/workers/swapDisputeWorker.tswithSwapDisputeStore.SELECT FOR UPDATE) and mutexes to eliminate race conditions and double-spending across parallel invocations.sweepExpiredSwaps) for automated dispute resolution and refund execution.API & REST Routes:
apps/api/src/routes/swap-dispute.tsregistering endpoints:POST /api/v1/swaps/register-disputePOST /api/v1/swaps/extract-secretPOST /api/v1/swaps/dispute-claimGET /api/v1/swaps/dispute/:swapIdSmart Contract Enhancements:
contracts/atomic-swap/src/lib.rswithextract_secret_and_resolveandclaim_dispute_refundensuring atomic dispute resolution and refund releases upon counterparty timeout.contracts/atomic-swap/src/test.rs.Frontend UI Component:
mobile/frontend/src/components/AtomicSwapDisputeCard.tsxdisplaying real-time lock status, countdown, secret extraction triggers, and one-click dispute refund claiming when expiration threshold is breached.Webhooks & Operations Alerts:
sendSwapDisputeAlert,sendSwapSecretExtractedAlert, andsendSwapDisputeRefundAlertinapps/api/src/lib/webhook.ts.Stipulations Compliance Checklist
sha256(preimage) == secret_hashand updates state toSECRET_EXTRACTED.current_ledger >= expiration_ledgerbefore refund execution, returning funds safely to initiator/buyer.SELECT FOR UPDATEand transactional mutexes to eliminate double claim races under concurrent load.AtomicSwapContract.tests/concurrency/swap_dispute_stress.test.ts).atomic-swap) and TypeScript packages (@velo/api,@velo/frontend,@velo/relayer,@velo/shared).Payout Routing
0xF46C9F6d70C50BF81ef3588AB523a90a594a2F89GCL6OXAMLD75BMTINA6EMRUDWK5THQUSHMYNLSNBCJAPZJHNYJTUNIBC