This repository contains smart contracts written in Aiken designed to integrate Bitcoin and EVM wallet signatures into the Cardano blockchain ecosystem.
- The
validators
folder contains the Aiken smart contracts responsible for signature validation. These contracts allow compatibility with Bitcoin wallets and EVM wallets, leveraging their public key infrastructure for secure interaction within the Cardano blockchain.
- Contract Address Generation:
- The smart contract generates a Cardano-compatible address using the public key of a Bitcoin wallet. This address is then tied to that Bitcoin wallet for future operations.
In the image we can see an example of contract address generated like this, how can we understand it's a contract, because credentials are the same of the plutus.json file generated by aiken
- Transaction Control:
- The generated address can only perform specific actions like:
- Sending assets
- Delegating to stake pools
- Withdrawing assets
- These actions require the explicit approval of the Bitcoin wallet owner. This is done through an off-chain signature mechanism.
- The generated address can only perform specific actions like:
Here an example of transaction explorer that allows staking delegation to a specific stake pool
A Cardano wallet is able to allow the transaction using the signature of the bitcoin wallet
-
Cross-Chain Authorization:
- How does a Bitcoin wallet submit a transaction on Cardano? It doesn’t.
- Instead, the Bitcoin wallet signs an off-chain message, authorizing a specific transaction.
- Once signed, anyone on Cardano can submit the corresponding transaction on behalf of the Bitcoin wallet. This is done according to the contract owner's predefined rules, ensuring secure and transparent execution.
- In exchange for submitting the transaction, the user is rewarded with a small fee in ADA.
- How does a Bitcoin wallet submit a transaction on Cardano? It doesn’t.
-
Compatible wallets -XVerse -Unisat -Leather -MagicEden -OKX
- Clone the repository
- Install aiken
- Generate the cardano address for Bitcoin wallet using the bitcoin user publiic key like this aiken blueprint apply -v btc.btc.spend 028f5ced5649da371758f280635f94a558c68eee2ac4c7f07034425e97c60352bd
- Use the signatures coming from the wallets docs
- Propagate the signature using any Cardano wallet
The signature mechanism is a signature of the intent done by the user using ECDSA signature that is a standard on Bitcoin, this is used because plutus is able to verify them with the function verify_ecdsa_secp256k1_signature
More about it can be find at here
- Cross-chain integration: Bitcoin and EVM wallet signatures can be used to authorize Cardano blockchain transactions.
- Decentralized execution: Cardano users can execute approved actions, reducing the burden on the Bitcoin wallet owner.
- Small incentives: Users submitting authorized transactions earn a small ADA reward for their service.