• hperrin@lemmy.ca
    link
    fedilink
    English
    arrow-up
    35
    ·
    edit-2
    1 day ago

    By design, it’s supposed to be barely profitable, so it makes sense it would cross that boundary once in a while. Then some miners leave the network or slow their hash rate, the difficulty is adjusted automatically, and it becomes profitable again. It’s actually a pretty interesting strategy.

    Ostensibly, the difficulty depends on how many miners there are on the network. More miners = more difficult. Fewer miners = less difficult. The “difficulty” is just how “lucky” you have to be to hit a successful hash on a block. The block’s hash is based on the previous block + all the transactions you include in your block + a random number you add. That random number is what you change to try to hit a successful hash. If the hash starts with a certain number of zeroes, you have a successful block you can add to the chain, and you’re rewarded with some brand new coin in your wallet (you include that in the transactions in your block). If not, you change the random number and try again. How many times you have to try again is controlled by the leading zeroes requirement. You’re competing with every other miner on the network to find a successful block first.

    The amount of new coin constantly goes down as the chain gets longer, until it hits zero and mining doesn’t create new coin. Then, you would charge a fee for including someone’s transaction (a lot of miners already charge a fee). The more zeroes required at the start of the hash, the “harder” it is to mine. The network automatically adjusts how many zeroes are required to keep new blocks being added at a roughly constant rate (one block every ten minutes is the target).

    All of this is enforced by the algorithm Bitcoin miners use. If a “rogue miner” submits a block that doesn’t meet these criteria, the other miners just reject the block and don’t add it to their copy of the blockchain. The consensus is what really matters, and no one entity controls a majority of miners. Each miner has their own copy of the entire blockchain, so each miner can validate any block it receives before adding it to the chain.

    Fewer miners would mean blocks are being added too slowly at the current difficulty, and the network adjusts to make it easier to hit a successful hash. The network automatically adjusts difficulty every 2,016 blocks (it’s all just math, and it’s part of the Bitcoin algorithm), which is roughly every 2 weeks. So, it should in theory only be not profitable for up to two weeks.

    (Please note that this is simplified to the point of being technically wrong, but in principle, that’s how it works. Technically, in a mining pool, you can still get rewarded even if you don’t hit a successful hash. You get rewarded based on the hash rate you provide to the pool, with the understanding that you won’t get the full reward when you hit a successful block. Also, it’s not really about the number of zeroes, but a “target” hash that your hash needs to be “below”. A hash might have the same number of leading zeroes, but not be below the target, so wouldn’t be successful. That’s really unlikely. In practice, this basically means more leading zeroes. If the target got high enough, it can even have no leading zeroes. That would probably require an intergalactic sized network.)

    • Oka@sopuli.xyz
      link
      fedilink
      arrow-up
      3
      ·
      13 hours ago

      Wouldn’t it be easier if a bunch of people paid a dollar every second, and one of those people was randomly selected to get every dollar submitted?

    • Hirom@beehaw.orgOP
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      23 hours ago

      Thanks for the refresher. I’m aware of the basics, but assumed the difficulty measured by the number of zeros could only increase. Apparently difficulty can decrease, and I’ve read it’s expected to decrease very soon to keep the system running a while longer.

      Bitcoin’s creator was smart enough to design a system that automatically adjust to remain profitable for several years without intervention, but not smart enough to foresee social and environmental costs.

      It’s a good example that illustrate why automated systems shouldn’t be left running unsupervised, even if it’s designed by the best minds with the best of intentions.

      • The_Caretaker@lemm.ee
        link
        fedilink
        English
        arrow-up
        4
        ·
        13 hours ago

        There are other methods of operating a blockchain, besides proof of work, which are much more energy efficient. Think of Bitcoin being like a coal fired power-plant and some other cryptos based on proof of stake being akin to solar panels.

      • locuester@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        8 hours ago

        It’s a good example that illustrate why automated systems shouldn’t be left running unsupervised, even if it’s designed by the best minds with the best of intentions.

        The network is constantly supervised and mining is a competitive business. The network was built to adjust, and is working precisely as intended.

        • Hirom@beehaw.orgOP
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          8 hours ago

          The network was built to adjust

          Then why doesn’t it adjust to avoid negative social and environmental effects? Probalby because it’s not possible to adjust bitcoin’s algorithm, only some parameters, and because miners don’t have enough intensive to abandon bitcoin for something less destructive.

          My understanding is it’s not possible to modify nor fix bitcoin’s core algorithm, which include the difficulty and consensus logic.

          A hard fork is possible, which means leaving the bitcoin network and setting up an alternative (hopefully better) network with a different algorithm.

          • locuester@lemmy.zip
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 hours ago

            lol it can’t adjust on public approval. It’s software that runs. It’s valuable. If it wasn’t, people wouldn’t run it.

            It can hard fork with a consensus mechanism change anytime someone writes one and people decide it’s the best path forward. Ethereum decided this and did this.

            That’s not happening with Bitcoin because those that understand how it works agree it’s the best system to use.

            I use Bitcoin as a store of value, and Solana for day to day stuff and financial investments like lending and liq providing. That’s my preference, for now. It’s a very fluid industry, nothing is set in stone, although Bitcoin appears to be pretty solidly the preferred secure store of value.