Bitcoin Forum
May 04, 2024, 09:57:22 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Hardware / Re: GekkoScience 2Pac BM1384 Stickminer Official Support Thread on: February 10, 2018, 11:01:58 PM

vh, I was wondering if these 2pac checks against difficulty ? Datasheet says 4 bytes from byte position 36 to 39 set as ticket mask for difficulty.
But gekko driver code seems only setting ticket_mask at 39th byte position. What extactly is this ticket_mask?

I tried setting Network difficulty as below and seemed it work but later found its not always returning true nonce for every sample worked example I was using.
I think these chips keep iterating from 0 to max nonce and return every nonce which result in hash with first 4 bytes with 0. Is that true ?

...

Appreciate if you could help me here. Thanks !!!

For a valid ticket mask, think of network mask and CIDR notation.   
When visualizing a CIDR in bit form, a mask with 0's scattered between 1's is not valid.

Starting at 4GHs, every time the hash rate double(s) its worth tacking a bit onto the mask.
If the 2Pac ever push past 1TH(s), then I'll add a todo to check if the other bytes do what they are suppose to.

--

The chip iterates 2^32 nonces instead of 0 to max nonce. 
To experiment with SNO you probably need to pair it with HCN.


Thanks, appreciate for your explanation. for 100mhz, ticket mask is set as 31 (0x1f)
So..

Ticket mask tells number of bits to use for validating all 0's ?

Or

Ticket mask is only 4 bytes whereas hash is 32 byte,
So does that means this device only masking last 4 bytes and will return any nonce that results in last 4 bytes with 0's ?

Or

I'm no expert when it comes to binary operations, but if we ignore the fact of hashrate this device produce and above statement is not true, my understanding below is correct ?
take example of this current target
0000000000000000-0000000000000000-00000000f8e96100-0000000000000000

and its binary conversion of last 16 bytes:
0000000000000000000000000000000011111000111010010110000100000000-0000000000000000000000000000000000000000000000000000000000000000

If I have to create mask to satisfy current target, it should be like this ?
0000000000000000000000000000000000000000000000000000000111111111-1111111111111111111111111111111111111111111111111111111111111111

How to represent this in 4 bytes of ticket mask ? or each byte represent each 8 byte chunk if hash ?

2  Bitcoin / Hardware / Re: GekkoScience 2Pac BM1384 Stickminer Official Support Thread on: February 09, 2018, 04:54:09 PM
Recall all the advice that's been given to you already.

Sidehack, would you be able to help me with my question to vh above ?
3  Bitcoin / Hardware / Re: GekkoScience 2Pac BM1384 Stickminer Official Support Thread on: February 09, 2018, 07:12:13 AM
ck has released a new version of cgminer this week, does this build include the latest code or the version prior?

Yes, it includes all the latest updates from ck's repository.
Including some related to system libusb that has sent my windows build example back to the drawing board.  Sad
   
The entry page to my repository should say "This branch is N commits ahead of ckolivas:master. ".
If it's ever "commits behind" just let me know.




vh, I was wondering if these 2pac checks against difficulty ? Datasheet says 4 bytes from byte position 36 to 39 set as ticket mask for difficulty.
But gekko driver code seems only setting ticket_mask at 39th byte position. What extactly is this ticket_mask?

I tried setting Network difficulty as below and seemed it work but later found its not always returning true nonce for every sample worked example I was using.
I think these chips keep iterating from 0 to max nonce and return every nonce which result in hash with first 4 bytes with 0. Is that true ?

Code:
_data[36] = (byte)((difficulty >> 24) & 0xff);
_data[37] = (byte)((difficulty >> 16) & 0xff);
_data[38] = (byte)((difficulty >> 8) & 0xff);
_data[39] = (byte)(difficulty & 0xff);

Actually I have written small POC kind of app in c# to test and wondering how to control difficulty its checking against.
Also it seems you are not using Start nonce offset, in my test I found any value above 1 was not working.
How to set the SNO properly so that device only starts the work from particular nonce instead of 0.

