Nchinda Nchinda
MIT grad, ethereum developer, bitcoin user
Nchinda Nchinda
@Firescar96
Researcher - MIT Media Lab
Ethereum Application Developer
Bitcoin User
Trapdoor Functions
| Stag | Rabbit | |
| Stag | A:3 B:3 | A:3 B:0 |
| Rabbit | A:0 B:3 | A:2 B:2 |
Alice
Bob
On Distributed Communication Networks - Paul Baran
1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2
A cypherpunk is an activist who uses software, protocol, and most importantly cryptography to invoke social and political change.
https://bitcoin.org/bitcoin.pdf
10000 BTC = 2 pizzas
Then 2013 Happened
header
body
header
body
header
body
time
header
body
header
body
header
Alice -> Bob; 1 BTC; .0001 fee
Alice -> Charlie; 1 BTC; .0001 fee
Dan -> Alice; 1 BTC; .0004 fee
Reward: 12.5BTC
header
Alice -> Bob; 1 BTC; .0001 fee
Alice -> Charlie; 1 BTC; .0001 fee
Dan -> Alice; 1 BTC; .0004 fee
Reward: 12.5BTC
header
Alice -> Bob; 1 BTC; .0001 fee
Alice -> Charlie; 1 BTC; .0001 fee
Dan -> Alice; 1 BTC; .0004 fee
Reward: 12.5BTC
time
header
...
...
...
Reward: 12.5BTC
header
...
...
...
Reward: 12.5BTC
It's like Sudoku
No central banks
No physical form
No government backing
Anyone can participate
No formal identification
Why hasn't Bitcoin collapsed?
Hard to Solve, Easy to Verify
Winning has a Financial Reward
Bitcoin Mining is like Sudoku
Hash Functions
Arbitrary Text
fixed size number
Hash Functions
Mary had a little lamb, little lamb,
little lamb, Mary had a little lamb
whose fleece was white as snow.
And everywhere that Mary went
Mary went, Mary went, everywhere
that Mary went
The lamb was sure to go.
He followed her to school one day,
school one day, school one day,
He followed her to school one day,
Which was against the rules,
It made the children laugh and play,
laugh and play, laugh and play,
It made the children laugh and play,
To see a lamb at school.
2,474,925,876
Hash Functions
Alice had a little lamb, little lamb,
little lamb, Mary had a little lamb
whose fleece was white as snow.
And everywhere that Mary went
Mary went, Mary went, everywhere
that Mary went
The lamb was sure to go.
He followed her to school one day,
school one day, school one day,
He followed her to school one day,
Which was against the rules,
It made the children laugh and play,
laugh and play, laugh and play,
It made the children laugh and play,
To see a lamb at school.
184,000,478,453
Hash Functions
Elice had a little lamb, little lamb,
little lamb, Mary had a little lamb
whose fleece was white as snow.
And everywhere that Mary went
Mary went, Mary went, everywhere
that Mary went
The lamb was sure to go.
He followed her to school one day,
school one day, school one day,
He followed her to school one day,
Which was against the rules,
It made the children laugh and play,
laugh and play, laugh and play,
It made the children laugh and play,
To see a lamb at school.
82,944,583,940
Hash Functions
We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just want to tell you how I'm feeling
Gotta make you understand
Never gonna give you up, never gonna let you down
Never gonna run around and desert you
Never gonna make you cry, never gonna say goodbye
Never gonna tell a lie and hurt you
28,486,668,569
Hard to Solve, Easy to Verify
Current Bitcoin Difficulty (1011 different possibilities)
The number of bits on a computer hard disk (typically about 1013, 500-1000 GB)
The number of cells in the human body (more than 1014)
The number of neuronal connections in the human brain (estimated at 1014)
Maximum Bitcoin Difficulty (1077 different possibilities)
The estimated number of atoms in the observable Universe (1080)
The lower bound on the game-tree complexity of chess (estimated at around 10120)
It's like Sudoku
| Stag | Rabbit | |
| Stag | A:4 B:4 | A:2 B:0 |
| Rabbit | A:0 B:2 | A:1 B:1 |
Alice
Bob
| Defend | Attack | |
| Defend | A:12 B:12 C:∅ | A:∅ B:24 C:∅ |
| Attack | A:24 B:∅ C:∅ | A:∅ B:∅ C:∅ |
Alice
Bob
| Defend | Attack | |
| Defend | A:8 B:8 C:8 | A:∅ B:12 C:12 |
| Attack | A:12 B:∅ C:12 | A:∅ B:∅ C:24 |
Alice
Bob
Charlie
Defend
Attack
three players, 24 bitcoin per block
| Defend | Attack | |
| Defend | A:12 B:12 C:∅ | A:∅ B:24 C:∅ |
| Attack | A:24 B:∅ C:∅ | A:∅ B:∅ C:∅ |
Alice
Bob
| Defend | Attack | |
| Defend | A:8 B:8 C:8 | A:∅ B:12 C:12 |
| Attack | A:12 B:∅ C:12 | A:∅ B:∅ C:24 |
Alice
Bob
Charlie
Defend
Attack
three players, 24 bitcoin per block
| Defend | Attack | |
| Defend | A:12 B:12 C:∅ | A:∅ B:24 C:∅ |
| Attack | A:24 B:∅ C:∅ | A:∅ B:∅ C:∅ |
Alice
Bob
| Defend | Attack | |
| Defend | A:8 B:8 C:8 | A:∅ B:12 C:12 |
| Attack | A:12 B:∅ C:12 | A:∅ B:∅ C:24 |
Alice
Bob
Charlie
Defend
Attack
three players, 24 bitcoin per block
| Defend | Attack | |
| Defend | A:12 B:12 C:∅ | A:∅ B:24 C:∅ |
| Attack | A:24 B:∅ C:∅ | A:∅ B:∅ C:∅ |
Alice
Bob
| Defend | Attack | |
| Defend | A:8 B:8 C:8 | A:∅ B:12 C:12 |
| Attack | A:12 B:∅ C:12 | A:∅ B:∅ C:24 |
Alice
Bob
Charlie
Defend
Attack
three players, 24 bitcoin per block
other projects can accomplish this though
https://github.com/ethereum/wiki/wiki/White-Paper#applications
Types https://solidity.readthedocs.io/en/develop/types.html -just skim this
constructors and functionshttps://solidity.readthedocs.io/en/develop/structure-of-a-contract.html#functions
special solidity calls https://solidity.readthedocs.io/en/develop/units-and-global-variables.html#special-variables-and-functions -just skim this
pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function SimpleStorage() {
// ...
}
function bid() payable { // Function
// ...
}
}
}
remix.ethereum.org
After the break
Write a contract that allows people to register for arbitrary names
Designing the contract
describe('Array', function() {
before(function() { // runs before all tests in this block }); describe('#indexOf()', function() { it('should not be empty', function() { // ...some assertions here }); }); });
$ ./node_modules/mocha/bin/mocha Array #indexOf() ✓ should not be empty 1 passing (9ms)
contract('MySimpleContract', function() { describe('setting the state', function() { // ..some assertions here }); // ...some more contract tests here });
expect(2).to.equal(2); expect({a: 1, b: 2}) .to.not.have.any.keys('c', 'd'); expect([1, 2]).to.be.an('array') .that.does.not.include(3);
expect(false, 'nooo why fail??').to.be.true;
By Nchinda Nchinda
This is a 1 day version with 4 sections of 1:30 each