Walkthrough
Follow a multi-party HTLC settlement where two DALP settlements use the same hashlock to coordinate token and USDC flows across Ethereum and Polygon.
Two local DALP XvP settlements coordinate one cross-chain deal with a shared hashlock. The platform executes only the local flows on each chain. As you follow each step, the external flows show the matching obligation on the other chain so every participant can verify the full deal before approving or revealing.
Scenario: Tokenized real estate sale
A Builder sells 100 tokenized apartment tokens on Ethereum. Two Buyers pay USDC on Polygon, and a Notary receives a fee on that chain. The parties create one settlement on Ethereum for the property-token delivery and one on Polygon for the USDC payment.
Parties
| Party | Role in this walkthrough | Local chain for approvals |
|---|---|---|
| Builder | Sends property tokens | Ethereum |
| Buyer 1 | Sends payment and receives 50 tokens | Polygon |
| Buyer 2 | Sends payment and receives 50 tokens | Polygon |
| Notary | Receives the notary fee | Polygon |
Deal terms
| Item | Amount |
|---|---|
| Property price | 500,000 USDC |
| Buyer 1's share | 250,000 USDC plus 2,500 USDC fee |
| Buyer 2's share | 250,000 USDC plus 2,500 USDC fee |
| Notary fee | 5,000 USDC total |
| Property tokens | 100 APT-101 total |
The same hashlock links both settlements:
| Value | Example |
|---|---|
| Raw secret | closing-secret-apt-101-2025 |
| Hashlock | 0x920eda3b2f7ffb9adef73772ed5ef26ea12e8934c8ae5f2b24ec5a0c07ff8969 |
The raw secret is the value you enter during reveal. The hashlock is the 32-byte 0x-prefixed value stored on both settlements.
Settlement structures
Ethereum settlement
Builder creates the Ethereum settlement. Local flows transfer APT-101 tokens on Ethereum. External flows record the matching USDC obligations on Polygon so each participant can verify the full deal before approval.
| Field | Value |
|---|---|
| Local flow 1 | Builder sends 50 APT-101 to Buyer 1 |
| Local flow 2 | Builder sends 50 APT-101 to Buyer 2 |
| External flow 1 | Buyer 1 sends 250,000 USDC to Builder on Polygon |
| External flow 2 | Buyer 2 sends 250,000 USDC to Builder on Polygon |
| External flow 3 | Buyer 1 sends 2,500 USDC to Notary on Polygon |
| External flow 4 | Buyer 2 sends 2,500 USDC to Notary on Polygon |
| Hashlock | 0x920eda3b2f7ffb9adef73772ed5ef26ea12e8934c8ae5f2b24ec5a0c07ff8969 |
| Timelock | January 20, 2025 at 17:00 UTC |
| Auto-execute | Enabled for this walkthrough |
Polygon settlement
Buyer 1 creates the Polygon settlement because both Buyers send USDC flows on that chain. Buyer 2 still approves, as a local sender who sends funds.
| Field | Value |
|---|---|
| Local flow 1 | Buyer 1 sends 250,000 USDC to Builder |
| Local flow 2 | Buyer 2 sends 250,000 USDC to Builder |
| Local flow 3 | Buyer 1 sends 2,500 USDC to Notary |
| Local flow 4 | Buyer 2 sends 2,500 USDC to Notary |
| External flow 1 | Builder sends 50 APT-101 to Buyer 1 on Ethereum |
| External flow 2 | Builder sends 50 APT-101 to Buyer 2 on Ethereum |
| Hashlock | 0x920eda3b2f7ffb9adef73772ed5ef26ea12e8934c8ae5f2b24ec5a0c07ff8969 |
| Timelock | January 19, 2025 at 17:00 UTC |
| Auto-execute | Enabled for this walkthrough |
Balance tracking
Ethereum chain
| Step | Event | Builder | Buyer 1 | Buyer 2 | XvP contract |
|---|---|---|---|---|---|
| Initial | No change yet | 100 APT-101 | 0 | 0 | 0 |
| Create | Builder creates settlement | 100 APT-101 | 0 | 0 | 0 |
| Approve | Builder approves, settlement is Armed | 0 | 0 | 0 | 100 APT-101 |
| Execute | Secret is revealed on Ethereum | 0 | 50 APT-101 | 50 APT-101 | 0 |
Polygon chain
| Step | Event | Builder | Notary | Buyer 1 | Buyer 2 | XvP contract |
|---|---|---|---|---|---|---|
| Initial | No change yet | 0 | 0 | 252,500 USDC | 252,500 USDC | 0 |
| Create | Buyer 1 creates settlement | 0 | 0 | 252,500 USDC | 252,500 USDC | 0 |
| Approve 1 | Buyer 1 approves | 0 | 0 | 0 | 252,500 USDC | 252,500 USDC |
| Approve 2 | Buyer 2 approves, settlement is Armed | 0 | 0 | 0 | 0 | 505,000 USDC |
| Execute | Secret is revealed on Polygon | 500,000 USDC | 5,000 USDC | 0 | 0 | 0 |
Step-by-step walkthrough
Builder generates the raw secret
Builder opens the settlement wizard and generates a raw secret. The wizard lets you either enter the raw secret directly or supply an existing hashlock, depending on which party creates the settlement.
- Raw secret:
closing-secret-apt-101-2025 - Hashlock:
0x920eda3b2f7ffb9adef73772ed5ef26ea12e8934c8ae5f2b24ec5a0c07ff8969
Builder keeps the raw secret private and shares only the hashlock with the Buyers before they approve.
Builder creates the Ethereum settlement
Builder configures the settlement:
- Adds two local flows for the APT-101 transfers to Buyer 1 and Buyer 2.
- Adds the four Polygon USDC flows as external flows.
- Enters the shared hashlock.
- Sets the timelock to January 20, 2025 at 17:00 UTC.
- Enables auto-execute for this walkthrough.
- Submits the transaction.
The settlement now describes both sides of the deal, but executes only the APT-101 flows on Ethereum.
Buyers verify the Ethereum settlement
Before creating and approving the Polygon side, Buyer 1 and Buyer 2 check the Ethereum settlement to confirm:
- The local flows send 50 APT-101 to each Buyer.
- The external flows match the Polygon USDC obligations.
- The hashlock matches the value they will use on Polygon.
- The Ethereum timelock leaves enough time to reveal the secret after it becomes public on Polygon.
Builder does not share the raw secret until both settlements are approved.
Buyer 1 creates the Polygon settlement
Buyer 1 creates the matching Polygon settlement. The configuration mirrors the Ethereum structure but executes only the USDC flows on Polygon:
- Adds four local flows for the USDC payments to Builder and Notary.
- Adds the two Ethereum APT-101 flows as external flows.
- Enters the same hashlock used on Ethereum.
- Sets the timelock to January 19, 2025 at 17:00 UTC.
- Enables auto-execute for this walkthrough.
- Submits the transaction.
Builder approves on Ethereum
Builder approves the Ethereum settlement by opening the detail page, selecting Approve, and confirming the transaction that transfers 100 APT-101 into the XvP contract. The settlement enters Armed state: its only local sender has approved.
Buyers approve on Polygon
Buyer 1 approves first:
- Opens the settlement on Polygon.
- Selects Approve.
- Confirms the transaction that transfers 252,500 USDC into the XvP contract.
The settlement remains pending until Buyer 2 also approves.
Buyer 2 then approves by opening the settlement, selecting Approve, and confirming the transaction that transfers 252,500 USDC into the XvP contract. The settlement on Polygon enters Armed state.
Builder reveals the secret on Polygon
Builder reveals the raw secret on the Polygon settlement to claim the USDC payment:
- Opens the Polygon settlement.
- Selects Reveal Secret.
- Enters
closing-secret-apt-101-2025. - Confirms the transaction.
Because auto-execute is enabled in this walkthrough, revealing the valid secret executes the local USDC flows on Polygon:
- Builder receives 500,000 USDC.
- Notary receives 5,000 USDC.
The Polygon settlement moves to Executed state. The raw secret is now public on-chain.
Buyers reveal the same secret on Ethereum
After the Polygon reveal, Buyer 1 or Buyer 2 can reuse the now-public raw secret on the Ethereum settlement:
- Opens the Ethereum settlement.
- Selects Reveal Secret.
- Enters
closing-secret-apt-101-2025. - Confirms the transaction.
Because auto-execute is enabled in this walkthrough, revealing the valid secret executes the local APT-101 flows on Ethereum:
- Buyer 1 receives 50 APT-101.
- Buyer 2 receives 50 APT-101.
The Ethereum settlement moves to Executed state. Both sides of the deal are complete.
What can go wrong
The table describes common failure scenarios and how to resolve each one.
| Scenario | What happens | What to do |
|---|---|---|
| Secret is never revealed before January 19 | The Polygon settlement expires. Buyers can withdraw their USDC from the Polygon settlement. | Do not reveal on Ethereum. Let both sides expire or have each party withdraw according to each settlement's local state. |
| Secret is revealed on Polygon but not Ethereum before January 20 | The Polygon USDC flows execute. The Ethereum settlement remains available until its timelock. After expiry, Builder can withdraw the APT-101 tokens. | Buyers should reveal on Ethereum as soon as the Polygon reveal transaction is final enough for your operating process. |
| Buyer 2 does not approve on Polygon | The Polygon settlement does not reach Armed state. Execution stays blocked until all local senders approve. | Wait for approval or let the settlement expire, then have each local sender withdraw their assets from that settlement. |
| Ethereum is congested after the Polygon reveal | Buyers may run out of time before the Ethereum timelock. | Set staggered timelocks and reveal with enough operational margin for finality and retries so you stay within your time window. |
Next steps
Configure local flows, add external flows to describe the other chain, and submit the settlement for approval.
Enter the raw HTLC secret on an armed settlement to trigger execution of the local flows.
Recover local assets after a settlement's timelock expires without execution.
How HTLC works in XvP settlements
Understand how Hash Time-Locked Contracts coordinate XvP settlement legs with a shared secret and cutoff dates.
Verify external flows
Confirm the cross-chain asset details, hashlock, and cutoff timing in an HTLC settlement so both sides match before any sender approves or the secret is revealed.