CORAL v2 is an intent protocol for retail, traders, dapps, and other global Web3 users to swap tokens cross-chain with the speed and cost of centralized exchange order books, while remaining decentralized, non-custodial, and secure. A unique property of CORAL v2’s architecture is that its implementation of custom transaction signing policies via Cubist Confidential Cloud Functions eliminates the need for quote expiry, a primary driver of transaction failures and price slippage in cross-chain swaps.
“We're thrilled to partner with Cubist to supercharge Squid's cross-chain liquidity network. By leveraging Cubist Confidential Cloud Functions, we've replaced on-chain smart contracts with private, off-chain logic, enabling sub-second swaps across EVM, non-EVM, and even non-smart contract chains like Bitcoin, all with higher reliability and better pricing.
We chose Cubist for their unmatched security and non-custodial standards, ensuring we advance next-gen crypto tech while upholding decentralization. I'm excited for our ongoing collaboration, delivering seamless solutions for institutions and retail users alike.”
-Fig, Co-Founder of Squid
Cubist Confidential Cloud Functions enable private smart contracts
Our newly launched Cubist Confidential Cloud Functions (Cubist C2F) lets you write your own custom code inside Trusted Execution Environments (TEEs) and get cryptographic proof that the code you wrote is what’s running. By combining Cubist C2F with our key management platform, CubeSigner, it’s possible to enforce smart contract logic without executing code on chain. Such “private smart contracts” use C2F to execute arbitrary, off-chain code that controls whether or not a CubeSigner key signs a transaction. Since this smart contract logic executes off-chain, in a TEE, it’s able to control fund movement while computing on secret data, interacting with external systems, checking state across multiple chains, and more.
CORAL v2 is made possible by Cubist Confidential Cloud Functions
The previous version of CORAL used traditional smart contracts on different chains in combination with General Messaging Passing (GMP) protocols to create, fulfill, and settle orders. This meant that CORAL was limited to the chains supported by the underlying GMP protocols, and it required Squid to develop and maintain distinct infrastructure for every new chain integration. In addition, swaps took multiple seconds because they had to wait for block finality, and they incurred higher gas costs because of smart contract code run on the destination chain. The 30-to-60-second quote expiry, which is standard with decentralized cross-chain protocols, caused failures when users took too long to accept their quote (e.g., if trying to manually approve via a multisig)—and caused market makers to quote higher prices for the trade to account for potential slippage or gas price volatility.
CORAL v2 replaces on-chain smart contracts and GMP protocols with Cubist C2F private smart contracts, which let Squid reduce swaps to batch settlements of simple token transfers. Squid chose CubeSigner and Cubist C2F for CORAL v2 for several reasons:
- To reduce execution time for swaps from 5 seconds to <1 second—without impacting Squid’s strong decentralization or permissionless properties.
- To expand chain support across EVM, non-EVM, and non-smart contract chains (like Bitcoin and Dogecoin) without having to write and maintain separate infrastructure for every new chain.
- To reduce failure rates by removing the need for quote expiry. No quote expiry means no failures due to high gas price, exchange rate volatility, or users taking too long to accept their quote.
- To cut costs to users by moving swap logic off-chain and batching settlements. This means that gas costs stay constant as the number of transactions increases, all while pushing price competition to market makers who no longer need to price in expected volatility for expiries.
How Cubist Confidential Cloud Functions enable private smart contract logic across incompatible chains
CORAL v2 uses Cubist C2F to maintain decentralization and permissionlessness while pulling as much application logic off chain as possible. Instead, this logic is now written in Rust and executed in a WebAssembly (Wasm) runtime running in a TEE. The Cubist platform compiles Squid’s Rust code to Wasm, a bytecode format that offers isolation by design, and runs it off-chain as part of the CORAL v2 transaction signing flow. Bringing logic off-chain allows Squid to compute privately, cheaply, and in an inherently cross-chain way.
C2F allows developers to write arbitrary logic, which is important for implementing secure, high-performance, many-chain systems like the CORAL protocol. CORAL scales exceptionally well by batching settlement transactions in a hub-and-spoke fashion—meaning one transfer on Ethereum can settle cross-chain swaps from Ethereum to Solana, Bitcoin, Base, Arbitrum, etc.. It works like this:
- The user transfers funds on the source chain to the CORAL spoke address (i.e., a CubeSigner escrow wallet governed by a private smart contract), encoded with their order details (“I want to swap 50 USDC on Ethereum for 0.000011 BTC on Bitcoin.”).
- Market makers bid in an auction to fill the swap, and the winning market maker fills the order by sending funds from their own wallet on the destination chain to the user’s wallet on the destination chain. As an intermediate step, market makers can swap via a DEX if needed e.g., if the market maker isn’t currently holding the token in their inventory.
- The Cubist C2F private smart contract logic running inside the TEE inspects the source chain ledger and the destination chain ledger to verify that Steps 1 and 2 completed successfully, and that the token amounts transferred match the order details.
- If the checks pass, CubeSigner signs a transaction sending the user’s funds from the spoke address—the escrow wallet—on the source chain to the market maker’s address on the source chain to complete the swap.
With this method, there is no message passing between chains. All smart contract logic is enforced off-chain by hardware.
Explore off-chain programmability for your use case
Cross-chain swaps are just one example of what teams are building with Cubist C2F. We view private smart contracts, and programmable key management more generally, as technology enablers for new kinds of natively cross-chain projects without the complexity, slowdown, and security implications of traditional bridges and oracles.
Want to see it in action? Try Squid’s CORAL v2 and discover how C2F unlocks a smoother cross-chain experience.
Check out our step-by-step tutorial on building cross-chain atomic swaps with C2F, learn more about the system architecture in our whitepaper, or get in touch to request a demo here.
Keep reading
- Review the C2F Press Release.
- Read the C2F for Private Smart Contracts and Verifiable Off-Chain Code blog post.
- Dive into the C2F whitepaper to learn more about the system architecture.
- Check out the C2F tutorial on how to build Private Smart Accounts.
- Discover C2F for writing and enforcing cross-chain wallet policies.

