Doing the same thing directly on Ethereum (sans StarkEx), would have consumed the entire network for 4.5 days.
Motivation: Fuel Labs recently showed an impressive demo on a testnet: sending the initial balance of Bricks and Moons (Reddit’s new coins) to an Ethereum wallet. We decided to join Fuel Labs in sending Reddit a message from the Ethereum community: we are ready for you.What We Did
We used StarkEx, our ZK-Rollup scalability engine, to set up 1.3M accounts and seed them with an initial balance. This onboarding is completely trustless: it is backed by a sequence of STARK proofs and state commitments to Ethereum Mainnet. StarkEx can be used for much more than this onboarding: it can also serve to scalably transfer tokens and trade them.
We minted on-chain 2^60 tokens of an ERC-20 we called MockErc20 and deposited them to a smart contract representing a subreddit. We then trustlessly moved those assets to the off-chain account of the “subreddit treasury”. Off-chain, we created 159 batches of 8,192 transfers each. Each batch represented transfers from the moderator’s account to a subset of individual account owners. For each batch we generated a STARK proof attesting to the integrity of the entire batch, and updated an off-chain Merkle tree of account balances. Each proof was then sent on-chain (in 13 separate tx, 380K gas/tx on average, for a total per proof of 4.94M gas), alongside a commitment to the updated state of the Merkle tree. Each single transaction costs 603 gas (4.94M gas/8192 transfers). In order not to burden Mainnet, already heavily congested, we submitted 2067 (13 times 159 batches) separate Ethereum transactions.
Operator account: https://etherscan.io/address/0xb169b7be47c456Fbda808bD97B5261233C269c89
“reddit” account: https://etherscan.io/address/0xe0339e6ebd1ccc09232d1e979d50257268b977ef
Deposit tx: https://etherscan.io/tx/0x369122720b2c73ea5d4492170e108b8d393b6762dbf3b926bd1e44202e93fa53