Cardano Wrapped Smart Contracts

Wrapped Smart Contracts empower every user to seamlessly execute transactions involving native Cardano tokens, eliminating the need for token bridging or connecting an EVM wallet.

By simply connecting your Cardano wallet to the Blueshift app, you unlock the ability to use native Cardano tokens from your Cardano wallet for any of supported operations:

  • Local swapping Cardano native tokens for Cardano tokens.

  • Cross-chain swapping Cardano native tokens across different networks supported by the app (tokens can be received in any EVM-compatible wallet).

  • Adding liquidity by depositing native Cardano tokens into your portfolio and withdrawing

  • Engaging in farming and staking activities.

How It Operates

Wrapped Smart Contracts (WSC) facilitate direct engagement with EVM smart contracts using your Cardano wallet. This means that all operations involving EVM smart contracts are signed by users via their Cardano wallets and then executed within the EVM network.

WSC interacts with smart contracts deployed on the Mikomeda network (Cardano Layer 2) in the following manner:

  • Users connects their Cardano wallet to the application.

  • WSC provide an EVM address of actor wallet in the Mikomeda network, which associated with the user's Cardano wallet address. The user doesn’t have direct access to the actor wallet or its private keys, but instead communicates with it by sending messages signed with the Cardano wallet to WSC. Hence, only the Cardano wallet owner can initiate transactions from the actor wallet. The balance visible in the Blueshift app when using the Cardano network contains the sum of Cardano wallet and actor wallet balances.

  • Users trigger operations via the Blueshift App.

  • The Blueshift App checks if the user's actor wallet has enough balance to perform the operation and cover fees.

  • Insufficient actor wallet balance prompt the Blueshift App to forge a token bridging transaction from the Cardano wallet to the actor wallet. Users confirm this transaction using connected Cardano wallet.

  • Once the actor wallet has sufficient funds, the Blueshift App initiates token spending approval for the Blueshift contract and the user's targeted operation (swap, liquidity provision, etc.). Users sign each of these operations with their Cardano wallet, and send the signed messages to WSC. The WSC validates these signatures and initiates the transactions through the Blueshift contract within the EVM network. Gas fees for all EVM network operations are deducted from the actor wallet balance. If the destination network of the target operation is an EVM network, the user receives funds directly to their EVM wallet after the operation's completed. However, if the destination network is Cardano, the user gains the funds in their actor wallet.

  • Once funds reach the actor wallet, the Blueshift App initiates the token bridging process from the actor wallet to the connected Cardano wallet. Users provide their Cardano wallet signature to authorize these actions. WSC acknowledges these messages, identifies users through their Cardano signatures, and launches the token spending approval for the bridge contract along with the bridging operation itself.

  • Finally, users receive their funds in the connected Cardano wallet.

The described process is fully automated within the Blueshift App. The necessity of each step depends on the operation type and the actor wallet balance. The users should confirm each action individually by signing messages via connected Cardano wallet.

If users engage in an operation that needs all the steps, they need to confirm 5 steps using connected Cardano wallet:

  1. Confirm the token bridging transaction from Cardano to the actor wallet.

  2. Confirm the token spending for the Blueshift contract from the actor wallet address.

  3. Confirm the user's target operation executed via the Blueshift contract.

  4. Confirm the token spending for the bridge contract from the actor wallet address.

  5. Confirm the bridging operation.

External factors might cause an operation to fail at any step beyond our control. In such scenarios, users' funds may remain within the actor wallet. To withdraw these funds, users can choose from two options:

  1. Perform any operation involving the remaining tokens within the actor wallet for an amount no less than the actor wallet balance (visible within the tooltip next to any balance). Funds required for the operation will first be deducted from the actor wallet, and if necessary, the remaining balance will be bridged from Cardano.

  2. Perform a token swap to itself. In this situation, if the destination network is Cardano, the app can use only the actor wallet balance, enabling users to withdraw all funds from the balance with a simple click of the "Max" button within the input field.

Withdrawing ADA from the actor wallet to the Cardano network is only feasible with a sufficient ADA balance within the actor wallet to cover fees and bridging lockup (5 ADA). To withdraw less amount of ADA from actor wallet, users can initiate an ADA swap into another native Cardano token. Within the swap all ADA tokens can be withdrawn from the actor wallet to Cardano in the form of a another token.

Last updated