Appreciate if you could help me here. Thanks !!!
4  Bitcoin / Development & Technical Discussion / Re: Generate coinbase from to send to miner (ckpool source code question) on: February 08, 2018, 12:33:22 AM
Thanks, Below is the request received from pool, so if you check first header above which looks like big endian has previous hash as is.
It is not big endian.

I do not think that this is exactly what your miner received from the pool. I think what you are seeing is based on an internal representation of the data which makes it appear to be different than what it actually is.

So bloc header has previous hash flipped in 32 bit chunk ?
That is what is being displayed, but that is not what it actually has to be in the block header.

But as per documentation it doesn't say so.
Because your miner is displaying that information incorrectly.

prev_hash: da780ff935f3917ed99a7b616cb98ebb3104b3fa000b7acd0000000000000000
The correct block hash is f90f78da7e91f335617b9ad9bb8eb96cfab30431cd7a0b000000000000000000. You will notice that if you byteswap this so that it is actually in big endian, the block hash becomes 0000000000000000000b7acd3104b3fa6cb98ebbd99a7b6135f3917eda780ff9 which is an actual block that you look up on a block explorer or node. Looking up what your miner is displaying in both its original form and byteswapped form results in not being able to find such a block.

Strange, I can confirm its not cgminer.. I connected to ckpool using tcp socket and raw received message has flipped previous hash
as 6daed056abb0d17f362455ec230dd738ca958301001084f40000000000000000
It should be 56d0ae6d7fd1b0abec55243638d70d23018395caf48410000000000000000000

This better should be reviewed with ck I guess on whats going on Smiley
Alright for now I'm ignoring what cgminer/ckpool doing since its making me crazy. I'm able to prepare correct coinbase now and its decodes properly. Thanks to you Smiley

Last questions:

1. Transaction ids received from GBT should be reversed byte-wise or used as is to calculate markel ?
2. Considering the is no transaction so sha256d of coinbase becomes the markel and 2xhash output of coinbase should be used as is in block header or it should flipped byte-wise ?
ex: 2xSha256 of below coinbase

01000000010000000000000000000000000000000000000000000000000000000000000000fffff fff2c03dc851300043c487b5a0c5a7b47ff0100000000000000066e5175616e740d2f6e5175616e 742e706f6f6c2fffffffff026fe2ab04000000001976a9144ab4b2aa35879fe47e6a16ea783494f 9dcf615b788ac0000000000000000266a24aa21a9ed60af3e8651f28353ad47a0664c3892b67d82 0d3828af0c5dc854fc2e0bec44d200000000

= 5cb15257b783b9a4c12d1425ad80985a9d43ee474019d5026d04a0e80090f32b

So block header should use it as is or it should be flipped ?

0000002062be1e317f0dce1aa3fcf2b3bf9d604e2b20e853a7575ba03e0d0000000000005cb15257b783b9a4c12d1425ad80985a9d43ee474019d5026d04a0e80090f32b898e7b5aaddc001b00000000

3. Submitblock param = block header + (number of transactions + 1 for coinbase) + coinbase + All the transaction data field received from GBT . Is this correct ?
5  Bitcoin / Development & Technical Discussion / Re: Generate coinbase from to send to miner (ckpool source code question) on: February 07, 2018, 02:57:49 PM
cgminer log shows stratum header constructed as below
20000000da780ff935f3917ed99a7b616cb98ebb3104b3fa000b7acd0000000000000000854e4bddb4eeb7c1841b651ceb26f4d12116bfcc2c41ed18220fd701571914ba5a6fdbfa176c214 600000000

Look at version, time, difficulty part. Shouldn't it be flipped as big endian ?
No, everything in Bitcoin is serialized as little endian. Actually, this is serialized as big endian, but in kind of a strange way. It seems like it is being printed out with each 4 byte chunk (32 bit integer length) in big endian, which also means that the merkle root and previous block hash fields are messed up. But this is not the actual block header it is hashing.

