blob: 46df43f3b49ac319d25b412c62abe9a9af7566fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
Block chain
- Block chain is a database
- Bespoke data structure
"Not crpyto"
General Purpose block chain:
Why?
- Data in block is immutable
- Don't edit or remove, you append
- traceability (Auditing / logging)
- Verifiability (Data must be fully valid)
- reproducibility
- decentralisation
- Trust-less (Removes need for trust)
- transparency
How?
- What type?
- public - will be hacked
- shared - shared ledger
- private
- Cryptography
- pub/rivate keys
- sign information
- verifablity
- Elliptic Curves
- openssl ecparam -list_curves
- Addressing
- can shorten public keys massively
- Hash algorithm
- Integrity
- 2x sha256 (sha256(sha256($data)))
- 4B version, 32B hash of last Block, 32B hash of data block, 4B timestamp, 4B difficulty, 4B nonce
- Merkle tree - binary hash tree
- Merkle path - list of hashes through the tree
- Genesis block - First block in the chain
- Special as it's first
- Prevents exploitation by being hardcoded
- consensus
- Confidence
- chain forking needs resolution
- bitcoin users longest chain wins
- proof of work / proof of stake
- difficulty is no of zeros that need to be at the start of the hash
- others (proof of burn, proof of time, proof of ....)
- Smart contracts
- Programs that are included in the chain
- e.g. A loan paid by the chain
- Lighting network (drawback off blockhain is it focuses on integrity not perf)
- Off chain transactions with on-chain settlement
- Not all blockchains are chains
- IOTA Tangle
- Challenges
- Fault tolerance
- You lose control of public/shared blockchains
- Now way to enforce software updates
- Conflict resolution
- Integration with current systems
- Security
- Cryptography is first and last line of defence
- Not perfect for:
- scalability
- performance
- throughput
- Incentives
- Mining in currencies
- Power for money
- Privacy
- Protect data
- Hard forks
- 51% attacks
- Right solution for the right kind of problem
- Event sourcing on steroids
QUESTIONS
- Any php recommendations?
- No.
- security?
- Store data not values somewhere else
- Encrypt
- Why private blocks?
- Can give public list of hashes for verification
- keep data private
|