• Rem [she/her]
    ·
    4 years ago

    Explain bitcoin mining. No jokey jokes, tell me forreal what happens in the computer's brain when it's "making" a bitcoin

    • Sus [none/use name]
      ·
      4 years ago

      Firstly: bitcoins waste so much energy because they rely on hash functions. A hash function is a function where an input will have a randomized output that cannot be used to determine the input. The same input always has the same output but you cannot tell what the input was based on the output alone. Cryptography shit.

      Bitcoins are created when "blocks" are mined. Blocks are new additions to the decentralized ledger, the collective knowledge of where all the bitcoins currently are. Mining is the process of attempting to add a new block to the ledger.

      To add a new block to the ledger, the miner needs to find the right pattern of hash, which involves finding the right input via random guessing - recall you can't discover an input from its output.

      Once a miner finds the right input, everyone else on the network verifies it and goes "Yeah good work, you get the newly created coins". On top of that, miners control what transactions are included on the block as it's added to the ledger (thereby verifying they happened). They'll always pick the transactions with the highest fees for them since it's additional profit.

      So the problems: there's a limited supply of bitcoins. Every new block hands out fewer than the one before it and eventually that goes to zero. So the mining reward gets lower and the miners seek to maintain profit by only selecting transactions with higher transaction fees.

      Another problem is that as you keep going it becomes harder and harder to guess the right pattern of hash (e.g. a zero followed by 99 random characters is really easy to find by brute force, but fifty zeroes followed by 50 random chars is really, really, really hard). Bitcoin does this intentionally to prevent the 51% attack (i.e. if one person controls 51% of the network they can just say whatever about the bitcoin supply and force majority agreement).

      The combination here is that every bitcoin transacted costs more in fees and wastes more energy every time and takes longer to transact, getting worse every single day as network difficulty goes up.

    • nat_turner_overdrive [he/him]
      ·
      4 years ago

      the computer spends that time dreaming of when there are no humans left and machines tend the earth's biome

    • spectre [he/him]
      ·
      4 years ago

      Bad explanation, but it gets you in the right direction:

      • A thousand computers are checking Bitcoin transactions
      • The computers all agree on how many transactions will go in a finished "block"
      • They also agree on how difficult it should be to finish a block
      • While they add transactions to the block, they do a millions of "hashes" in the background. A hash is basically a math problem that returns random digits. As a sidenote it's used as a sort of one-way encryption.
      • The difficulty is based on how many zeroes are at the beginning of your hash, first person to find a hash with, say, 12 zeroes at the beginning gets to make the block, which will be verified by all the other bitcoin miners and added to the "blockchain"
      • The miner who created the block, gets some Bitcoin added to their account as a prize
        • culpritus [any]
          ·
          4 years ago

          it's not arbitrary because it is tangentially related to your capital investment in wasting electricity and specialized compute hardware - see totally merit-based wealth creation or something

            • culpritus [any]
              ·
              edit-2
              4 years ago

              oh ya, it's like super dumb brute force math

              bitcoin consensus mechanism (proof of work) is like the million monkeys with typewriters, eventually one of the monkeys randomly types the first page of Tale of Two Cities ... and that node gets the block creation reward

              this is why 'mining pools' are a huge aspect of the network, so the members agree to split the reward in some way

              another analogy that works well is that operating a node is like buying a lotto ticket, and then about every ten minutes the network chooses a winner based on random number drawing (it's a bit more sophisticated, but functionally just barely)

              so if you have capital to throw at the network, you can increase your chances of rewards, but it is still just a probability

              the funniest part is that there is a low-level concern in the BTC world that over 51% of the network hashing power is in China, which means if those nodes were all pooled together under Xi, China would control the network

      • Rem [she/her]
        ·
        4 years ago

        So blocks are just records of transactions between accounts? And instead of having a central server processing them, it's just a bunch of computers working in parallel. Why would the computers decide to make a block more difficult to process? Or is it just because the block contains more data?

        • culpritus [any]
          ·
          4 years ago

          it's part of the code all the nodes are running, trying to get the block creation time to be ~10 minutes or so. since the 'power' of the network is variable with the number of nodes, the difficulty of creating a block is tuned based on how long it took to create the last one.

          • Rem [she/her]
            ·
            edit-2
            4 years ago

            I understand all of these words individually :very-smart:

            Imma just not worry about it. Bitcoin bad, done, easy.