<100 subscribers
Onchain applications are scaling well, but there’s still more work to be done. With every Ethereum transaction, you’re paying for computational effort in the form of gas fees. For permissioned applications, especially those needing to frequently update access lists, these fees quickly add up.
Quible introduces a new onchain access control mechanism that improves on the shortcomings of Merkle trees, allowing teams to save thousands of dollars in gas costs. But just how much gas can you save? Today, we’ll explore some case studies at different scales.
Traditional onchain access control often relies on Merkle trees. This data structure allows for compact, verifiable proofs that a particular user is part of a list, without having to reveal the entire list. The downside, however, is that every time you make an update—such as adding or removing a participant—you must update the Merkle root, which is stored onchain.
Quible is a layer 1 blockchain network for storage and management of access lists. Quible introduces a new data structure called Quirkle trees. Publish your Quirkle root once, and it persists—even if you add or remove names from the tree. Quirkle trees reduce gas costs to almost zero by removing the need for root updates.
Let’s review the math behind our claims. In each case study below, we assume:
Only the Merkle root is updated: The tree itself is stored offchain, but the root is stored onchain.
Gas cost per update: 26,000 gas units per update, including the 21,000 gas units needed to make an onchain transaction, and 5,000 gas units for the payload (Merkle root),
Gas price: 25 Gwei (not uncommon on busier days).
Ether price: $2,500.
By switching to Quible, you save money every time you need to edit your access list. Let’s take a look at three different applications and how much gas Quible can help you save.
Note: our calculations assume 26,000 gas units per transaction. This is assuming the leanest possible implementation. However, some applications are built in a way that requires more - up to 76,000 gas units. You can see an example here.
For a token sale or airdrop, you might need to handle 250,000 users. Every time the access list is updated, the Merkle root needs to be recalculated and updated onchain. If you're doing automated credentialing in real time, this can equate to a lot of transactions, even if they're batched.
Gas per update: 26,000 gas units per root update.
Total gas used for 5,000 recalculations: 26,000 gas units per update * 5,000 updates = 130,000,000 gas.
Gas price in Ether: Gas price is 25 Gwei. 25 Gwei = 25 10^-9 ETH per gas unit.
Total gas in Ether = 130,000,000 gas 25 * 10^-9 ETH = 3.25 ETH.
Cost in USD: Ether price is $2,500. Total cost in USD = 3.25 ETH * $2,500 = $8,125.
Savings Target: $8,125 for 5,000 recalculations.
An onchain rideshare app may need to track 500,000 drivers or vehicles. Each time the list is updated—such as when new drivers are added—the Merkle root must be updated onchain. This can be very costly if users are onboarded in real time.
Gas per update: 26,000 gas units per root update.
Total gas used for 25,000 recalculations: 26,000 gas units per update * 25,000 updates = 650,000,000 gas.
Gas price in Ether: Gas price is 25 Gwei. 25 Gwei = 25 10^-9 ETH per gas unit.
Total gas in Ether = 650,000,000 gas 25 * 10^-9 ETH = 16.25 ETH.
Cost in USD: Ether price is $2,500. Total cost in USD = 16.25 ETH * $2,500 = $40,625.
Savings Target: $40,625 for 25,000 recalculations.
For an enterprise-scale application like an onchain social media platform, 1,000,000 users are onboarded individually. This means the Merkle root is updated 1,000,000 times as users join or permissions are modified.
Gas per update: 26,000 gas units per root update.
Total gas used for 1,000,000 recalculations: 26,000 gas units per update * 1,000,000 updates = 26,000,000,000 gas.
Gas price in Ether: Gas price is 25 Gwei. 25 Gwei = 25 10^-9 ETH per gas unit.
Total gas in Ether = 26,000,000,000 gas 25 * 10^-9 ETH = 650 ETH.
Cost in USD: Ether price is $2,500. Total cost in USD = 650 ETH * $2,500 = $1,625,000.
Savings Target: $1,625,000 for 1,000,000 recalculations.
The examples above can give you a rough idea of how much Quible can help you save on gas costs. Whether you’ve got 100 or 1,000,000 users, updating a Merkle root onchain adds a recurring cost—especially during times of network congestion when gas prices spike. Quible’s Quirkle tree solution makes writing your root onchain a one-time expense.
Website: https://quible.network
Whitepaper: https://quible.network/whitepaper
Twitter: https://twitter.com/QuibleNetwork
Quible Network