Coinweb Integration Deep Dive
A deep dive into Coinweb integration.
PACT SWAP is the first-of-its-kind cross-chain decentralized exchange that enables direct swaps of native assets (like BTC, ETH, TRX, etc.) and any token standards (like ERC20, BEP20, TRC20, etc.) without bridges or wrapped tokens. PACT SWAP is built on Coinweb’s innovative PACT framework - Penalty Adjudication for Cross-Chain Transactions, a mechanism designed by Coinweb for secure, low-cost cross-chain transactions. By leveraging the PACT framework, PACT SWAP achieves trustless cross-chain swaps using only smart contracts on the involved blockchains (no separate consensus system or external validators required)
This documentation page explains how PACT SWAP uses Coinweb’s PACT technology to deliver trustless, capital-efficient cross-chain swaps, in a way that’s accessible to both technical and non-technical readers. How is this different? Traditional cross-chain DEXs or bridges often rely on intermediate networks or validators to move tokens between chains, introducing cost, complexity, and risk. In contrast, PACT SWAP executes swaps entirely via smart contracts and a collateral-backed penalty system – eliminating centralized points of failure typical in bridges.
The result is a secure system where either the swap completes as intended or the innocent party is automatically compensated via collateral, with no need to trust a third party. We’ll start with the key benefits and an overview of how it works. Deeper technical insights are available in collapsible sections for those interested. Let’s dive in!
Key Benefits of PACT SWAP (Powered by PACT) Trustless, Secure Swaps
All cross-chain swaps are facilitated and validated by on-chain smart contracts rather than any off-chain relays or custodians. There’s no need to trust a separate network of validators – the only “validators” are the underlying L1 blockchains’ own consensus. This trustless design means users aren’t relying on a middleman; if one party fails to deliver, the PACT mechanism will automatically compensate the other party (so funds are safe). No Separate
Consensus or Validators
Coinweb’s PACT framework does not introduce a new blockchain or consensus layer in between chains. Instead, it deploys reactive smart contracts on Coinweb’s Layer-2 that observe and react to events on the connected L1 chains. This eliminates the need for a dedicated validator infrastructure or wrapped tokens. Swaps are confirmed by the native chains’ own consensus (e.g. Bitcoin, Ethereum) and coordinated by PACT, so no external voting or multi-sig approval process is required. Fewer moving parts mean reduced attack surface and complexity.
Capital Efficiency via Just-in-Time Collateral
PACT swaps use collateral deposits (in CWEB tokens) only for the duration of the swap, rather than locking up large pools of liquidity long-term. Collateral is dynamically adjusted based on the trade’s size and risk, and it’s released as soon as the swap completes. This just-in-time approach drastically lowers the cost of securing cross-chain trades – reducing fees by an estimated 50–95% and collateral requirements by many magnitudes compared to traditional bridge systems.
Example
A swap requires ~200% of the trade value in collateral for only a few minutes; the opportunity cost of that short lock-up is negligible (in the order of cents) enabling capital-efficient cross-chain swaps, compared to consensus-based systems where 100’s of millions of dollars may be locked up for extended periods of time.
Modular Settlement Options
The PACT framework is flexible – it supports multiple settlement methods. Whether the swap is settled peer-to-peer between two individuals, via the Lightning Network (Bitcoin’s layer-2 payment channels), or through decentralized vault contracts holding funds, PACT can accommodate it. The smart contract “sentinel” system works universally to enforce the outcome, regardless of how the assets are transferred. This modularity means PACT SWAP can integrate new transfer methods easily (e.g. integrating Lightning for instant BTC transfers) while still relying on the same penalty-adjudication security model. In short, PACT doesn’t dictate how the value moves—any method can be plugged in—as long as the required events on each chain occur (or not, in which case collateral penalizes the defaulter).
Permissionless Listing of Tokens
Because PACT SWAP is purely smart contract-based, it allows permissionless listing of any token pair. There’s no centralized gatekeeping or need to issue wrapped tokens; if a blockchain is supported by Coinweb, its native assets and token standards can be directly swapped on PACT SWAP. This empowers communities and projects to list and trade their tokens freely across chains, expanding cross-chain liquidity without lengthy approval processes.
Seamless Integration & Composability
PACT SWAP’s design makes it highly composable with other DeFi protocols. There’s no proprietary hardware or node setup—partners and developers can interact with PACT SWAP via its smart contracts or API just like any single-chain DEX. For example, a DEX aggregator or wallet can plug into PACT SWAP to offer users cross-chain swaps. Integration is straightforward and cost-efficient, since there’s no need for the partner to maintain a separate bridge or consensus mechanism. This composability invites a host of use cases: cross-chain swaps can be embedded in wallets, yield strategies, or other dApps, broadening the reach of PACT SWAP’s technology.
How It Works: Cross-Chain Swaps with PACT (Overview)
In summary, PACT SWAP provides trustless security, avoids extra infrastructure, maximizes capital efficiency, and offers flexibility and openness — a combination that is transforming cross-chain DeFi without sacrificing decentralization. How It Works: Cross-Chain Swaps with PACT (Overview) Let’s walk through a simplified swap scenario to illustrate how PACT SWAP leverages the PACT mechanism. Suppose Alice wants to swap 1 BTC on Bitcoin for an equivalent value of ETH on Ethereum using PACT SWAP:


Liquidity Provider adds an order on PACT SWAP
The Liquidity Provider (LP) places a swap order on PACT SWAP. This includes the rate, the assets offered, and the chains involved. The LP also locks up collateral worth 2x the value of the swap in the Collateral Vault Smart Contract. This collateral guarantees the LP's commitment to completing the swap.
Collateral is secured in the Collateral Vault
The order and its corresponding collateral are recorded and locked on-chain. The Collateral Vault secures these funds while the order is active.
Alice selects the order via the PACT SWAP UI
Once the LP's order is live, it becomes visible in the PACT SWAP interface. Alice, the user, sees the available order to swap 1 BTC for the corresponding amount of ETH and agrees to proceed.
Alice sends 1 BTC on the Bitcoin blockchain
Alice sends her 1 BTC to the LP's provided address. A Chain Transaction Sentinel (CTs) — a reactive smart contract on Coinweb — monitors the Bitcoin chain for this deposit.
Chain Transaction Sentinel (CTs) observes and reports events
Once the CTs detects the BTC transaction, it reports the event to the Penalty Adjudicator (PA) on Coinweb. The PA verifies the event and signals the LP to send the agreed amount of ETH to Alice's Ethereum address. The LP then sends the equivalent amount of ETH to Alice on Ethereum, while another CTs watches for this transaction on the Ethereum blockchain.
The Penalty Adjudicator makes a decision
Once both transactions are confirmed, the PA checks if the PACT (swap terms) was fulfilled. If the LP followed the PACT and the correct amount of ETH arrived in Alice's Ethereum wallet, the PA releases the collateral back to the LP. If the LP failed to follow the PACT to send the correct amount of ETH, the PA detects the breach and releases the LP's collateral to Alice as compensation.
This system ensures that Alice is either fully compensated via the locked-in collateral or receives her ETH — no third-party validators, bridges, or consensus layers needed. The entire process is monitored by smart contracts, with Chain Transaction Sentinels observing state changes on both Bitcoin and Ethereum. The Penalty Adjudicator ensures the correct decision is made based on those observations.
Key Components of the PACT System
To better understand how PACT SWAP achieves the above, let’s break down the core components and terms within Coinweb’s PACT technology:
Reactive Smart Contracts (RSCs)
A reactive smart contract is one that can self-trigger in response to blockchain events, rather than only executing when directly called. Coinweb’s infrastructure allows smart contracts to listen for specific events (like a deposit to an address) and then wake up to perform predefined actions. These run on Coinweb’s Layer-2 and are blockchain-agnostic, meaning they can interact with multiple different chains. In PACT, the Sentinels and the Penalty Adjudicator are all reactive smart contracts coordinating the swap.
Chain Transaction Sentinels (CTs)
Sentinels are the watcher contracts. A CT is a reactive smart contract that monitors state changes on a particular blockchain and gathers cryptographic proof of those events. For each blockchain involved in a swap, there is a Sentinel following the relevant addresses or transactions. In our example, one Sentinel watches the Bitcoin network for Alice’s BTC transaction, and another watches Ethereum for the participant’s ETH payment. These CTs operate independently on Coinweb’s platform, continuously observing their target chain’s state. They report observations (e.g. “1 BTC received at address X in block Y”) to the Penalty Adjudicator.
Penalty Adjudicator (PA)
The PA is the “judge” contract in the PACT framework. It aggregates the proofs from all involved Sentinels and checks them against the agreed-upon swap agreement (state machine). The PA essentially knows what the valid sequence of events should be (e.g. “BTC deposit then ETH deposit within 30 minutes”). If the Sentinels’ reports show that sequence was fulfilled, the PA concludes the swap was successful and will release any collateral back to the appropriate party. If something is missing or wrong (e.g. the ETH never arrived), the PA assigns blame to the offending side and enforces the penalty: releasing the locked collateral to compensate the wronged party. The PA contract’s logic is defined such that it can deterministically decide the outcome based on on-chain evidence, without favoritism.
Collateral (CWEB token)
Collateral is the economic security at the heart of swaps through the PACT framework. In PACT SWAP, collateral is provided in $CWEB, Coinweb’s native token. Before a cross-chain trade begins, the party obligated to perform the second leg (the liquidity provider) deposits 2x the value of the trade worth of $CWEB into the PA contract as collateral. This amount exceeds the fiat value of the asset they promise to deliver (to cover price movements or any incentive to cheat). If they fulfill their obligation, they get this collateral back. If they fail, the collateral is given to the other user.
Collateralization ensures trustless security
Even if two strangers are swapping, neither can betray the other – the worst that can happen is a swap fails and the buyer gets their money back (via collateral). Importantly, PACT’s design is capital-efficient: collateral is isolated per swap and released immediately when done, rather than pooled in a giant reserve. So a participant can reuse their capital across many swaps sequentially, and multiple swaps run in parallel each with their own isolated collateral pool.
Coinweb's Infrastructure
PACT operates on top of Coinweb’s unique Layer-2, which acts as a cross-chain execution layer. Coinweb’s platform is described as a hybrid between a cross-chain system and a rollup, with full L1 and L2 data availability and a “consensusless” design. Consensusless means Coinweb doesn’t introduce new consensus mechanisms; instead, it relies on the finality of connected L1 chains and orders cross-chain operations without its own miners/validators. In practical terms, Coinweb’s L2 coordinates the reactive contracts (PA and CTs) and ensures they have an up-to-date, consistent view of each connected blockchain’s state. It handles tricky issues like blockchain re-orgs automatically – if a chain reverts and reorganizes, Coinweb’s state “unwinds and re-computes” so that the Sentinels ultimately report the true finalized state. This provides a robust foundation where PACT smart contracts always act on confirmed information. Coinweb’s infrastructure thus underpins PACT SWAP’s ability to trust multiple chains’ data without running a full consensus of its own, reducing complexity and cost for cross-chain apps.
Was this documentation helpful? Any suggestions?
Last updated on