Skip to content

FluidTokens/ft-cardano-btc-eth-accounts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aiken Smart Contracts for Bitcoin Wallet Integration

This repository contains smart contracts written in Aiken designed to integrate Bitcoin and EVM wallet signatures into the Cardano blockchain ecosystem.

Validators Folder

  • 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.

Project Flow

  1. 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

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

  1. 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.

Here an example of transaction explorer that allows staking delegation to a specific stake pool

image

A Cardano wallet is able to allow the transaction using the signature of the bitcoin wallet

  1. 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.
  2. Compatible wallets -XVerse -Unisat -Leather -MagicEden -OKX

image

Step by step guide

  • 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

Offchain signature

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

Key Features

  • 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published