How Ren used 3Box to enable BTC<>ETH swaps
3Box partner series highlights 3Box partners and their innovative use cases.
Last month Ren launched RenVM: a private, permissionless and decentralized way to transfer assets across chains. This enables inter-blockchain liquidity, locking up assets on one blockchain and minting them on another. Just a month after launch, $20M worth of crypto has been sent through the network.
To facilitate these swaps Ren built RenBridge, a decentralized application that allows individuals to mint real Bitcoin, ZCash and Bitcoin Cash on Ethereum as an ERC20, and then convert these ERC20s back. This lets holders of those currencies leverage them in Ethereum, including the exploding DeFi ecosystem.
To make this work with complete resilience and user privacy, Ren leveraged 3Box spaces to store in flight transactions.
The challenge: pending transactions
RenBridge provides a simple interface to lockup assets on one chain and mint them on another.
Transactions on Ren can take ~1 hour or more as it’s necessary to wait for deposits on other chains to be safely confirmed before minting ERC20s on Ethereum. During this period, RenBridge needs to keep track of the pending transaction.
One option would be local storage. However, this is a very fragile place to store data critical to the transaction, which may be for large sums. If a user were to clear their browser, suffer a crash, or simply change computers then the record of the transaction would be lost.
Another option would be to run a database keeping track of user addresses and transaction IDs. However, this creates a single point of failure and centralization, with reliance on Ren (or other server operators) for an otherwise decentralized process.
The relevant info could be stored in a smart contract, but this creates cost, complexity and may compromise user and transaction privacy.
The solution: “global local storage” with 3Box
Ren turned to 3Box to backup transactions so there would be a record of all past and pending transactions associated directly to a users keys.
From Ren’s documentation:
3Box syncs with Metmask to store your past transaction(s) on RenBridge. So if you shut down your computer, close your browser, etc. while waiting for Confirmations, you can find or pick up your past/pending transaction.
By using 3Box, Ren could assure that transactions were tracked for users without running their own centralized DB to keep track. Instead, each user could maintain their own log of transactions, fully in their control and fully available across their devices.
It also made it possible for them to build more quickly without the need to build a centralized backend. Eventually, Ren did add their own storage solution to keep track of pending transactions to completely ensure safe tracking and value transfer themselves, as more than $20M flowed through their protocol in the first weeks.
Ren is quickly growing into the top BTC<>ETH bridge, and helping power the current wave of DeFi activity. They will be expanding the assets they support over time. Try out RenBridge at renproject.io and follow them on twitter @RenProtocol for more coming soon.