And at the calculation of midsate its flipping all 4 bytes.. meaning 00000020f90f78da7e91f335617b9ad9bb8eb96cfab30431cd7a0b000000000000000000dd4b4e8 5c1b7eeb41c651b84d1f426ebccbf162118ed412c01d70f22
This is the correct block header. Everything is in little endian as it should be. This is what the block header should look like.

When submitblock is called, what should be sent as block header ?
The second one.

Thanks, Below is the request received from pool, so if you check first header above which looks like big endian has previous hash as is.
So bloc header has previous hash flipped in 32 bit chunk ? But as per documentation it doesn't say so.


merkle 0: a3d18668bdf36123c62d4f514bf73ea4c7aa6fae2e84b5e5a05a9150167fa029
merkle 1: 56d152aca6c6dd57b6e76c57f6372c6c7bc17e3d2a4b60716129f3c14034cd04
merkle 2: 0e87a49ac8f40fcecf8d5401eccf41dbb1a83884d571119ac50e26f0a8e102ed
merkle 3: 3a017f03b73bf13542e19b8c72083ca666fb3ae8411c7f11043c4fd96ef79b8a
merkle 4: ba6a063a2d07b85a01d18e3cf66752a131a92b797e718d1d7643d9eb9e794afe
merkle 5: 3239626b7d311d43005f593a361c560da9ef9cda164a1fd78e5af9cbaa8006a5
merkle 6: b8e581d27c1830817fbc92df080d474ee0294c377a27d65b6fb38c6971297461
merkle 7: 01f51b074a5c7bf4b4848e4eee2933eca04b819c24973f598f667bf78c88ed11
Pool 0 coinbase 01000000010000000000000000000000000000000000000000000000000....
job_id: 59e1661b0002aa39
prev_hash: da780ff935f3917ed99a7b616cb98ebb3104b3fa000b7acd0000000000000000
coinbase1: 0100000001000000000000000000000000000000000000000000000000000000...
coinbase2: 0a636b706f6f6c112f736f6c6f2e636b706f6f6c2e6f72672fffffffff03d0b3...
bbversion: 20000000
nbit: 176c2146
ntime: 5a6fdbfa
6  Bitcoin / Development & Technical Discussion / Re: Generate coinbase from to send to miner (ckpool source code question) on: February 07, 2018, 04:51:56 AM
You are awesome. Thanks for taking time and explain each parts.
I highly suggest that you read Bitcoin.org's documentation on the raw transaction format as that is basically what you are being given by the stratum protocol. All it is giving you is the entire coinbase transaction with some parts missing that the miner needs to fill out. Those are the nonce and extra nonce which are part of the coinbase.

Coinbase1
----------------
Header               |   01000000010000000000000000000000000000000000000000000000000000000000000000fffff fff
This is not a header. This consists of 4 different fields. The first 4 bytes are the transaction version number, the next byte is the number of inputs. The next 32 bytes are the transaction id of the transaction the input spends from. The 4 bytes after that are the index of the output that is being spent. In a coinbase transaction, the previous txid must be all 0's, and the output index must be 0xffffffff.

Length               |   35 (<= this is 53 decimal length counts till signature part Huh )
Yes, that is the length. It is the length of the scriptSig, which in a coinbase transaction, is known as the coinbase.

Height               |   0371bb07
The first byte is a length specifier. The next 3 bytes are the block height. This is pursuant to BIP 34

                  |   ffffffff (<= is this separator between tx in and tx out ?)
No, this is not a separator. It is the sequence number. Every input has a 4 byte sequence number.

end                       |   00000000
That's the transaction lock time, not "end".

Thanks my friend, actually I'm aware of first part of coinbase1, I'm just calling it header because cgminer has it as static variable name sigheader something. I'm now able to construct entire coinbase but it fails to decode. I'll look try read the document in depth and see if I can figure out what I'm doing wrong. On one look everything looks simple to put together But man so many concepts to go wrong Sad  crazy architecture Smiley

