Bitcoin Forum
May 16, 2024, 04:28:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Please help me understand how the covert asicboost worked on: May 06, 2023, 06:47:35 AM
I know that covert asicboost can't be used anymore after segwit.
However, I'm studying it to understand how it worked. I hope you can help me because I am confused.

In particular, I'm studying this doc... https://arxiv.org/ftp/arxiv/papers/1604/1604.00575.pdf

This is the normal mining process (which you are familiar with but which I summarize for completeness) according to that document:
1. in the header there are two chunks
2. the first chunk is modified about once every four billion attempts (maybe even less frequently since we can play with time a bit...but let's not quibble)
3. the second chunk is modified on each attempt by changing the nounce
4. for each chunk an expansion and a compression process is performed
5. the expansion of the first and second chunks are independent of each other
6. on the contrary, the compression of the two chunks must be done in order: first the first, then (starting from the compression of the first) the second
7. then a phase of expansion + compression of the obtained hash (second hash).
8. finally the evaluation of the last hash obtained, to see if it is less than the target

this loop repeats until a hash lower than the target is found. It is not necessary to waste hash power to do the expansion+compression of the first chunk at each attempt: you can 'freeze this process in a 'mid state': at each attempt (that is, at each increase of the nounce) you just do:
(1) chunk expansion 2
(2) chunk compression 2
(3) hash expansion obtained
(4) hash compression obtained

image at page 5 is perfect to show the 4 steps above

With asicboost, you hold the second chunk and only modify the first one (never mind how this was actually done)
this is what I DON'T UNDERSTAND:

image at page 6 is good to show this

according to this figure, 3 steps are taken for each attempt: 2 compressions and one expansion.

But, in my opinion, the 'mid state' assumes an expansion+compression of chunk 1, which with asicboost changes with each attempt (instead of chunk 2 as in normal mining)
therefore, with the asic boost, 5 steps are made at each attempt, and not 3 as the text that I linked says: the 3 that the text says + an expansion + compression for the mid state
so asicboost would be less efficient than normal mining (4 steps).

obviously I misunderstood, and asic boost was not working as it seems to me. I'd like to understand where I'm wrong. I hope I was clear enough and asking a lot but not too much. Thank you!
2  Bitcoin / Development & Technical Discussion / What is wrong with this little python code to hash a header? on: April 10, 2023, 08:48:37 PM
I wrote a short piece of software to check if I understood correctly how the block hash calculation is done.
I started from the python code published here: https://bitcointalk.org/index.php?topic=5439273.0
I analyzed a random block, namely block 784697
the program generates a wrong hash.
please, where am I wrong?

Code:
import binascii
import hashlib

# block 784697    
# decoded_raw_block":{"hash":"000000000000000000044b32a02685122ddef6a1a54990a7f0883577ae67128e","confirmations":5,"height":784697,"version":577257472,"versionHex":"22684000","merkleroot":"97cbf0be2eb628cd1548d3b755f0e04b0fe4f06c15b4882ea90b7a2ae93728c0","time":1681074323,"mediantime":1681068560,"nonce":3518743859,"bits":"1705e0b2","difficulty":47887764338536.25,"chainwork":"0000000000000000000000000000000000000000451ad1754406a7d5e02bdd08","nTx":3932,"previousblockhash":"000000000000000000010550de6754269ccb5adeed388581cfc84f5aea6f45a1","nextblockhash":"0000000000000000000271ea86cffc855dc61554ed66b3b824d6e9f7778b5ce9","strippedsize":797005,"size":1601732,"weight":3992747,"tx":
#hash":"000000000000000000044b32a02685122ddef6a1a54990a7f0883577ae67128e
version="22684000"
prevhash="000000000000000000010550de6754269ccb5adeed388581cfc84f5aea6f45a1"
merkle_root="97cbf0be2eb628cd1548d3b755f0e04b0fe4f06c15b4882ea90b7a2ae93728c0"
# "time":1681074323,"mediantime":1681068560,"nonce":3518743859,"bits":"1705e0b2"
nbits="1705e0b2"
ntime="1681074323"
nonce="3518743859"
blockheader = version + prevhash + merkle_root + nbits + ntime + nonce +\
            '000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000'
      
# print('blockheader:\n{}\n'.format(blockheader))
      
hash = hashlib.sha256(hashlib.sha256(binascii.unhexlify(blockheader)).digest()).digest()
hash = binascii.hexlify(hash).decode()
print('hash: {}'.format(hash))

Edit:
I used this link for the node:
https://api.blockchair.com/bitcoin/raw/block/000000000000000000044b32a02685122ddef6a1a54990a7f0883577ae67128e
3  Bitcoin / Development & Technical Discussion / Need help with proof of concept cpu mining on: March 26, 2023, 06:56:31 PM
Hello
I believe that I have an algorithm to mine bitcoin quickly and efficiently.
I studied a bit the asicboost process (https://blog.bitmex.com/an-overview-of-the-covert-asicboost-allegation) : I think my algorithm could be more efficient and could therefore be used to build a new generation of ASICs.
I would like to write some CPU mining software. Of course, in reality this software won't mine any blocks and I won't get any rewards. My aim is to compare it with other similar software (CPU mining), and to see if my algorithm reduces the work to be done and therefore can be used to design new more efficient ASICs.



I would like to proceed like this.
- download bitcoin core and put it to use
- download a bitcoin miner software (https://developer.bitcoin.org/devguide/mining.html) in which it is possible to use the CPU
- modify that mining software with my algorithm to see if it -works better

I found these three bitcoin node implementations:
- python: https://pypi.org/project/bitcoinlib/
- golang: https://github.com/btcsuite/btcd
- rust: https://github.com/jrawsthorne/rust-bitcoin-node
I don't take into consideration the classic implementation in c/c++ because I know almost nothing about C++ and nothing about C, and in any case these two languages don't interest me (actually, I don't even know rust or golang yet, but I'm interested in learning about them one, especially rust, and this could be a good occasion)

My questions are:
- are these three implementations (python/go/rust) all equally stable?
- Is there any mining software written in python/go/rust for use with these implementations that, starting with an RPC getblocktemplate call, starts mining with the CPU? (my job will be: modify this software)
- with a bitcoin node + mining software (if it exists) would I have everything I need to start mining with the CPU or do I need something else?

thank you for accepting me in this forum, for your attention and  for your help
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!