• lime!@feddit.nu
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    23 hours ago

    you’re calculating the sha256 (i think) hash of the previous transaction block’s hash plus your block of transactions. What’s making it proof-of-work though, is the stipulation that “the hash has to start with at least five zeroes”, with “five” being an adjustable difficulty value. To be able to get that specific hash an otherwise meaningless number (a “nonce”) is included, and by increasing this number by one you can change the hash value.

    so basically, all these servers are running hash calculations on the same thing over and over again with a single number changing between runs until they get an “approved” hash value. whoever gets there the fastest gets their block added to the chain, then everyone else has to start over with that hash as the “previous” one.

    It’s called “proof of work” because it’s difficult to find a suitable value, but it’s trivial to check that it’s correct. you just need the nonce. so by presenting that nonce to everyone, you’ve proved that you “did the work”.

    as for the reason why they do this, if each block’s hash is dependent on the hash of the block before it, it means the entire chain is resistant to tampering. you can’t insert a block in the middle without recalculating the entire chain.

    • apotheotic (she/her)@beehaw.org
      link
      fedilink
      English
      arrow-up
      2
      ·
      23 hours ago

      Yeah, so you end up with a fraction of a fraction of the work time going to actually doing the block chain transaction, and the vast majority going into the artificial difficulty

      • lime!@feddit.nu
        link
        fedilink
        English
        arrow-up
        1
        ·
        edit-2
        23 hours ago

        yup, running a global network on top of something designed to be slow seems… inadvisable.