For now I'm putting it on side to study, but now caught into something I though I have solved about stratum header.. This should be separate question but just wanted to put short question in case you have pretty simple explanation.

cgminer log shows stratum header constructed as below
20000000da780ff935f3917ed99a7b616cb98ebb3104b3fa000b7acd0000000000000000854e4bd db4eeb7c1841b651ceb26f4d12116bfcc2c41ed18220fd701571914ba5a6fdbfa176c2146000000 00

Look at version, time, difficulty part. Shouldn't it be flipped as big endian ?

And at the calculation of midsate its flipping all 4 bytes.. meaning 00000020f90f78da7e91f335617b9ad9bb8eb96cfab30431cd7a0b000000000000000000dd4b4e8 5c1b7eeb41c651b84d1f426ebccbf162118ed412c01d70f22

When submitblock is called, what should be sent as block header ?
7  Bitcoin / Development & Technical Discussion / Re: Generate coinbase from to send to miner (ckpool source code question) on: February 03, 2018, 08:28:51 PM
1. In second part of coinbase ckpool has extradata ckpool and signature /solo.ckpool.org/
hex : 0a 636b706f6f6c (this converts to ckpool) 11 2f736f6c6f2e636b706f6f6c2e6f72672f (this converts to /solo.ckpool.org/)

Q: ckpool is 6 bytes, why its length is set to 0a ?
These aren't actually length specifiers but rather just straight unicode text. The coinbase part of a coinbase transaction can contain basically anything it wants (except that it must begin with the block height and be less than 100 bytes) that does not have to conform to any particular serialization rules. So What this really represents is a newline (0a is newline) followed by ckpool and then another unicode separator and then /solo.ckpool.org/

2. If I want to generate all reward into single wallet address (cScriptPubKey), below pseudo code serialized as per protocol for coinbase 2 is correct ?
I think its should be either 0xffffffff or cCoinbaseValue (coinbasevalue is serialized value returned in getblocktemplate response)

var txOut = cExtraData + cSignature + "ffffffff" + cCoinbaseValue + cScriptPubKey + 0.ToString("x8") + cCommitment + cLockout;
No, this is incorrect. This contains more data than should be in a transaction output. What you have is some combination of the input data and the output data. This is actually the second half of the coinbase transaction which includes all of the outputs and part of the input data.

The only things in a transaction output are the value and scriptPubKey. So you should only have cCoinbaseValue and cScriptPubKey.

0337a3954a (<= what value is this?)
This is actually two values.

The 03 specifies the number of outputs. There are 3 outputs. The rest of that is part of the value.

00000000 (<= if above part is reward value, what is this ?)
This is part of the value. It should be combined with the last 4 bytes of the previous value as the full structure is a 64 bit integer. The full thing is 37a3954a00000000. This is the little endian encoding of the value (which is what Bitcoin uses). The value in decimal is 1251320631 satoshis.

17a9144ab4b2aa35879fe47e6a16ea783494f9dcf615b78772ddc0 (I assume this is where the reward goes)
Only part of this is the output script. That is 17a9144ab4b2aa35879fe47e6a16ea783494f9dcf615b787. The 72ddc0 is part of the next thing.

0000000000
This is the part of the last 3 bytes of the previous thing which is the value of the next output. The value of this is 72ddc00000000000 which is 12639602 satoshis.

1976a914f4cbe6c6bb3a8535c963169c22963d3a20e7686988ac0 (and 0.5% fee goes here ?)
Only the 1976a914f4cbe6c6bb3a8535c963169c22963d3a20e7686988ac part is the scriptPubKey. This output is for the fee. The last 0 is part of the next thing.

00000000000000
This (with the previous trailing 0) is the value of the last output, which is 0 satoshis (yes that is allowed). You are also missing a 0 which you have included as part of the next thing, but that is actually part of this one.

