GasToken: A Journey Through Blockchain Resource Arbitrage Florian Tramèr Stanford University Yet another token? Even academics going down this road. Bear with me. No product, no ICO. The whole idea is that the token encodes a resource that cannot be backed directly by ether. MIT Bitcoin Expo 18 March 2018
Imagine if… Monday: It’s $4 for the cappuccino… and the transaction fee is $0.10. Friday: It’s $4 for the cappuccino… and the transaction fee is $6.25. 18 March 2018 MIT Bitcoin Expo
Transaction fees / Ethereum gas prices are super volatile 18 March 2018 MIT Bitcoin Expo
Same in Bitcoin… source: bitinfocharts.com 18 March 2018 MIT Bitcoin Expo
How do ordinary businesses handle volatility? Stock up when prices are low! Or buy financial instruments… How do you “speculate on” or stockpile transaction fees? You can’t stockpile transaction fees? In some twisted way, you can! 18 March 2018 MIT Bitcoin Expo
GasToken: Stockpiling and trading Ethereum gas Phil Daian, Lorenz Breidenbach, FT + Ari Juels https://gastoken.io 18 March 2018 MIT Bitcoin Expo
Ethereum Gas 1 GWei = 109 Wei 1 Ether = 1018 Wei User Miner(s) MyContract func(x): a = x + 1 b = hash(a) Mem[0] = b 3 gas 30 gas 20000 gas 20033 gas I want to run func(1) How Much? User Miner(s) 1 GWei per gas? (0.00002 eth) Meh… 18 March 2018 MIT Bitcoin Expo
Ethereum Gas 1 GWei = 109 Wei 1 Ether = 1018 Wei User Miner(s) MyContract func(x): a = x + 1 b = hash(a) Mem[0] = b 3 gas 30 gas 20000 gas 20033 gas Gas cost of contract is FIXED (always 20033 gas). But price of one unit of gas in ether is highly volatile I want to run func(1) How Much? User Miner(s) 10 GWei per gas? (0.00002 eth) OK! 18 March 2018 MIT Bitcoin Expo
GasToken in a nutshell To encourage state cleanup, Ethereum offers a gas refund for: Released contract storage Destroyed contracts Write to state when gas price is low Trade state slots as an ERC20 token Release state when gas price is high Refund pays up to half of transaction fee Not a new idea: goes back at least to 2015, Vitalik Bueterin speculated that rational miners could use this mechanism to fill up blocks More generally, it was clear that clients could use this in isolation (I stock storage for my future transactions). We show that this can easily be transformed into an open market, where stockers and consumers can be distinct 18 March 2018 MIT Bitcoin Expo
An example Store 10 words Breed kitties Regular Total Gas: 200,000 1 GWei Store 10 words Total Gas: 200,000 Price: $0.20 Regular 4 GWei Breed kitties Total Gas: 250,000 Price: $9 18 March 2018 MIT Bitcoin Expo
An example Store 10 words Free 10 words & breed kitties refund Regular 1 GWei Store 10 words Total Gas: 200,000 Price: $0.20 Free 10 words & breed kitties Regular 4 GWei refund Total Gas: 250,000 – 100,000 Price: $9 $5 18 March 2018 MIT Bitcoin Expo
Nifty details Two variants of GasToken: GST1: uses storage, SSTORE(1), SSTORE(0) GST2: uses contracts, CREATE, SELFDESTRUCT GST2 more complex but also more efficient SSTORE: 20k to stock, for 10k refund (50%) CREATE: 32k to stock, for ~17k refund (53%) Refund is interesting when gas volatility is >2x 18 March 2018 MIT Bitcoin Expo
Nifty details Two variants of GasToken: GST1: uses storage, SSTORE(1), SSTORE(0) GST2: uses contracts, CREATE, SELFDESTRUCT Refund is interesting when gas volatility is >2x GST2 more complex but also more efficient SSTORE: 20,000 to stock, for 10,000 refund CREATE: 32,000 to stock, for ~17,000 refund 18 March 2018 MIT Bitcoin Expo
FAQ Who “pays” for the refund? Technically, the miner by only being paid for half the transaction cost Why wouldn’t miners blacklist GasToken then? Ethereum is naturally “censorship resistant” GasToken can increase transaction demand when gas prices are low Is GST1/2 an investment vehicle / security / financial product? No! We make absolutely no promises of any returns, profit…GasToken is not based on any currency, asset, or other financial product… We encourage users to expect zero further effort from its developers… it is likely that the developers of GasToken will advocate for changes to the network that render GasToken unusable. Looking forward: very interesting insights into incentives: do people use gastoken? If not, why not? if it is used, how closely does the token’s price reflect the price of the gas that it holds. Will gas prices stabilize? do miners try to blacklist it? 18 March 2018 MIT Bitcoin Expo
FAQ Who “pays” for the refund? Technically, the miner by only being paid for half the transaction cost Why wouldn’t miners blacklist GasToken then? Ethereum is naturally “censorship resistant” GasToken can increase transaction demand when gas prices are low Is GST1/2 an investment vehicle / security / financial product? No! We make absolutely no promises of any returns, profit…GasToken is not based on any currency, asset, or other financial product… We encourage users to expect zero further effort from its developers… it is likely that the developers of GasToken will advocate for changes to the network that render GasToken unusable. So many 0s… 40 bits 18 March 2018 MIT Bitcoin Expo
The issue with storage pricing Blockchain state is (a priori) permanent Smart contract storage, UTXO set, etc. One time transaction fee ⇒ recurring & indefinite costs to network Writing to state must be expensive to deter DOS attacks Yet incentivize users to clean up… E.g., many transactions in Bitcoin’s UTXO have no positive incentive to be spent Why 20k gas for SSTORE? How do we fix this “bug” 18 March 2018 MIT Bitcoin Expo
Storage Rent EIP 35/87: Charge “rent” for contract storage If rent unpaid, storage is removed from chain Refund scheme could be removed entirely Great idea but tricky execution Developers must guard against storage loss Entire contracts could disappear if unpaid Doesn’t work for UTXO set… 18 March 2018 MIT Bitcoin Expo
The big picture: Cryptocommodities Blockchain transactions require a number of “raw” resources or commodities Memory: block space, UTXO set, etc. Computation: e.g., gas in Ethereum How do we accurately price and freely trade these commodities (and their derivatives)? 18 March 2018 MIT Bitcoin Expo
Project Chicago: beyond GasToken More efficient transaction-fee derivatives Bob: I’ll pay Alice’s transaction on April 1st Avg. gas price is 5 GWei Alice: Run my transaction Transfer funds from Bob to Alice Other cryptocommodities? In-protocol futures Could stable & efficient cryptocommodity markets be supported at the consensus level? How much escrow do we need? 18 March 2018 MIT Bitcoin Expo
Learn More Thanks! https://gastoken.io https://projectchicago.io 18 March 2018 MIT Bitcoin Expo