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. -
btc.ak is the contract to interact using bitcoin wallets, frontend is ready
-
eth.ak is the contract to interact using evm wallets, frontend in progress
- 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.
![image](https://private-user-images.githubusercontent.com/42917076/370066721-3c60f36d-29b7-4c67-9c9a-4dd21dbc8a30.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjYyMzAsIm5iZiI6MTczOTE2NTkzMCwicGF0aCI6Ii80MjkxNzA3Ni8zNzAwNjY3MjEtM2M2MGYzNmQtMjliNy00YzY3LTljOWEtNGRkMjFkYmM4YTMwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA1Mzg1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNhOGNlNjk3MDRhMzZkNDQxMDY3NmU3OTUzNTRkYTJmNGI4ZDI1OWFhZGM5NDcwNjhlZjljMmNhYzNkZTg0ZWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.vafhGndgPhsXGzYkG3-SH_f3iGfkE8viZG2eumfn248)
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
![image](https://private-user-images.githubusercontent.com/42917076/370067217-3c0b9495-0a89-403f-8dc1-80df79d9a6e8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjYyMzAsIm5iZiI6MTczOTE2NTkzMCwicGF0aCI6Ii80MjkxNzA3Ni8zNzAwNjcyMTctM2MwYjk0OTUtMGE4OS00MDNmLThkYzEtODBkZjc5ZDlhNmU4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA1Mzg1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiYTI1NjIwZjE2NzBmOWU5YzcwOTFhNTU0NzA2ZDBiZDg0NDFkYzBiODc1NDEwNGVmZGE2MmZiYzAyMjQzNzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.j6YX4Vrkr5cFN6uO6b14YqXL-ZWJU3mkk8JvgMk9g5c)
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 Here is a list of wallets compatible with our platform, including their website links and supported networks:
XVerse
- Website: https://xverse.app
- Supported Networks: Bitcoin, Bitcoin Ordinals (Layer 2), Stacks
- Details: XVerse is a multi-network wallet focused on Bitcoin and its ecosystem, offering support for both Bitcoin transactions and Layer 2 solutions like Ordinals.
Unisat
- Website: https://unisat.io
- Supported Networks: Bitcoin, Bitcoin Ordinals
- Details: Unisat is a web-based wallet tailored for Bitcoin and Ordinals, emphasizing simplicity and fast transactions on the Bitcoin network.
Leather
- Website: https://leather.io
- Supported Networks: Bitcoin, Bitcoin Ordinals
- Details: Leather is a Bitcoin-focused wallet offering secure storage and transaction capabilities, with added support for Ordinals.
Magic Eden
- Website: https://magiceden.io
- Supported Networks: Bitcoin, Ethereum, Solana, Polygon
- Details: Primarily known as a marketplace, Magic Eden also offers wallet services with multi-chain support, enabling transactions across various blockchains.
OKX
- Website: https://www.okx.com
- Supported Networks: Bitcoin, Ethereum, Solana, Avalanche, and more
- Details: OKX is a versatile platform offering wallet services along with trading and staking capabilities, supporting a wide range of networks.
This list ensures users can select the most suitable wallet based on their network preferences and needs.
![image](https://private-user-images.githubusercontent.com/42917076/370067524-02303f7d-d869-4bd3-9b34-d742b5bb84e4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNjYyMzAsIm5iZiI6MTczOTE2NTkzMCwicGF0aCI6Ii80MjkxNzA3Ni8zNzAwNjc1MjQtMDIzMDNmN2QtZDg2OS00YmQzLTliMzQtZDc0MmI1YmI4NGU0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA1Mzg1MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTYxMmU2NmU3YjVlZGIyNWIxNTEwMzM5MjE2ZTc5MzkzYzkxNWU2MDdiMjc1ZjZiNTY0ZmEyNzVjZDcwNDdkYmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.S6e7jqDdjGl_BJEMePrzmKcdEm1-o_C3j0x14_h7agY)
The contract eth.ak is compatible with ethereum wallets signatures, allowing users to interact with Cardano using Ethereum wallets
Frontend allows to connect but is not yet fully working since it's the scope of next catalyst milestone.
MetaMask
- Website: metamask.io
- Supported Networks: Ethereum, Ethereum Layer 2 (Optimism, Arbitrum), Polygon, and more.
- Details: MetaMask is one of the most popular Ethereum wallets, allowing users to interact with Ethereum and other blockchain-based applications, including DeFi and NFTs.
Magic Eden (Ethereum)
- Website: magiceden.io
- Supported Networks: Ethereum, Polygon
- Details: In addition to its marketplace and multi-chain wallet services for Bitcoin and Solana, Magic Eden also supports Ethereum transactions.
- 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.