Bitcoin Forum
June 14, 2024, 03:29:03 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need help finding miner from block  (Read 826 times)
IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 01:45:51 PM
 #1

I am trying to create my own statistical data, and can not figure out how Blockchain.info get the relayed by on a block for the miner name?

I DO NOT want to use Blockchain.info API as I am using bitcoind API to get information.

I looked at the functions in bitcoind API, I just don't see where they are finding the miner data.

Please help
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 16, 2015, 02:31:41 PM
 #2

https://github.com/blockchain/Blockchain-Known-Pools
IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 03:01:12 PM
 #3


Not sure how that helps what I am asking..

I want to know the miner the moment the block gets created, and I need to do this automatically.

What data do I need to get to find this.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3416
Merit: 6700


Just writing some code


View Profile WWW
July 16, 2015, 03:04:26 PM
 #4

The hex of the coinbase transaction has a a part, I don't remember where, that is called the coinbase signature. It is simply ACII text encoded in hex. Most pools will put their own signature that indicates that they mined the block. However, it is not always reliable since anyone can put anything there, but it gives an idea of who was the miner.

amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 16, 2015, 03:18:43 PM
 #5

Not sure how that helps what I am asking..
I want to know the miner the moment the block gets created, and I need to do this automatically.
What data do I need to get to find this.
So, you are  miner with an asic.
And you are connected to some mining pool.
You want to check that the data from the pool refers to this particular pool and admin do not use your hashpower for mining on another pool.

Or you are man-in-the-middle between miner and his pool.
You want to sniff traffic and discover the pool.

Sorry, I do not have answers, because I do not know how stratum protocol works
IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 04:11:09 PM
 #6

Not sure how that helps what I am asking..
I want to know the miner the moment the block gets created, and I need to do this automatically.
What data do I need to get to find this.
So, you are  miner with an asic.
And you are connected to some mining pool.
You want to check that the data from the pool refers to this particular pool and admin do not use your hashpower for mining on another pool.

Or you are man-in-the-middle between miner and his pool.
You want to sniff traffic and discover the pool.

Sorry, I do not have answers, because I do not know how stratum protocol works

I am not a miner.

Just trying to figure out how Blockchain.info get the relayed by from the block (Miner) within there data on the blocks.

Here is an example pulled from Blockchain.info (Field in RED is what I am trying to get)

HeightAgeTransactionsTotal SentRelayed BySize (kb)
3655786 minutes2562$ 9,936,634.34BW.COM926.89
36557743 minutes1162$ 6,461,692.26F2Pool578.26
36557656 Minutes345$ 2,112,978.40BTCChina Pool287.62
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
July 16, 2015, 04:22:23 PM
 #7

Here is an example pulled from Blockchain.info (Field in RED is what I am trying to get)
My link above is the answer for your question. Smiley
blockchain.info uses this file to determine the pool

for example:
block height 365578
coinbase tx: 8182ffab8e02c7a21a63f92ff96cc3c62e77401f70f3b0f3b30640d58a63e510
coinbase raw data:
0000000000: 01 00 00 00 01 00 00 00 │ 00 00 00 00 00 00 00 00  ☺   ☺
0000000010: 00 00 00 00 00 00 00 00 │ 00 00 00 00 00 00 00 00
0000000020: 00 00 00 00 00 FF FF FF │ FF 46 03 0A 94 05 07 06           F♥◙ö♣•♠
0000000030: 2F 50 32 53 48 2F 04 48 │ D3 A7 55 04 F0 18 D8 3A  /P2SH/♦H╙ºU♦≡↑╪:
0000000040: 08 CB 01 42 59 2C 07 00 │ 40 0A 42 57 20 53 75 70  ◘╦☺BY,• @◙BW Sup
0000000050: 70 6F 72 74 20 38 4D 20 │ 0A 66 69 73 68 65 72 20  port 8M ◙fisher
0000000060: 6A 69 6E 78 69 6E 09 2F │ 42 57 20 50 6F 6F 6C 2F  jinxin○/BW Pool/
0000000070: FF FF FF FF 01 04 E6 12 │ 98 00 00 00 00 19 76 A9      ☺♦µ↕ÿ    ↓v⌐
0000000080: 14 BE 26 82 B4 D8 E8 E5 │ 26 07 C6 49 AC 26 69 DC  ¶╛&é┤╪Φσ&•╞I¼&i▄
0000000090: 1E E3 C8 5E 37 88 AC 00 │ 00 00 00                 ▲π╚^7ê¼


