Bitcoin Forum
May 12, 2024, 05:27:42 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: 谁了解挖矿协议?关于midstate,target,data,hash1这些字段  (Read 3500 times)
thomas92911 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
July 02, 2011, 08:22:02 AM
 #1

从矿池拿到一个任务如下:

{"id":0,"error":null,"result":{"midstate":"adaf1ff882043d7dd777665009afb0f9f2e2faabf9026ad43e9e1ae91f2d6bef","target":"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000","data":"000000012c9c355ce91cc07063ad2fc47c2349c988f6528d8d893ca50000038f000000005822ea2 8f8ae545e273d32d0874408575916520a578d2c8edeb28e451ab8ce7b4e0de6be1a0c2a12000000 0000000080000000000000000000000000000000000000000000000000000000000000000000000 0000000000080020000","hash1":"0000000000000000000000000000000000000000000000000000000000000000000000800000000 0000000000000000000000000000000000000000000010000"}}

bitcoin-miner计算出了一个结果:
{"params":["000000012C9C355CE91CC07063AD2FC47C2349C988F6528D8D893CA50000038F000000005822EA2 8F8AE545E273D32D0874408575916520A578D2C8EDEB28E451AB8CE7B4E0DE6BE1A0C2A12724427 FE00000080000000000000000000000000000000000000000000000000000000000000000000000 0000000000080020000"],"method":"getwork","id":"jsonrpc"}

请教这是怎么计算出来的, 用那些字段进行hash得出这种结果?
我翻了好久wiki也没找到, 就想知道详细的原理, 谢谢.
1715534862
Hero Member
*
Offline Offline

Posts: 1715534862

View Profile Personal Message (Offline)

Ignore
1715534862
Reply with quote  #2

1715534862
Report to moderator
1715534862
Hero Member
*
Offline Offline

Posts: 1715534862

View Profile Personal Message (Offline)

Ignore
1715534862
Reply with quote  #2

1715534862
Report to moderator
1715534862
Hero Member
*
Offline Offline

Posts: 1715534862

View Profile Personal Message (Offline)

Ignore
1715534862
Reply with quote  #2

1715534862
Report to moderator
Every time a block is mined, a certain amount of BTC (called the subsidy) is created out of thin air and given to the miner. The subsidy halves every four years and will reach 0 in about 130 years.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715534862
Hero Member
*
Offline Offline

Posts: 1715534862

View Profile Personal Message (Offline)

Ignore
1715534862
Reply with quote  #2

1715534862
Report to moderator
thomas92911 (OP)
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
July 03, 2011, 01:06:25 PM
 #2

通过调试了一天的ufasoft_bitcoin-miner,终于搞明白了

hash1字段无用, 可以无视
midstate字段是第一轮hash的abcdefgh
target字段是难度
data字段前64字节无用,后64字节变动第12个字节开始做nonce, 共32字节, hash结果符合难度就提交.

话说我也用sse2编译了, 咋速度才200kHash/s
tu16453899297831
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
May 09, 2013, 06:50:28 PM
 #3

学习学习再学习
iqikdino
Newbie
*
Offline Offline

Activity: 68
Merit: 0


View Profile
May 10, 2013, 01:09:53 AM
 #4

看上去很复杂的样子
esuncloud
Member
**
Offline Offline

Activity: 98
Merit: 10


View Profile
May 10, 2013, 02:14:52 AM
 #5

这个协议是p2pool的么,有兴趣研究一下这个
jl2012
Legendary
*
Offline Offline

Activity: 1792
Merit: 1097


View Profile
May 10, 2013, 02:48:56 AM
 #6

要討論技術問題就到技術版用英文問吧. 這裏絕大部份人只懂炒bitcoin, 炒山寨幣, 挖礦賺錢, 或灌水.

Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY)
LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC)
PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
shifu34337956614
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
May 10, 2013, 03:19:10 PM
 #7

搞明白了
jtdtqbc
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
May 11, 2013, 01:34:16 AM
 #8

这么复杂啊。眼花缭乱
bedboy
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
May 11, 2013, 01:35:17 AM
 #9

好乱
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!