Cryptocurrencies & Security on the Blockchain
- Prof. Tom Austin
San José State University
Ethereum Transactions and Smart Contracts Prof. Tom Austin San - - PowerPoint PPT Presentation
Cryptocurrencies & Security on the Blockchain Ethereum Transactions and Smart Contracts Prof. Tom Austin San Jos State University Transactions Transactions Signed messages triggered by EOA Atomic If they fail, they roll back
San José State University
– Simpler – Pseudo-anonymity not a major goal (still possible, just more complex).
– Transactions are processed in order – If a tx fails, subsequent ones will be stuck.
– 0x0000000000000000000000000000000000000000 – Author has not special rights to a contract, unless the contract is written that way.
– Only if creator configured it that way.
– Oldest, but rarely used.
– Python-ish
– JavaScript-ish
– Also Python-ish
– Erlang-ish
– Oldest, but rarely used.
– Python-ish
– JavaScript-ish
– Also Python-ish
– Erlang-ish
– Variants in 8, 16, 32, …, 256 – Default is 256
– Fields: sender, value, gas, data, sig
– Fields: gasprice
– Fields: coinbase, difficulty, gaslimit, number, timestamp (in seconds since epoch)
– Older versions used contract name
– Person who destroys it claims the contract's ether. – Only if enabled by author.
function takeFunds() public { require (msg.sender == owner); msg.sender.transfer(amt); }
function takeFunds() public onlyOwner { msg.sender.transfer(amt); }