# AllSet and AllSwap

AllSet and AllSwap are two core applications built on FastSet that make cross-chain interactions simple and verifiable.

AllSet acts as a universal liquidity layer that lets users deposit, withdraw, or revoke assets across chains, all backed by FastSet’s claim-proof system. AllSwap on the other hand builds on AllSet to enable seamless cross-chain swaps, discovering the best rates and settling them instantly through verifiable proofs instead of bridges.

{% hint style="success" %}

#### Want to get your hands dirty?

If you want to skip all the architectural bits & pieces, head over to the [AllSet usage docs](https://docs.pi2.network/user-guides/omniset-and-omniswap/omniset-usage-guide), where we outline instructions to get you started!
{% endhint %}

### AllSet

As earlier stated, AllSet is a universal liquidity and settlement layer built on top of [FastSet](https://docs.pi2.network/fastset/overview). It allows users to deposit assets on one chain and withdraw them on another without using traditional bridges. It connects fragmented liquidity across blockchains into a single verifiable layer, ensuring value can move freely while keeping the same security guarantees of traditional bridges: transaction integrity and immutability, decentralization, and robust validation.

<figure><img src="/files/qxU0vQpIVwhFrmfEqiuv" alt=""><figcaption><p><strong>Figure 1:</strong> AllSet high-level architecture</p></figcaption></figure>

The diagram above shows how AllSet links two blockchains, say, Chain X and Chain Y, through FastSet bridge contracts.

To understand the diagram above, you need to know the following legends:

* xAsset is a representation of an Asset on Chain X
* yAsset is a representation of an Asset on Chain Y
* setAsset is a wrapped representation of an Asset on FastSet

Now, when a user deposits tokens on one chain (for example, 10 xAsset on Chain X), AllSet detects that deposit and mints an equivalent amount of the wrapped version (setAsset), in the user’s FastSet account.

Later, if the user chooses to withdraw, AllSet relays the withdraw intent to the FastSet bridge contract on the destination chain (say, Chain Y), which releases 10 yAsset to the user’s wallet.

This flow ensures that every deposit and withdrawal is fully backed and that total liquidity across all connected chains remains balanced.

Each cross-chain action happens through verifiable claims and proofs instead of traditional cross-chain consensus. In this setup, verifiers and relayers play a key role by monitoring deposits and withdrawals, verifying proofs, and confirming that every transaction is backed by real assets.

### AllSwap

AllSwap, on the other hand, builds on top of AllSet’s liquidity layer to enable seamless cross chain swaps. It aggregates decentralized exchanges (DEXs) across networks, identifies the best available rates, and executes swaps instantly, powered by FastSet’s verifiable claim system.

<figure><img src="/files/Hm6JYlxgiwcxJqUQiVtK" alt=""><figcaption><p><strong>Figure 2:</strong> AllSwap architecture or workflow</p></figcaption></figure>

This diagram shows how AllSwap interacts with AllSet. It begins by retrieving the best DEX rates and forming a swap intent on the source chain. That intent is then relayed through AllSet, where FastSet verifiers confirm the claim and proof. Once validated, AllSwap mints or burns the appropriate assets on the destination chain to complete the swap.

Together, AllSet and AllSwap make it possible to move and trade assets across chains with the same security and speed that FastSet provides.

### How does AllSet work?

AllSet operates through three core workflows: deposit, revoke, and withdraw. Each workflow contributes to maintaining liquidity accuracy, proof validity, and balanced asset distribution across chains.

#### Deposit

As earlier explained, the deposit workflow begins when a user sends assets to a FastSet Bridge Contract on the source chain (for example, 10 xAsset on Chain X). AllSet monitors this deposit event and mints an equivalent amount of the wrapped version (setAsset) in the user’s FastSet account.

<figure><img src="/files/7qPO9CNQcrsfjLqFyLFs" alt=""><figcaption><p>Figure 3: AllSet deposit workflow</p></figcaption></figure>

From the diagram above, you’ll notice how the flow moves upward:

1. The user deposits from their wallet to the bridge contract.
2. AllSet detects the deposit, generates the proof, and relays it to the FastSet network.
3. FastSet mints the same amount of setAsset for the user.

This structure ensures that every deposit is traceable and fully backed by on-chain assets, maintaining total liquidity across the network.

#### Withdraw

When a user wants to move assets from FastSet back to another chain, AllSet uses the Withdraw workflow.

The user initiates a withdraw intent to AllSet, specifying the amount of setAsset to be withdrawn. AllSet then relays this intent to the FastSet Bridge Contract on the target chain (for example, Chain Y). Once the intent is verified, the bridge contract releases the corresponding yAsset to the user’s wallet.

<figure><img src="/files/Ff8JVfIgcoV6j2vdmzsT" alt=""><figcaption><p><strong>Figure 4:</strong> AllSet withdraw workflow</p></figcaption></figure>

The flow goes like this:

1. The user initiates a withdraw intent for their setAsset balance.
2. AllSet relays the message to the target chain’s bridge contract.
3. The bridge contract verifies the transaction and executes the transfer, releasing yAsset to the user's wallet.
4. Once the yAsset is released to the user's wallet, a corresponding proof will be generated to burn the setAsset on Fastset.

This workflow ensures that every withdrawal is fully backed by existing setAsset on FastSet, keeping cross-chain balances consistent and verifiable.

#### Revoke

Sometimes, users may want to reverse a withdraw that hasn’t yet been claimed or fully processed. The Revoke workflow handles that.

Here, AllSet creates a revoke intent and passes it to the FastSet bridge. The system then verifies that the previous withdraw event is still valid and unclaimed, and once confirmed, the user’s original tokens are released back to their wallet.

<figure><img src="/files/FL6SK8zbe29G5XK5EOLP" alt=""><figcaption><p><strong>Figure 5:</strong> AllSet revoke workflow</p></figcaption></figure>

In the diagram:

1. The user initiates a revoke intent for their previous (failed) transfer intent.
2. AllSet relays the message to the target chain’s bridge contract.
3. The bridge contract verifies the transaction and revokes the previous transfer intent.
4. Once the revoke event has been triggered, a corresponding proof will be generated to transfer the setAsset back to the user account on FastSet.

The revoke path prevents liquidity from staying locked when a withdraw is unused.

By separating deposit, revoke, and withdrawal into independent, verifiable actions, AllSet provides a robust structure for liquidity flow while maintaining full transparency through FastSet’s claim-proof system.

### Key features and capabilities

The following are some features of AllSet/AllSwap:

* **Cross-chain liquidity**: Move assets between blockchains without bridges.
* **Verifiable settlements**: Every transaction, whether a deposit, revoke, or withdraw, is validated through FastSet proofs.
* **Unified liquidity layer**: AllSet pools liquidity across chains, providing a foundation for applications like AllSwap.
* **High performance:** FastSet’s parallel claim validation makes AllSet scalable even at high transaction volumes.
* **Developer-friendly**: Exposes simple deposit and withdrawal interfaces for integration into wallets, DEXs, and DeFi platforms.

{% hint style="info" %}

#### What’s next?

Now that you’ve seen how AllSet works under the hood, head over to the [AllSet usage docs](https://docs.pi2.network/user-guides/omniset-and-omniswap/omniset-usage-guide) to explore it in action!
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fast.xyz/fast-archived/applications/allset-and-allswap.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
