集思港益
2020-05-09 16:03:42
講下咩叫blockchain
傳統database係咁
Transaction id, from id, to id, amount
1,50,70, 120
2,90,80, 330
3,80,77,550
Blockchain係咁
Transaction id, from id, to id, amount, hash
1,50,70, 120,sha256(1,50,70,120)
2,90,80, 330,sha256(record 1 hash result + (2,00,80,330))
3,80,77,550,sha256(record 2 hash result + (2,00,80,330))
咩叫sha256 hash
你當係一個checksum,類似身份證的括號數字,但身份證checksum複雜度只有1個數字,而sha256的複雜度係10^77個,即係用晒全球所有電腦花十萬年都破解唔到一條record。
如果你改左任何一條record,個hash result就會broken,不過你可以重新計算晒所有hash,然後改晒所有hash record,但極費時和極易被發現。
另外, blockchain 係用peer to peer decentralize database,一條record會發送俾所有server,例如有十萬部server,除非你一次過改晒所有server record,否則無法改data