A swap to Elysium
The taker pays USDC on HyperCore and receives USDC on Elysium. The taker picks the secret.
- Taker to LPAsks for a quote for 10 USDC to Elysium.
- LP to TakerAnswers with a price and terms.
- Taker to LPSends the escrow address and the secret point.
- LP to TakerSigns a refund of the escrow to the taker that only becomes valid later.
- Taker on HyperCoreFunds a fresh escrow and makes it 2-of-2 between the taker and the LP.
- Taker to LPSends pre-signatures of the escrow's payout to the LP, encrypted under the secret point.
- LP on ElysiumChecks them, then locks USDC for the taker in BiloaLock under the same point.
- Taker on ElysiumClaims the lock, which puts the secret on chain.
- LP on HyperCoreCompletes a pre-signature with the secret and takes the escrow.
Before funding the escrow, the taker checks the LP’s refund signature and the LP’s USDC on Elysium.
A swap to HyperCore
The taker pays USDC on Elysium and receives USDC on HyperCore. The LP picks the secret, and the steps mirror the other direction.
- Taker to LPAsks for a quote for 10 USDC to HyperCore.
- LP to TakerAnswers with a price, a fresh escrow address and the LP's secret point.
- Taker to LPAsks the LP to set its USDC aside for the swap, and checks that the LP holds it on HyperCore.
- Taker on HyperCorePays 1.01 USDC to open and activate the escrow.
- Taker to LPSigns a refund of the escrow to the LP that only becomes valid later.
- LP on HyperCoreFunds the escrow and makes it 2-of-2 between the taker and the LP.
- LP to TakerSends pre-signatures of the escrow's payout to the taker under its secret point, and its signature on the lock's terms.
- Taker on ElysiumChecks them and the funded escrow, then locks USDC for the LP in BiloaLock under the same point.
- LP on ElysiumClaims the lock, which puts the secret on chain.
- Taker on HyperCoreCompletes a pre-signature with the secret and takes the escrow.
When a swap stops halfway
The funds go back to whoever paid them. A lock nobody claims returns to its payer after its deadline, and anyone may send that refund. The escrow returns to whoever funded it, through the transfer both parties signed before the swap amount moved.
A party that is owed funds has to be online within the swap’s claim window, a few minutes, or restart and run resumeSwaps within it. HyperCore’s account fee and the gas already spent are not returned.
The escrow refund is timed by HyperCore itself. HyperCore refuses an action whose nonce is more than a day ahead of its clock, so a refund signed with a nonce further ahead cannot be sent until that time comes within a day. The refund therefore opens only after the claim window has closed, with no contract on the HyperCore side.
One secret, two chains
The claim on HyperCore is an ECDSA adaptor signature. It is pre-signed under the swap’s secret point with a DLEQ proof, so the other party can check it before it locks its own side. A pre-signature is not a valid signature until the secret completes it.
BiloaLock releases a lock only to a claim that carries the secret behind its point, and the claim publishes that secret in the Claimed event. Whoever is owed the HyperCore side reads it there and completes the payout signature. So once one side is paid, the other can be taken, as long as the party owed it acts within the claim window.
The signing core is written in Rust on ecdsa_fun and runs in the SDK as WebAssembly. Each claim is pre-signed for four HyperCore nonces, so a claim HyperCore turns away can be sent again with the next one.
Native accounts on both chains
On Elysium the funds sit in BiloaLock. On HyperCore they sit in a fresh 2-of-2 multisig account, a feature HyperCore already has. Neither side needs a bridge or a custodian, and the HyperCore side needs no contract.
An open set of LPs
Anyone can run an LP agent and list it in BiloaRegistry. Takers ask the listed LPs for quotes. An LP that let a signed lock expire in the past week goes to the back; among the others the best price wins, and each LP’s record in BiloaLock breaks ties.
That record counts only the locks an LP signed itself, claimed or left to expire, so an LP cannot be blamed for a lock it never agreed to. A signed lock must leave the LP at least two minutes to claim, so a late lock is never the LP’s failure either.
An LP serves up to four swaps at once. It sets its funds aside for each swap before the taker pays, and keeps count of the HyperCore nonces each open claim still needs.
Trust model
What you rely on: the two contracts, which are verified and short (BiloaLock is under 250 lines), HyperCore’s own multisig accounts, and the code in the repository.
What you do not rely on: the LP’s honesty, a bridge, or an operator who can pause, upgrade or move funds.
What each party is responsible for: being online, or restarting and resuming, within the claim window of every swap it has open, while both chains keep producing blocks. Funds leave BiloaLock only through a claim, a refund, or sendFees, which sends the protocol fee to the address fixed at deploy.
The contracts have not had a third-party audit yet. See Security for how to report a vulnerability.