• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Anyone tried bitcoin mining?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Anyone tried bitcoin mining?

    AIUI, the algorithmic aim is to calculate a long hash value, and to be a valid bitcoin this has to be smaller than a certain threshold and not already obtained by someone else. Also, the bar is being set ever lower, making the discovery of bitcoins ever harder, by reducing the threshold at regular intervals.

    At some point, I would have thought it might start being worthwhile to simply guess hash values at random below the threshold and check they are not already known. But then presumably there are also algorithmic ways to check that a hash value has been determined by the approved procedure, sort of like an advanced version of a parity check, and the chance of a random hash being a valid bitcoin is so remote that the effort of finding one by guesswork is as much as that of finding one by the approved procedure.

    Anyone looked into this? It would be interesting to see a definition of the algorithm(s) which bitcoin miners have to use.
    Work in the public sector? Read the IR35 FAQ here

    #2
    Originally posted by OwlHoot View Post
    AIUI, the algorithmic aim is to calculate a long hash value, and to be a valid bitcoin this has to be smaller than a certain threshold and not already obtained by someone else. Also, the bar is being set ever lower, making the discovery of bitcoins ever harder, by reducing the threshold at regular intervals.

    At some point, I would have thought it might start being worthwhile to simply guess hash values at random below the threshold and check they are not already known. But then presumably there are also algorithmic ways to check that a hash value has been determined by the approved procedure, sort of like an advanced version of a parity check, and the chance of a random hash being a valid bitcoin is so remote that the effort of finding one by guesswork is as much as that of finding one by the approved procedure.

    Anyone looked into this? It would be interesting to see a definition of the algorithm(s) which bitcoin miners have to use.
    this.

    Comment


      #3
      It's not the hash you're trying to guess, any hash is OK as long as it is below the threshold. Bitcoin is actually a block chain, which contains a history of all the transactions. Every few minutes a new block is generated which contain new transactions since the last block was created. Only one block can be generated at a time and miners compete to generate the next valid block. As a miner you can add a transaction in the block that pays you 6.25 BTC, which is how you get the bitcoins. The block you generate is derived from the previous block. In order for a block to be valid, the block header must generate a hash that is below the threshold. In the header there is a field called a nonce. It's the nonce that you increment until you get a valid hash value.

      Guessing the hash value is no use, it's the nonce you have to guess, which is what miners do. Unless you have a powerful computer center you're always going to lose in the race to generate next valid block header.
      Last edited by BlasterBates; 23 October 2021, 14:25.
      I'm alright Jack

      Comment


        #4
        Originally posted by BlasterBates View Post
        It's not the hash you're trying to guess, any hash is OK as long as it is below the threshold. Bitcoin is actually a block chain, which contains a history of all the transactions. Every few minutes a new block is generated which contain new transactions since the last block was created. Only one block can be generated at a time and miners compete to generate the next valid block. As a miner you can add a transaction in the block that pays you 6.25 BTC, which is how you get the bitcoins. The block you generate is derived from the previous block. In order for a block to be valid, the block header must generate a hash that is below the threshold. In the header there is a field called a nonce. It's the nonce that you increment until you get a valid hash value.

        Guessing the hash value is no use, it's the nonce you have to guess, which is what miners do. Unless you have a powerful computer center you're always going to lose in the race to generate next valid block header.
        Thanks. Is the nonce also increasing across headers, or reset randomly for each new header?

        If it is the former then what is to stop a miner privately adding a large initial value to the nonce before they start incrementing and trying values in a loop, in the hope of beating everyone else to the new header (albeit at the risk of missing a header for some smaller nonce value)?

        Also, come to think of it, if a miner doing this is the first to find a new header, is it possible to determine if this is with the smallest nonce value larger than its initial value, so the miner didn't jump the gun? Or will any nonce value be fine so its up to a miner to decide where to start and hope to get lucky before anyone else?
        Work in the public sector? Read the IR35 FAQ here

        Comment


          #5
          Originally posted by BlasterBates View Post
          It's not the hash you're trying to guess, any hash is OK as long as it is below the threshold. Bitcoin is actually a block chain, which contains a history of all the transactions. Every few minutes a new block is generated which contain new transactions since the last block was created. Only one block can be generated at a time and miners compete to generate the next valid block. As a miner you can add a transaction in the block that pays you 6.25 BTC, which is how you get the bitcoins. The block you generate is derived from the previous block. In order for a block to be valid, the block header must generate a hash that is below the threshold. In the header there is a field called a nonce. It's the nonce that you increment until you get a valid hash value.

          Guessing the hash value is no use, it's the nonce you have to guess, which is what miners do. Unless you have a powerful computer center you're always going to lose in the race to generate next valid block header.
          Looking at Bitcoin nonce explained it seems the nonce is a 32-bit integer.. So it doesn't seem like it would take that long to try every possible SHA hash. 2^32 is larger than it seems, but at the end of the day it is only 64K times 64K, which isn't _that_ large, and a SHA hash doesn't take long to generate.
          Work in the public sector? Read the IR35 FAQ here

          Comment


            #6
            One of our posters bought a piece of kit to try it and kept us updated for a short while but it didn't go well. I'll try dig the thread out later.
            'CUK forum personality of 2011 - Winner - Yes really!!!!

            Comment


              #7
              so sh1tcoin's all about Nonces then, eh?
              stands to reason, i suppose

              Comment


                #8
                Originally posted by BR14 View Post
                so sh1tcoin's all about Nonces then, eh?
                For the nonce it appears to be.

                Down with racism. Long live miscegenation!

                Comment


                  #9
                  Originally posted by OwlHoot View Post

                  Looking at Bitcoin nonce explained it seems the nonce is a 32-bit integer.. So it doesn't seem like it would take that long to try every possible SHA hash. 2^32 is larger than it seems, but at the end of the day it is only 64K times 64K, which isn't _that_ large, and a SHA hash doesn't take long to generate.
                  That's a good point. The hash is generated from the entire header which is 80 bytes, so I presume the chances are for a specific header that there is no valid nonce and you will have to keep generating alternative headers with a new timestamp and a hash (merkle root) which is generated from the transactions included in the block. So probably you have to try alternatives with different combinations of transactions. Miners will be receiving new transactions continuously which can be included the block.
                  Last edited by BlasterBates; 24 October 2021, 10:44.
                  I'm alright Jack

                  Comment


                    #10
                    Originally posted by northernladuk View Post
                    One of our posters bought a piece of kit to try it and kept us updated for a short while but it didn't go well. I'll try dig the thread out later.
                    I received my new PC (well my company's new PC) just over 2 weeks ago. I have mined Ethereum to the value of $100 in that time. The electricity is cost is below that.
                    My GPU is a 3080Ti LHR.
                    I get c. 80MH/s for Ethereum mining.
                    Cost of the PC was £2,200 + VAT.

                    Is it economically viable? Not really, not at an electrical cost of 20p/kWh
                    If you have the GPU anyway is it viable? Yes as it subsidies the purchase.
                    And if you're into games, then it it makes sense to mine with the spare GPU cycles.

                    Is it good for the environment. No. It's a daft idea. But..... I no longer need the heating on in my home office
                    See You Next Tuesday

                    Comment

                    Working...
                    X