Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: kristiano92 on April 09, 2020, 01:33:02 PM



Title: Group blocks / addresses by mining pool
Post by: kristiano92 on April 09, 2020, 01:33:02 PM
Hello everone :)

I would like to implement a script, which takes all blocks and group them by mining pool name, which is written in a coinbase data. Next, I want to take all coinbase transactions (1st tx from every block) and write outputs of them to proper mining pools. A mining pool could has more than 1 address. Moreover, some of them could send funds directly to users or some of them have more than 1 output. What  e.g. 2. What is the best way to obtain these results? What parameters should I take? Any help will be appreciated :)


Title: Re: Group blocks / addresses by mining pool
Post by: pooya87 on April 09, 2020, 01:51:46 PM
you can always visit a block explorer that has already done this like this: https://blockchair.com/bitcoin/blocks#f=id,guessed_miner and see what miner they have "guessed" to have mined the blocks. you can add a condition so that miner is equal to certain name and see those blocks only.

if you want to do it yourself you you have to have access to local copy of the blockchain then read each block's first transaction then you should be able to 1) deserialize a coinbase transaction 2) read coinbase scriptsig 3) decode it with UTF8 4) get rid of extra stuff. then try to parse the name strings and guess which miner has mined that block.


Title: Re: Group blocks / addresses by mining pool
Post by: jackg on April 09, 2020, 01:54:39 PM
You'll probably want to download the blockchain after installing bitcoin core and the find a parser that can read this informatiom into a csv file or similar.

The parser would act as a second step after you have the data and can be programmed to read through the chain and detect the information listed above.

Are you a programmer? Do you have any experience or know anyone that could help with this? Is there a goal for your project?


Title: Re: Group blocks / addresses by mining pool
Post by: kristiano92 on April 10, 2020, 07:56:03 AM
Yes. I want to find all addresses of mining pools and group them. Explorers have some errors. For instance, according to btc.com this address 147SwRQdpCfj5p8PnfsXV2SsVVpVcz3aPq is tagged as CanoePool and still mines new coins, but last block of this pool was mined in 2018. I think, this address belongs to another pool.


Title: Re: Group blocks / addresses by mining pool
Post by: pooya87 on April 10, 2020, 08:55:48 AM
Yes. I want to find all addresses of mining pools and group them. Explorers have some errors. For instance, according to btc.com this address 147SwRQdpCfj5p8PnfsXV2SsVVpVcz3aPq is tagged as CanoePool and still mines new coins, but last block of this pool was mined in 2018. I think, this address belongs to another pool.

i can't find the tag but you can easily decode the scriptsig of the coinbase transaction like this:
Code:
03f5870941d7a2ae3df2c5b341d7a2ae3d6dd57c2f315448617368263538434f494e2ffabe6d6d403ace9685148ea02d7933281963b2c04b0f9c99b2b6c6accf23638a6e0d7b4980000000000000009606ba787843c40000000000

first 4 bytes are the block height:
03-f58709
the rest is usually a push of the name of the pool but can contain other stuff:
hex = 41d7a2ae3df2c5b341d7a2ae3d6dd57c2f315448617368263538434f494e2ffabe6d6d403ace9685148ea02d7933281963b2c04b0f9c99b2b6c6accf23638a6e0d7b4980000000000000009606ba787843c40000000000
UTF8 = Aע�=�ųAע�=m�|/1THash&58COIN/��mm@:Z���-y3(c��K����Ƭ�#c�n
{I�
pool name is: /1THash&58COIN/


Title: Re: Group blocks / addresses by mining pool
Post by: aliashraf on April 11, 2020, 07:37:37 PM
Yes. I want to find all addresses of mining pools and group them.
Check this thread:
https://bitcointalk.org/index.php?topic=5232785
You might need something like this for pools. Feed one of the addresses that they use to collect block rewards and a few addresses that they use for paying to miners.