0266a24aa21a9ed99acb686178a3404d59c5f4521ccebf9cb523a337b0c05abc8d3ec375e39af7f 00000000 (this is witness provided in getbloctemplate with lock)
Excluding the first 0 and the last 4 zero bytes, this is the scriptPubKey of the last output. It is an OP_RETURN output that commits the witness hashes of the block.

The last 4 bytes are the lock time.


You are awesome. Thanks for taking time and explain each parts.

Coinbase1
----------------
Header               |   01000000010000000000000000000000000000000000000000000000000000000000000000fffff fff
Length               |   35 (<= this is 53 decimal length counts till signature part Huh )
Height               |   0371bb07
Flag Length            |   00
Time with length         |   049dbc6f5a
Random with length         |   046fb28d21
Nonce Length            |   0c

Extra Nonce part
----------------
Nonce1               |   00000000
Nonce2               |   0000000000000000

Coinbase 2
----------------
Unicode Text            |   0a
Extra data               |   636b706f6f6c
Signature Length         |   11
Signature               |   2f736f6c6f2e636b706f6f6c2e6f72672f
                  |   ffffffff (<= is this separator between tx in and tx out ?)
Number of transactions      |   03
1251320631 satoshies      |   37a3954a00000000
Pub script key for reward           |   17a9144ab4b2aa35879fe47e6a16ea783494f9dcf615b787
12639602 satoshies         |   72ddc00000000000
Pub script key for fee              |   1976a914f4cbe6c6bb3a8535c963169c22963d3a20e7686988ac
0 reward               |   0000000000000000
Witness commitment         |   266a24aa21a9ed99acb686178a3404d59c5f4521ccebf9cb523a337b0c05abc8d3ec375e39af7f
end                       |   00000000
8  Bitcoin / Development & Technical Discussion / Re: Important Lighting Network reading- for everyone! on: February 03, 2018, 05:09:06 AM
1. So Lightning Networks are like few dedicated nodes with fast network?
2. Node still has to rely on those Lightning Network participants ?
3. Isn't the idea behind node connecting to nearby peer is similar ?
4. Or its more about the contract protocol than the network making it faster ?

Sounds to me just marketing gimmicks. If really want to make it faster and better reduce the avg block mining time, reduce difficulty so that more gets leverage of mining blocks faster rather than giving it to handful giant mining setups and importantly help reduce electricity and save nature.  Kiss

Edit -
To add to this, with respect to communication better change will be Voting for best nodes by their uptime/network latency, higher voted nodes gets rewards and are discoverable by some means like torrent peers. This does not require bringing whole new terminology to entire bitcoin networking paradigm.
9  Bitcoin / Development & Technical Discussion / Generate coinbase from to send to miner (ckpool source code question) on: February 03, 2018, 04:04:19 AM
I'm trying to understand how coinbase is generated in ckpool and some part of it I'm not able to figure out

1. In second part of coinbase ckpool has extradata ckpool and signature /solo.ckpool.org/
hex : 0a 636b706f6f6c (this converts to ckpool) 11 2f736f6c6f2e636b706f6f6c2e6f72672f (this converts to /solo.ckpool.org/)

Q: ckpool is 6 bytes, why its length is set to 0a ?

2. If I want to generate all reward into single wallet address (cScriptPubKey), below pseudo code serialized as per protocol for coinbase 2 is correct ?
I think its should be either 0xffffffff or cCoinbaseValue (coinbasevalue is serialized value returned in getblocktemplate response)

var txOut = cExtraData + cSignature + "ffffffff" + cCoinbaseValue + cScriptPubKey + 0.ToString("x8") + cCommitment + cLockout;

3. Below is captured coinbase2 value recieved from solo.ckpool. Can anybody explain parts of it. For some reason I'm not able to understand how 00000000 are in 3 locations

0a636b706f6f6c112f736f6c6f2e636b706f6f6c2e6f72672fffffffff0337a3954a0000000017a 9144ab4b2aa35879fe47e6a16ea783494f9dcf615b78772ddc000000000001976a914f4cbe6c6bb 3a8535c963169c22963d3a20e7686988ac0000000000000000266a24aa21a9ed99acb686178a340 4d59c5f4521ccebf9cb523a337b0c05abc8d3ec375e39af7f00000000