pools.json data:
Code:
 "BW Pool" : {
            "name" : "BW.COM",
            "link" : "https://bw.com/"
        },

So, the display name = BW.COM
Link = https://bw.com/

 
IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 04:41:15 PM
 #8

Here is an example pulled from Blockchain.info (Field in RED is what I am trying to get)
My link above is the answer for your question. Smiley
blockchain.info uses this file to determine the pool

for example:
block height 365578
coinbase tx: 8182ffab8e02c7a21a63f92ff96cc3c62e77401f70f3b0f3b30640d58a63e510
coinbase raw data:
0000000000: 01 00 00 00 01 00 00 00 │ 00 00 00 00 00 00 00 00  ☺   ☺
0000000010: 00 00 00 00 00 00 00 00 │ 00 00 00 00 00 00 00 00
0000000020: 00 00 00 00 00 FF FF FF │ FF 46 03 0A 94 05 07 06           F♥◙ö♣•♠
0000000030: 2F 50 32 53 48 2F 04 48 │ D3 A7 55 04 F0 18 D8 3A  /P2SH/♦H╙ºU♦≡↑╪:
0000000040: 08 CB 01 42 59 2C 07 00 │ 40 0A 42 57 20 53 75 70  ◘╦☺BY,• @◙BW Sup
0000000050: 70 6F 72 74 20 38 4D 20 │ 0A 66 69 73 68 65 72 20  port 8M ◙fisher
0000000060: 6A 69 6E 78 69 6E 09 2F │ 42 57 20 50 6F 6F 6C 2F  jinxin○/BW Pool/
0000000070: FF FF FF FF 01 04 E6 12 │ 98 00 00 00 00 19 76 A9      ☺♦µ↕ÿ    ↓v⌐
0000000080: 14 BE 26 82 B4 D8 E8 E5 │ 26 07 C6 49 AC 26 69 DC  ¶╛&é┤╪Φσ&•╞I¼&i▄
0000000090: 1E E3 C8 5E 37 88 AC 00 │ 00 00 00                 ▲π╚^7ê¼


pools.json data:
Code:
 "BW Pool" : {
            "name" : "BW.COM",
            "link" : "https://bw.com/"
        },

So, the display name = BW.COM
Link = https://bw.com/

 

Amaclin:

So is there a bitcoind API to call to retrieve this data?
I am looking at getblock results:

is tx the coinbase tx?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3416
Merit: 6700


Just writing some code


View Profile WWW
July 16, 2015, 04:55:41 PM
 #9

So is there a bitcoind API to call to retrieve this data?
I am looking at getblock results:

is tx the coinbase tx?
The coinbase tx is the first txid in the array tx that you see when you do getblock. In order to get the transactions data, you need to do getrawtransaction to get the transaction data. In order to get transaction data from Bitcoin Core though, it needs to be started with the -txindex flag in order to see transactions that aren't yours. This will require a rebuild of the entire blockchain so that it can have all of the transactions.
To get the data from get raw transaction:
Code:
getrawtransaction <txid> 1
The 1 makes it verbose so that you get the transaction decoded instead of just hex data. There will be a field labeled "coinbase" in the coinbase transaction and that contains the pool data you are looking for.

jonnybravo0311
Legendary
*
Offline Offline

Activity: 1344
Merit: 1023


Mine at Jonny's Pool


View Profile WWW
July 16, 2015, 04:59:14 PM
 #10

I've done this... there are a number of things that contribute to getting who mined data.  The coinbase signature isn't necessarily reliable because you can put whatever you want there.  Sure, a lot of pools advertise they solved a block by putting some identifier in there.  You can also use the BTC address of the generation transaction.  Sometimes you can use the fact that the coinbase transaction has a ton of outputs (p2pool).  It's a messy process where you need to scrape the data and analyze it, and even then you aren't guaranteed to figure out who actually solved the block.

If you're using standard core APIs:

getblockhash
getblock
getrawtransaction

Jonny's Pool - Mine with us and help us grow!  Support a pool that supports Bitcoin, not a hardware manufacturer's pockets!  No SPV cheats.  No empty blocks.
IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 05:07:21 PM
 #11

I've done this... there are a number of things that contribute to getting who mined data.  The coinbase signature isn't necessarily reliable because you can put whatever you want there.  Sure, a lot of pools advertise they solved a block by putting some identifier in there.  You can also use the BTC address of the generation transaction.  Sometimes you can use the fact that the coinbase transaction has a ton of outputs (p2pool).  It's a messy process where you need to scrape the data and analyze it, and even then you aren't guaranteed to figure out who actually solved the block.

