How is “gas” used in Ethereum, Ethereum Classic, and other smart contract platforms? What does “Turing complete” mean? As a smart contract developer, how do I estimate how much the execution of my program will cost in gas?

These questions are from MOOC 9.7 session, which took place on March 30th 2018. Andreas is a teaching fellow with the University of Nicosia. The first course in their Master of Science in Digital Currency degree, DFIN-511: Introduction to Digital Currencies, is offered for free as an open enrollment MOOC course to anyone interested in learning about the fundamental principles.

If you want early-access to talks and a chance to participate in the monthly live Q&As with Andreas, become a patron: https://www.patreon.com/aantonop

RELATED:
The Lion and the Shark: Divergent Evolution in Cryptocurrency – https://youtu.be/d0x6CtD8iq4
Investing in Education instead of Speculation – https://youtu.be/6uXAbJQoZlE
Ethereum, ICOs, and Rocket Science – https://youtu.be/OWI5-AVndgk
Slush17 Panel: Farewell to Centralised Data – https://youtu.be/ul0aGzF-v5c
Blockchain vs. Bullshit: Thoughts On The Future of Money – https://youtu.be/SMEOKDVXlUo
Why I’m writing ‘Mastering Ethereum’ – https://youtu.be/So6WERp7vLY
Smart contract platforms – https://youtu.be/XU8Bc5oxneE
Impact of smart contracts on law and accounting – https://youtu.be/K-TRzuPwJCc
Altcoins and specialisation – https://youtu.be/b_Yhr8h6xnA
Ether, ICOs, and securities – https://youtu.be/guBNLSsnAiA
Unstoppable code – https://youtu.be/AQx3E3F8Kz4
Airdrop coins and privacy implications – https://youtu.be/JHRnqJJ0rhc
Initial coin offerings (ICOs) – https://youtu.be/Q5R8KuxV4A0
The token ICO explosion – https://youtu.be/vdaW8NtJXuQ
ICOs and responsible investment – https://youtu.be/C8UdbvrWyvg
ICOs and financial regulation – https://youtu.be/Plu_WX3Gs8E
ICOs, disruption, and self-regulation – https://youtu.be/yfjgcI8xX3A
Scams, gambling, and regulation – https://youtu.be/fTI88YrN1UE
ICOs and pyramid schemes – https://youtu.be/8HYWWP1QU7Q
Directed acyclic graphs (DAGs) and IOTA – https://youtu.be/lfgMnbb5JeM
Scaling and “Satoshi’s vision” – https://youtu.be/Ub2LoTcYV54
“Blockchain, not Bitcoin ” – https://youtu.be/r2f0HlaRdgo
Reflections on the last five years – https://youtu.be/NoCi64uaFT0

Andreas M. Antonopoulos is a technologist and serial entrepreneur who has become one of the most well-known and respected figures in bitcoin.

Follow on Twitter: @aantonop https://twitter.com/aantonop
Website: https://antonopoulos.com/

He is the author of two books: “Mastering Bitcoin,” published by O’Reilly Media and considered the best technical guide to bitcoin; “The Internet of Money,” a book about why bitcoin matters.

THE INTERNET OF MONEY, v1: https://www.amazon.co.uk/Internet-Money-collection-Andreas-Antonopoulos/dp/1537000454/ref=asap_bc?ie=UTF8

[NEW] THE INTERNET OF MONEY, v2: https://www.amazon.com/Internet-Money-Andreas-M-Antonopoulos/dp/194791006X/ref=asap_bc?ie=UTF8

MASTERING BITCOIN: https://www.amazon.co.uk/Mastering-Bitcoin-Unlocking-Digital-Cryptocurrencies/dp/1449374042

[NEW] MASTERING BITCOIN, 2nd Edition: https://www.amazon.com/Mastering-Bitcoin-Programming-Open-Blockchain/dp/1491954388

Translations of MASTERING BITCOIN: https://bitcoinbook.info/translations-of-mastering-bitcoin/

Subscribe to the channel to learn more about Bitcoin & open blockchains!

Music: “Unbounded” by Orfan (https://www.facebook.com/Orfan/)
Outro Graphics: Phneep (http://www.phneep.com/)
Outro Art: Rock Barcellos (http://www.rockincomics.com.br/)

source

15 COMMENTS

  1. I think Andreas makes a slight imprecision here. It is indeed impossible to write an algorithm that predicts if an arbitrary contract will halt if the language used is Turing-complete. That is why the Ethereum protocol cannot automate this procedure, and gas must be used. However, given a specific contract, you, the user, can just look at the code and determine what will happen in different scenarios (or determine that it is too complicated to predict and not use it).

  2. To me this makes coins that use "gas" unworkable. I know of one ETH contract that can't run anymore because it can't be given enough gas to run completely. How can this problem be solved?

    Also, what happens to any unused gas? Does it just stay in the paying address? Can it be sent to a new address (because once an address gets used its public key is now published, so all funds in the paying address should be sent to a new unused address).

  3. I need an analogy… say you program is a car, and to execute your code might take an uncertain amount of computing power. so its like needing to drive your car to an unknown location. so you don't know how much gas you need?… why don't you know the location? maybe… you don't know how many people will be using your code?

  4. Gas creates economic friction between users. For a smart contract platform, this friction will slow/halt adoption. Either gas needs to be minimized to less than a 1/100th of a one USD cent — or ETH will die at the hands of EOS.

  5. Brilliant, thank you Andreas. If anyone has seen a Q&A from him regarding pros / cons / security of PoS vs. PoW, can you please post? If not, Andreas, can you please consider doing such a video? Thank you

LEAVE A REPLY

Please enter your comment!
Please enter your name here