TakeFi
Bitcoin cross-chain oracle for RWA token Swaps
Created on 29th June 2025
•
TakeFi
Bitcoin cross-chain oracle for RWA token Swaps
The problem TakeFi solves
Takefi is a decentralized protocol that enables users to swap native Bitcoin for Real-World Asset (RWA) tokens on Avalanche, without relying on wrapped tokens, custodians, or bridges. It combines Hash Time-Locked Contracts (HTLCs), Chainlink Functions, and market maker liquidity to facilitate atomic and trustless swaps between BTC and RWA tokens on EVM chains.
How It Works
🧑💻 User Flow
- The user holds native Bitcoin and wants to acquire RWA tokens (e.g., XCOINB) on Avalanche.
- They lock their BTC in a Bitcoin HTLC script with a time-lock.
- Once conditions are met, they receive RWA tokens directly on Avalanche.
🏦 Market Maker Role
- Provides pre-funded liquidity in both BTC and RWA tokens.
- Enables instant swaps by taking on temporary inventory and market risk.
- Earns fees from successful transactions
🔮 Chainlink Functions
- Acts as a decentralized oracle to glue together the cross-chain process.
- Monitors swap transactions on Avalanche and ensures their validity.
- Retrieves BTC preimages from the AWS Secrets Manager upon successful validation of the swap.
- Triggers BTC redemption when swap conditions are satisfied.
Technical Highlights
- Native Bitcoin Integration: No need for wrapped BTC or synthetic tokens, users interact directly with the Bitcoin blockchain.
- HTLC-based Atomic Swaps: Time-locked contracts ensure that either both legs of the swap complete, or neither do, maintaining user safety.
- Secure Preimage Handling: Preimages used for HTLCs are generated and retrieved via Chainlink Functions and securely managed with AWS Secrets Manager.
- Collateralized Market Makers: Liquidity providers post collateral to ensure delivery and are subject to slashing for misbehavior.
Infrastructure & Tools
- Chainlink Functions - Trust minimized off-chain computation and oracle services.
- Chainlink Data Feeds - Fetch accurate BTC and RWA prices in real-time.
- AWS Secrets Manager - Ensuring encrypted, reliable preimage storage.
- Avalanche - Hosting the RWA tokens and functions consumer smart contract.
- Backed.fi Assets - Existing RWA tokens leveraged for real-world exposure.
Challenges we ran into
One of the biggest hurdles was working with Bitcoin’s test environment. We had to make do with a lack of convenient tooling, especially when it came to scripting. We initially used the Bitcoin testnet, but ran into delays due to slow block times. To iterate faster, we switched to Bitcoin regtest, which allowed us to test the HTLC script in a more sandboxed environment. Developing and debugging the Bitcoin script was slightly challenging due to limited error feedback and a steep learning curve around script construction and signature handling. Sourcing testnet liquidity for RWA tokens was another bottleneck. We eventually moved to the Avalanche mainnet to work through this issue.
Tracks Applied (3)
Onchain Finance
Cross-Chain Solutions
Avalanche Track
Avalanche
Technologies used
Cheer Project
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.

