-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
138 additions
and
105 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
File renamed without changes.
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
--- | ||
title: "Solving Catalyst" | ||
slug: "solver/intro" | ||
description: "All Catalyst orders are permissionlessly solvable. This page introduces you how to being solving for Catalyst." | ||
sidebar: | ||
order: 1 | ||
--- | ||
|
||
Catalyst is an entirely permissionless system. Since the system is componentized and components have no inherient trust elements to other components, they can be mixed and matched as wanted by users. As a result, it is important that you validate orders in their entirety once received. | ||
Check warning on line 9 in src/content/docs/solver/01-introduction.mdx
|
||
|
||
The general Catalyst flow is as follows: | ||
|
||
import { Steps } from '@astrojs/starlight/components'; | ||
|
||
<Steps> | ||
|
||
1. The sponsor signs a Catalyst compatible lock and sends it to the Catalyst order server. | ||
|
||
2. The Catalyst order server preliminarily validates the order and gets the allocator co-signature for the order. It is then broadcasted to solvers. | ||
|
||
3. A solver submits the order's output to the output settlement contract, starting the verification layer. | ||
|
||
:::note[[Output Settlement](/implementation/output)] | ||
The output settlement is denoted as the `remoteFiller` in the order struct. | ||
::: | ||
|
||
4. The proof is delivered to the input chain through the validation layer. | ||
|
||
:::note[[Validation layer](/implementation/validation)] | ||
The validation layer is denoted as the `localOracle` and `remoteOracle` in the order struct. | ||
::: | ||
|
||
5. The solver submits the order to the input settlement contract, verifying the delivery and unlocking the associated input tokens. | ||
|
||
</Steps> | ||
|
||
|
||
### Orders | ||
The Catalyst system does not define a strict order type and as a result there will be differences between how orders are expressed in various systems. Currently only 1 order description is supported across all VMs: | ||
|
||
```solidity | ||
struct CatalystCompactOrder { | ||
address user; | ||
uint256 nonce; | ||
uint256 originChainId; | ||
uint32 fillDeadline; | ||
address localOracle; | ||
uint256[2][] inputs; | ||
OutputDescription[] outputs; | ||
} | ||
``` | ||
|
||
Where `uint256[2][] inputs === [uint256 tokenId, uint256 amount][]` and `OutputDescription`: | ||
|
||
```solidity | ||
struct OutputDescription { | ||
bytes32 remoteOracle; | ||
bytes32 remoteFiller; | ||
uint256 chainId; | ||
bytes32 token; | ||
uint256 amount; | ||
bytes32 recipient; | ||
bytes remoteCall; | ||
bytes fulfillmentContext; | ||
} | ||
``` | ||
|
||
The `CatalystCompactOrder` will be used to interface all functions on the input chain. Additionally, once hydrated with a signature it allows one to verify the validity of an order. | ||
|
||
The `CatalystCompactOrder` struct will be signed and stored as a witness in the appropriate lock/claim structure. For TheCompact this is: | ||
|
||
```solidity | ||
struct BatchCompact { | ||
address arbiter; // Associated settlement contract | ||
address sponsor; // CatalystCompactOrder.user | ||
uint256 nonce; // CatalystCompactOrder.nonce | ||
uint256 expires; // CatalystCompactOrder.fillDeadline | ||
uint256[2][] idsAndAmounts; // CatalystCompactOrder.inputs | ||
CatalystWitness witness; | ||
} | ||
struct CatalystWitness { | ||
uint32 fillDeadline; // CatalystCompactOrder.fillDeadline | ||
address localOracle; // CatalystCompactOrder.localOracle | ||
OutputDescription[] outputs; // CatalystCompactOrder.outputs | ||
} | ||
``` | ||
|
||
To validate an order, ensure that the sponsor and allocator signatures are valid for this EIP-712 signed structure. | ||
|
6 changes: 5 additions & 1 deletion
6
...content/docs/solver/collecting-orders.mdx → ...tent/docs/solver/02-collecting-orders.mdx
This file contains 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
6 changes: 5 additions & 1 deletion
6
src/content/docs/solver/evm-fulfilling.mdx → ...content/docs/solver/20-evm-fulfilling.mdx
This file contains 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
6 changes: 5 additions & 1 deletion
6
src/content/docs/solver/btc-fulfilling.mdx → ...content/docs/solver/29-btc-fulfilling.mdx
This file contains 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
8 changes: 6 additions & 2 deletions
8
src/content/docs/solver/init-orders.mdx → ...ontent/docs/solver/90-settling-orders.mdx
This file contains 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
This file was deleted.
Oops, something went wrong.