IanQuinn (OP)
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 01:45:51 PM |
|
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
Activity: 1260
Merit: 1019
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 02:31:41 PM |
|
|
|
|
|
IanQuinn (OP)
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 03:01:12 PM |
|
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
Activity: 3486
Merit: 6806
Just writing some code
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 03:04:26 PM |
|
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
Activity: 1260
Merit: 1019
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 03:18:43 PM |
|
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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 04:11:09 PM |
|
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) Height | Age | Transactions | Total Sent | Relayed By | Size (kb) | 365578 | 6 minutes | 2562 | $ 9,936,634.34 | BW.COM | 926.89 | 365577 | 43 minutes | 1162 | $ 6,461,692.26 | F2Pool | 578.26 | 365576 | 56 Minutes | 345 | $ 2,112,978.40 | BTCChina Pool | 287.62 |
|
|
|
|
amaclin
Legendary
Offline
Activity: 1260
Merit: 1019
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 04:22:23 PM |
|
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](https://bitcointalk.org/Smileys/default/smiley.gif) 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: "BW Pool" : { "name" : "BW.COM", "link" : "https://bw.com/" },
So, the display name = BW.COMLink = https://bw.com/
|
|
|
|
IanQuinn (OP)
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 04:41:15 PM |
|
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](https://bitcointalk.org/Smileys/default/smiley.gif) 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: "BW Pool" : { "name" : "BW.COM", "link" : "https://bw.com/" },
So, the display name = BW.COMLink = 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
Activity: 3486
Merit: 6806
Just writing some code
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 04:55:41 PM |
|
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: 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
Activity: 1344
Merit: 1023
Mine at Jonny's Pool
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 04:59:14 PM |
|
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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 05:07:21 PM |
|
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
Activity: 3486
Merit: 6806
Just writing some code
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 05:11:05 PM |
|
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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 05:16:14 PM |
|
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
Activity: 1344
Merit: 1023
Mine at Jonny's Pool
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 05:26:26 PM |
|
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
Activity: 3486
Merit: 6806
Just writing some code
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 05:37:16 PM |
|
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
Activity: 1344
Merit: 1023
Mine at Jonny's Pool
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 06:00:12 PM |
|
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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 06:01:58 PM |
|
But Coinbase TX is immutable is it not?
|
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3486
Merit: 6806
Just writing some code
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 06:06:08 PM |
|
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
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 64
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
July 16, 2015, 09:39:35 PM |
|
I like to thank the board for all your help.
|
|
|
|
|