Pearl Swap

trustless PRL↔BTC atomic swaps · Taproot hash+timelock

Honest limits — read before real funds

Propose the swap

Alice (PRL side, initiator) and Bob (BTC side) agree on amounts, the secret hash, and two timelocks. This step forges the Pearl Taproot HTLC both sides can re-derive byte-for-byte — no PRL moves here.

T1 must be greater than T2, with a ≥144-block gap recommended. T1 is the absolute Pearl height in the PRL refund leaf; T2 is the latest point (as a Pearl height) by which Bob's BTC refund may become valid — the Lock step converts it to a Bitcoin height for the mirror template.

Secret — Alice generates the preimage; Bob works from the hash alone

…or paste a 64-hex preimage below (Alice) / leave it empty and paste the hash (Bob).

Load a swap

Lock the PRL

Alice funds the swap address from her own wallet. The funding transaction is built and signed locally; every signature is re-verified before the hex is shown. Broadcast is explicit and confirmed — nothing leaves until you say so.

⚠ This step moves real PRL. Review the transaction before broadcasting.

Track the swap

Watch the swap address: funding, Bob's claim (preimage revealed on-chain), or Alice's refund after T1 — plus live countdowns to both timelocks.

Claim

Bob's path — claim the PRL

Bob spends the claim leaf, revealing the preimage on Pearl. Alice watches this transaction to learn the preimage for the BTC side.

⚠ This step moves real PRL and reveals the secret.

Alice's path — extract the preimage

Paste Bob's confirmed claim transaction. The page pulls the preimage out of the witness so you can claim the BTC with your own Bitcoin tooling.

Refund

If Bob never claims, Alice reclaims the PRL after T1 through the refund leaf. The page refuses to build the transaction before maturity — and the wire format hard-codes nLockTime = T1 with input sequence 0xfffffffe.

⚠ This step moves real PRL.