Bucketly

Bridging L1 to L2 one bucket at a time. A bucketful of txns fire off all at once to save 3x-5x fees on bridging.

Description

So you are a depositor who wants to transfer some asset from mainnet to polygon 1) You submit tokens into a bucket contract on mainnet L1 ethereum. You do this before some threshold has been met, basically a deadline for making it into one round of the bucket. 2) An off-chain Relay acts like a train conductor. He's monitoring the L1 contract for those deposit events. 3) This off-chain Relay then records those events in a database. 4) Once the countdown to the deadline is complete, and that reserve amount is reached, the off-chain relay generates a MerkleTree root hash using all the deposits for the current bucket. Basically a receipt of all the txns in the bucket. 5) The relay then initiates a transfer to Polygon by calling the L1 eth bucket contract. 6) The L1 bucket transfers funds to polygon on behalf of the L2 bucket address. 7) The Polygon plasma bridge confirms the transfer after some wait period. 8) You can now use the relay's API to generate a proof that the deposit happened. If you were really into it, you could even generate your own proof using all the deposit events and build your own merkletree. 9) Using that proof, you can withdraw the funds from the L2 bucket.

Bucketly showcase

How it's made

Within the hackathon, we managed to 1) build an off-chain relay 2) model out a database 3) deploy early contracts to L1 testnet (Goerli) and L2 Polygon 4) dynamically generate merkletrees (which was tough) 5) create a UI that follows the Bucketly flow We used hardhat for testing, we used Web3 react for the frontend, used NodeJs for the relay development, Solidity for contracts.

Technologies used

HardhatPolygon