If you're using standard core APIs:

getblockhash
getblock
getrawtransaction

So are you stating the Blockchain.info doesn't necessary have the correct information too?

Yes, I am using the standard core API
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3416
Merit: 6700


Just writing some code


View Profile WWW
July 16, 2015, 05:11:05 PM
 #12

I've done this... there are a number of things that contribute to getting who mined data.  The coinbase signature isn't necessarily reliable because you can put whatever you want there.  Sure, a lot of pools advertise they solved a block by putting some identifier in there.  You can also use the BTC address of the generation transaction.  Sometimes you can use the fact that the coinbase transaction has a ton of outputs (p2pool).  It's a messy process where you need to scrape the data and analyze it, and even then you aren't guaranteed to figure out who actually solved the block.

If you're using standard core APIs:

getblockhash
getblock
getrawtransaction

So are you stating the Blockchain.info doesn't necessary have the correct information too?

Yes, I am using the standard core API
They don't always have the correct info either. You can see this thread https://bitcointalk.org/index.php?topic=123726.0 to read more about it.

IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 05:16:14 PM
 #13

I've done this... there are a number of things that contribute to getting who mined data.  The coinbase signature isn't necessarily reliable because you can put whatever you want there.  Sure, a lot of pools advertise they solved a block by putting some identifier in there.  You can also use the BTC address of the generation transaction.  Sometimes you can use the fact that the coinbase transaction has a ton of outputs (p2pool).  It's a messy process where you need to scrape the data and analyze it, and even then you aren't guaranteed to figure out who actually solved the block.

If you're using standard core APIs:

getblockhash
getblock
getrawtransaction

So are you stating the Blockchain.info doesn't necessary have the correct information too?

Yes, I am using the standard core API
They don't always have the correct info either. You can see this thread https://bitcointalk.org/index.php?topic=123726.0 to read more about it.

Thank you very helpful
jonnybravo0311
Legendary
*
Offline Offline

Activity: 1344
Merit: 1023


Mine at Jonny's Pool


View Profile WWW
July 16, 2015, 05:26:26 PM
 #14

So are you stating the Blockchain.info doesn't necessary have the correct information too?

Yes, I am using the standard core API
That's exactly what I'm stating.  Blockchain.info, whomined.com, my code... we all make best guesses based upon evaluating the coinbase script, the BTC addresses of the coinbase transaction, counting the number of vouts in the coinbase transaction, etc.  There simply is no definitive way to describe who found the blocks with 100% accuracy.

Jonny's Pool - Mine with us and help us grow!  Support a pool that supports Bitcoin, not a hardware manufacturer's pockets!  No SPV cheats.  No empty blocks.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3416
Merit: 6700


Just writing some code


View Profile WWW
July 16, 2015, 05:37:16 PM
 #15

So are you stating the Blockchain.info doesn't necessary have the correct information too?

Yes, I am using the standard core API
That's exactly what I'm stating.  Blockchain.info, whomined.com, my code... we all make best guesses based upon evaluating the coinbase script, the BTC addresses of the coinbase transaction, counting the number of vouts in the coinbase transaction, etc.  There simply is no definitive way to describe who found the blocks with 100% accuracy.
If you could connect to every single node in the world, then it would be possible to identify which ip address first relayed a block. That node would be the person who found the block and that ip address could then be associated to a name.

jonnybravo0311
Legendary
*
Offline Offline

Activity: 1344
Merit: 1023


Mine at Jonny's Pool


View Profile WWW
July 16, 2015, 06:00:12 PM
 #16

LOL... which goes right back to what I stated... there's no way to definitively identify the block finder since you cannot connect to every single node out there.

Jonny's Pool - Mine with us and help us grow!  Support a pool that supports Bitcoin, not a hardware manufacturer's pockets!  No SPV cheats.  No empty blocks.
IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 06:01:58 PM
 #17

But Coinbase TX is immutable is it not?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3416
Merit: 6700


Just writing some code


View Profile WWW
July 16, 2015, 06:06:08 PM
 #18

But Coinbase TX is immutable is it not?
The miner can put whatever he wants into it. He could put the coinbase sig and impersonate some other miner if he wanted. Once the block is mined, it becomes immutable, but the miner has free reign over what goes inside.

IanQuinn (OP)
Member
**
Offline Offline

Activity: 64
Merit: 10


View Profile
July 16, 2015, 09:39:35 PM
 #19

I like to thank the board for all your help.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!