0a636b706f6f6c112f736f6c6f2e636b706f6f6c2e6f72672fffffffff (this part I understand provided with one question above)
0337a3954a (<= what value is this?)
00000000 (<= if above part is reward value, what is this ?)
17a9144ab4b2aa35879fe47e6a16ea783494f9dcf615b78772ddc0 (I assume this is where the reward goes)
0000000000
1976a914f4cbe6c6bb3a8535c963169c22963d3a20e7686988ac0 (and 0.5% fee goes here ?)
00000000000000
0266a24aa21a9ed99acb686178a3404d59c5f4521ccebf9cb523a337b0c05abc8d3ec375e39af7f 00000000 (this is witness provided in getbloctemplate with lock)


10  Bitcoin / Hardware / Re: GekkoScience 2Pac BM1384 Stickminer Official Support Thread on: January 26, 2018, 01:10:42 AM
@VH.. what was the libusb version when you compiled on windows ?
Seems there are breaking changes in libusb latest version.. can not initialize usb device
11  Bitcoin / Development & Technical Discussion / Re: Raw original work request of solved block on: January 15, 2018, 04:28:34 AM
This helped me when I played around with the stratum protocol a few years ago, might help you a bit (see "Building Local Work"): http://archive.is/CH9a0

Seems its not example of actually solvable block. Result hash is not less than target. Or I got the markel wrong ?

http://learnmeabitcoin.com/tools/hashblockheader/?version=2&hashPrevBlock=000000001e920b44c0c6771b61e57a48787fe66d2aae448f19e2f65af8b6164d&hashMerkleRoot=4f699989fde3ff7ad9824846f4fb4c72c35fa8a716cef88fdda926ccf7cc8a6e&time=2012-09-11+00%3A33%3A49&bits=1c2ac4af&nonce=2996141058&submit=true
12  Bitcoin / Development & Technical Discussion / Re: Raw original work request of solved block on: January 14, 2018, 03:39:02 AM
This helped me when I played around with the stratum protocol a few years ago, might help you a bit (see "Building Local Work"): http://archive.is/CH9a0

Thanks that's what I wanted.
13  Bitcoin / Pools / Re: [∞ YH] solo.ckpool.org 1% fee solo mining USA/DE 246 blocks solved! on: January 13, 2018, 05:40:33 AM
2. Does cgminer takes that into consideration when pointed to solo.ckpool ?
...
5. Maximum nonce on 32 bit is 4294967295. That's ~4.2 Gh/s. When you have more hashing rate than this does what mining software (cgminer in particular) does in meantime its waiting for next work ?

2. Accepted shares can be a lower difficulty than the network diff, and just show you (and the mining software) that it's working

5. You can change the time, or the extra nonce. You can also get fancy with adjusting the merkle root. Mining space is practically unlimited.

Only parameters being submitted to node/server is time, nonce and extranonce2.
I dont' think modifying merkel root is allowed. If mining software modifies merkel root, how server going to validate it against the parameters I'm submitting ?
14  Bitcoin / Development & Technical Discussion / Re: Raw original work request of solved block on: January 13, 2018, 05:18:50 AM
Ok so if I'm getting what you are saying is, once the block is solved below markel_root becomes a transaction id to send newly generated coins which is already included in blocexplorer's transactions

merkle_root = sha256(sha256(unhexlify(coinbase)).digest()).digest()
No, not at all.

The coinbase transaction's txid is included as part of the merkle root. The construction of the merkle root is described here: https://github.com/bitcoin/bitcoin/blob/master/src/consensus/merkle.cpp#L9. Basically you concatenate the txids of pairs of transactions and hash them, then concatenate pairs of hashes, and so on until there is only one hash remaining.

