Transfuse is a transformative multichain asset bridge designed to enable secure, fast, and scalable asset transfers between Ethereum and Stellar networks without using wrapped assets. This Minimum Viable Product (MVP) focuses on implementing smart contracts on both Ethereum and Stellar (Soroban) to handle end-to-end (E2E) interactions for native USDC swaps.
The bridge leverages Stellar's fast, secure, and low-cost transactions to provide a seamless user experience while addressing inherent risks associated with cross-chain bridges.
- Multichain Asset Bridge: A system that enables the transfer of assets between different blockchain networks.
- Stellar: An open-source, decentralized protocol for digital currency to fiat money transfers.
- Ethereum (ETH): A decentralized, open-source blockchain with smart contract functionality.
- Soroban: Stellar's smart contract platform built using Rust.
- Smart Contract: Self-executing contracts with the terms directly written into code.
- USDC: USD Coin, a stablecoin pegged to the US dollar.
- Validator: A node that verifies transactions within a blockchain network.
- Non-Custodial: A system where users maintain control over their private keys and assets.
- Atomic Swap: A mechanism that enables the exchange of cryptocurrencies across different blockchains without intermediaries.
- E2E (End-to-End): A complete process from the starting point to the final destination.
- Security Requirements: Must safeguard against attacks such as hacks, man-in-the-middle exploits, and smart contract vulnerabilities.
- Scalability: Designed to handle increasing transaction volumes without performance degradation.
- Performance Constraints: Low latency and high throughput are essential for a seamless user experience.
- Decentralization: The system must be non-custodial and decentralized to avoid single points of failure.
- Regulatory Compliance: Must adhere to relevant financial regulations, especially concerning cross-chain asset transfers.
- User Experience: Prioritize an intuitive and straightforward user interface to encourage adoption.
At this level, the Transfuse system interacts with external entities:
- Users: Individuals initiating asset swaps between Ethereum and Stellar networks.
- Ethereum Network: Source or destination network for USDC tokens.
- Stellar Network: Source or destination network for USDC tokens.
- Wallet Providers: Applications like MetaMask (Ethereum) and Freighter (Stellar) used for transaction signing.
- Validators: Nodes responsible for observing transactions and facilitating cross-chain communication.
- Oracles: Services that provide cross-chain data verification.
The Transfuse system consists of the following main containers:
-
Frontend Application:
- Description: User interface for initiating swaps, connecting wallets, and viewing transaction history.
- Technologies: React.js, TypeScript, Wallet integration libraries.
- Responsibilities:
- Provide swap functionality.
- Handle wallet connections.
- Display transaction statuses and history.
-
Backend API:
- Description: Manages business logic and communicates with smart contracts and validators.
- Technologies: Node.js, Express.js, TypeScript.
- Responsibilities:
- Handle API requests from the frontend.
- Communicate with validator nodes.
- Manage transaction records.
-
Smart Contracts:
- Ethereum Smart Contract:
- Function: Manages locking of USDC on Ethereum.
- Technologies: Solidity.
- Stellar (Soroban) Smart Contract:
- Function: Manages releasing of USDC on Stellar.
- Technologies: Rust (Soroban).
- Ethereum Smart Contract:
-
Validator Nodes:
- Description: Monitor blockchain events and facilitate cross-chain swaps.
- Technologies: Node.js services connected to blockchain nodes.
- Responsibilities:
- Observe events on both blockchains.
- Validate transactions.
- Trigger corresponding actions on the opposite chain.
-
Oracle Service:
- Description: Provides data consistency and verification between Ethereum and Stellar networks.
- Technologies: Node.js, Blockchain APIs.
- Responsibilities:
- Verify cross-chain transactions.
- Ensure atomicity of swaps.
Description:
-
Ethereum Smart Contract:
- Develop a Solidity contract to lock USDC tokens when a user initiates a swap.
- Functions include initiating swaps and emitting events for validators.
-
Stellar (Soroban) Smart Contract:
- Develop a Soroban contract to release USDC tokens on Stellar upon validation.
- Functions include releasing tokens and confirming swap completion.
User Stories:
- As a user, when I initiate a swap from Ethereum to Stellar, my USDC on Ethereum is securely locked.
- As a user, I receive the equivalent amount of USDC on Stellar after the swap is validated.
UX Designs:
- Swap Initiation Screen: Allows users to enter swap details and initiate the transaction.
- Confirmation Screen: Displays transaction details and confirmation prompts.
Description:
- Update validator nodes to monitor smart contract events on both Ethereum and Stellar.
- Update oracle service to verify and relay transaction information between networks.
- Ensure validators reach consensus before triggering asset release.
User Stories:
- As a user, I can trust that my cross-chain transactions are validated and secure.
- As a user, I receive timely updates on the status of my swaps.
Technical Details:
- Validators observe
SwapInitiatedevents on Ethereum. - Validators confirm transaction validity and communicate with the Soroban contract.
- Oracle service ensures data integrity and consistency.
Description:
- Integrate the frontend application with the new smart contracts and validator services.
- Implement wallet connections for MetaMask (Ethereum) and Freighter (Stellar).
- Enhance the user interface to provide real-time transaction status updates.
User Stories:
- As a user, I can connect my Ethereum and Stellar wallets seamlessly.
- As a user, I can initiate swaps and view the progress in real-time.
- As a user, I have access to my transaction history and current balances.
UX Designs:
- Wallet Connection Prompts: Guide users to connect their wallets.
- Transaction Status Indicators: Show progress of swaps (e.g., pending, completed).
- Error Handling: Provide clear messages in case of issues.
Purpose:
- Securely lock USDC tokens when a swap is initiated.
- Emit events for validators to detect and process swaps.
Key Methods:
initiateSwap(uint256 amount, address stellarAddress): Locks USDC and records the recipient's Stellar address.getSwapDetails(uint256 swapId): Retrieves details of a specific swap.cancelSwap(uint256 swapId): Allows users to cancel pending swaps (if applicable).
Security Considerations:
- Input Validation: Ensure valid amounts and addresses.
- Event Emission: Emit
SwapInitiatedevent with swap details. - Reentrancy Guard: Protect against reentrancy attacks.
Purpose:
- Release USDC tokens to the user on Stellar upon validation.
- Ensure that swaps are only completed after proper verification.
Key Methods:
releaseTokens(uint256 amount, Address ethereumAddress): Releases USDC to the user's Stellar address.verifySwap(uint256 swapId, uint256 amount, Address ethereumAddress): Validates the swap before releasing funds.
Security Considerations:
- Authorization: Only allow actions from trusted validator nodes.
- Atomicity: Ensure that token release is atomic and cannot be interrupted.
- Event Logging: Emit events for swap completions.
-
User Initiates Swap:
- User enters the amount and Stellar address on the frontend.
- Frontend prompts the user to sign the transaction using MetaMask.
-
Ethereum Smart Contract:
- Executes
initiateSwap, locking the USDC amount. - Emits
SwapInitiatedevent with swap details.
- Executes
-
Validator Nodes:
- Monitor Ethereum for
SwapInitiatedevents. - Validate the transaction details (amount, sender, recipient).
- Reach consensus on the validity of the swap.
- Monitor Ethereum for
-
Oracle Service:
- Confirms the Ethereum transaction and relays information to Stellar.
-
Stellar Soroban Contract:
- Validators invoke
releaseTokenswith validated swap details. - USDC is released to the user's Stellar address.
- Emits an event indicating swap completion.
- Validators invoke
-
Frontend Application:
- Updates the user on swap status (e.g., "Swap Completed").
- Displays transaction details and confirmation.
-
Language: TypeScript
-
Framework: Node.js with Express.js
-
Smart Contracts:
- Ethereum: Solidity (version compatible with current standards)
- Stellar (Soroban): Rust
-
Validator and Oracle Services:
- Implemented as Node.js applications.
- Utilize Web3.js for Ethereum and Stellar SDK for blockchain interactions.
-
Language: TypeScript
-
Framework: React.js with Next.js
-
State Management: React Query (TanStack Query)
-
Form Validation: Zod
-
Wallet Integration:
- Ethereum: MetaMask via Ethers.js or Web3.js
- Stellar: Freighter via Stellar SDK
-
Hosting:
- Frontend: Deployed on platforms like Vercel or Netlify.
- Backend and Validator Services: Hosted on cloud providers (e.g., AWS, Google Cloud, DigitalOcean).
-
Blockchain Nodes:
- Ethereum: Access via Infura or Alchemy.
- Stellar: Use public Horizon servers or host own nodes for increased reliability.
-
Security Measures:
- SSL/TLS encryption for all communications.
- Implementation of rate limiting and input sanitization.
- Regular security audits and code reviews.
-
Smart Contracts:
- Ethereum: Truffle or Hardhat frameworks with Mocha and Chai.
- Stellar (Soroban): Rust testing frameworks and Soroban CLI.
-
Backend and Frontend:
- Unit Tests: Jest for JavaScript/TypeScript code.
- Integration Tests: Supertest for API endpoints.
- End-to-End Tests: Cypress for simulating user interactions.
-
Wallet Providers:
- MetaMask (Ethereum)
- Freighter (Stellar)
-
Blockchain Services:
- Use of blockchain APIs for real-time data (e.g., Etherscan API, Stellar Horizon API).
-
Third-Party Services:
- Optional: Circle's Compliance Console for KYC/AML compliance in future iterations.
- Monitoring tools like Sentry for error tracking.
By focusing on implementing secure and efficient smart contracts on both Ethereum and Stellar networks, Transfuse's MVP aims to provide a robust solution for cross-chain asset transfers. The emphasis on eliminating wrapped assets and providing a non-custodial, decentralized bridge addresses significant pain points in the current blockchain ecosystem.
This foundational work sets the stage for future enhancements and broader adoption, aligning with the mission to make blockchain more accessible and trustworthy.