changed 5 years ago
Published Linked with GitHub

the bitcoin algorithm

slide: https://hackmd.io/@amirulabu/thebitcoinalgorithm


Who am I?

  • a guy
  • bitcoin hodler (a story for another time)

what is bitcoin?


  • bitcoin: virtual currency
  • Bitcoin: decentralised network and systems that manages bitcoin
    • decentralised ledger
    • transactions linked by blockchain
    • incentive for people maintaining the network

what is a ledger?




what is blockchain?


a system that link blocks of data using their hash

Hashes are cryptographic codes created by special algorithms.

demo 1: https://xorbin.com/tools/sha256-hash-calculator


data: Epstein didn't kill himself
previous hash: 0000

block 1


data: Area 51 contains cat girls
previous hash: d11f69bfc9457b4b768511c73fec8e3fd240aec47e36088ed4416dbc86554505

block 2


data: Antarctica is where they store the aliens
previous hash: 
9c6bab6c7bc1f7f63a2631eab2caae78f9df0eed0d5f2dbe123649454872f4bf

block 3





what is a bitcoin mining?


  • a way to incentivise people maintaining the network

remember this?

data: Antarctica is where they store the aliens
previous hash: 
9c6bab6c7bc1f7f63a2631eab2caae78f9df0eed0d5f2dbe123649454872f4bf

now you need to answer a quiz to submit the block

data: Antarctica is where they store the aliens
quiz-answer: 12312
previous hash: 
9c6bab6c7bc1f7f63a2631eab2caae78f9df0eed0d5f2dbe123649454872f4bf

what is a SHA-256?


  • A one-way hash can be generated from any piece of data, but the data cannot be generated from the hash.


what is exactly bitcoin mining?


to answer the quiz, is to find what alphanumeric combination to produce the hash with n-zeros in front

demo 2: https://xorbin.com/tools/sha256-hash-calculator

data: Antarctica is where they store the aliens
quiz-answer: 12312 
previous hash: 
9c6bab6c7bc1f7f63a2631eab2caae78f9df0eed0d5f2dbe123649454872f4bf


what are other applications using cryptographic hash function?


facebook login page


how is password stored in the database?


demo 3: https://xorbin.com/tools/sha256-hash-calculator

hunter2

why can't we store the password as-is?


  • in case that a person gets access to the database, they can get the password

https://security.blogoverflow.com/2011/11/why-passwords-should-be-hashed/


end 🎉


Wrap up

  • bitcoin uses cryptographic hash function as a way to make transactions immutable
  • bitcoin also uses cryptographic hash function as a way to identify people doing work algorithmically
  • saving password in a database also uses cryptographic hash function to encrypt password

Thank you!
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →


bonus: why SHA-256 is not preferred for passwords anymore


https://security.stackexchange.com/questions/133239/what-is-the-specific-reason-to-prefer-bcrypt-or-pbkdf2-over-sha256-crypt-in-pass

Select a repo