The fields Coinbase1, ExtraNonce, ExtraNonce2, and Coinbase2 are used to construct the coinbase transaction which pays the miner. The transaction id of that coinbase transaction is then used to construct the merkle root.

Correct you are referring to process of calculating markel, actually I need all those parameters to test my application is actually calculating same markel and all the required inputs further to find same nonce as blockexplorer. That's just for end to end testing of my own mining application.
15  Bitcoin / Development & Technical Discussion / Re: Raw original work request of solved block on: January 13, 2018, 04:39:05 AM
Not just transaction ids, all of the parameters below
Coinbase1
ExtraNonce
ExtraNonce2
Coinbase2
Transaction Ids[]
Those parameters are part of the transaction ids. All of those parameters except for transaction Ids[] are for constructing the coinbase transaction. It's txid is then used in the merkle root.

But to form a block header, I need markel which is calculated using coinbase + transaction ids. Right ? I'm referring to the logic from the reference link and other miner source code I referred, which happen to be doing same thing.

Edit 1:
Ok so if I'm getting what you are saying is, once the block is solved below markel_root becomes a transaction id to send newly generated coins which is already included in blocexplorer's transactions

merkle_root = sha256(sha256(unhexlify(coinbase)).digest()).digest()

Edit 2:
I just tested markel calculation just using transaction id from random solved block and its not matching with that blocks markel.
Am I missing something, to reverse engineer the solved block ?


16  Bitcoin / Development & Technical Discussion / Re: Raw original work request of solved block on: January 13, 2018, 12:24:31 AM
The merkle root is computed from the transaction ids.

Not just transaction ids, all of the parameters below
Coinbase1
ExtraNonce
ExtraNonce2
Coinbase2
Transaction Ids[]


ref:
https://github.com/m0mchil/poclbm/blob/2ae15b77df1d17d2ec2748673ba2e8e0a01891c5/StratumSource.py

Code:
j.extranonce2 = self.increment_nonce(j.extranonce2)
coinbase = j.coinbase1 + self.extranonce + j.extranonce2 + j.coinbase2
merkle_root = sha256(sha256(unhexlify(coinbase)).digest()).digest()

for hash_ in j.merkle_branch:
merkle_root = sha256(sha256(merkle_root + unhexlify(hash_)).digest()).digest()
merkle_root_reversed = ''
for word in chunks(merkle_root, 4):
merkle_root_reversed += word[::-1]
merkle_root = hexlify(merkle_root_reversed)
17  Bitcoin / Pools / Re: [∞ YH] solo.ckpool.org 1% fee solo mining USA/DE 246 blocks solved! on: January 13, 2018, 12:15:11 AM
Posting questions here as suggested by ck on other thread...

1. In solo mining my understanding is finding shares on pool difficulty is meaningless, share has to be solved to be less or equal than the network difficulty. Is that right ?
2. Does cgminer takes that into consideration when pointed to solo.ckpool ?
3. If that's the case I should not have so many accepted shares. My miner should only submit share when fond a block.

Below response from CK seems answers above questions
Quote
The answer is shares aren't worth anything but they don't consume much bandwidth and are used for feedback to the miner only to know they're mining successfully.

Still would like to know answers for below questions:

4. I see cgminer adjusts miners difficulty by its hashrate, how can I disable it and make it to find block by bitcoin's network difficulty ?
5. Maximum nonce on 32 bit is 4294967295. That's ~4.2 Gh/s. When you have more hashing rate than this does what mining software (cgminer in particular) does in meantime its waiting for next work ?
18  Bitcoin / Development & Technical Discussion / Raw original work request of solved block on: January 12, 2018, 07:53:13 PM
Does anybody has the actual raw work request of solved block ? I'm just creating mining application and need to very it actually working after that all endiness conversion mombo jumbo. The only missing part from blockchain explorer is params used to create markel root. Appreciate if anybody has it handy or pull from their log or something.

Just to add more below params I'm after of any solved block to test

Coinbase1
ExtraNonce
ExtraNonce2
Coinbase2
Transaction Ids[]
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!