Bitcoin Forum
September 24, 2025, 01:44:02 AM *
News: Latest Bitcoin Core release: 29.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Alternate cryptocurrencies / Bounties (Altcoins) / Re: [BOUNTY] Poolz DeFi - 25000 POZ Reward Pool (only 6 weeks) on: October 26, 2020, 08:59:04 PM
#PROOF OF REGISTRATION
Forum Username: rossihwang
Forum Profile Link: https://bitcointalk.org/index.php?action=profile;u=318553
Telegram Username: @Konyukis
Participated Campaigns: Telegram Ambassador
ETH Wallet Address: 0xf4E85Ec0B80b55E91B4c75A67e56116AEa7866c2
2  Bitcoin / Mining software (miners) / Re: set_difficulty in stratum on: May 21, 2014, 09:46:17 AM
thx a lot!

now i handle the target like this:

In the getwork
i get target part from json package, and reverse it with byte
for example, i get
0x0000000000000000000000000000000000000000000000000000ffff00000000
then i transform it into
0x00000000ffff0000000000000000000000000000000000000000000000000000

In the stratum
the BASE_DIFFICULTY is 0x00000000ffff0000000000000000000000000000000000000000000000000000
when i get a "set_difficulty" param is 256
and my target should be
int(BASE_DIFFICULTY / 256)
3  Bitcoin / Mining software (miners) / Re: how should i check the mining.notify in the software? on: May 14, 2014, 09:28:32 AM
up!!!
4  Bitcoin / Mining software (miners) / Re: set_difficulty in stratum on: May 09, 2014, 06:36:27 AM
this link define the bits

https://en.bitcoin.it/wiki/Difficulty

at How is difficulty stored in blocks?

but i cant tell the different between bits and difficulty we  discuss above
5  Bitcoin / Mining software (miners) / how should i check the mining.notify in the software? on: May 08, 2014, 06:50:06 AM
firstly, i try to check the mining.notify during every few seconds(30s), at the beginning, i can successfully get the json message, but after few times(maybe 2-4), i can only receive a empty message.

then i try to submit a message(a wrong one) before every time i check the notify, i found it goes well

question 1
is this the correct method to handler mining.notify? Huh Huh

question 2
in my opinion, the former situation, when i receive the empty message the server has disconnected with my miner. in other hand, the miner need to keep itself online with submit, is it right?  Huh Huh

thanks  Grin Grin
6  Bitcoin / Mining software (miners) / Re: set_difficulty in stratum on: May 08, 2014, 04:07:38 AM
so, the nBits in getwork and stratum is for what?
7  Bitcoin / Mining software (miners) / Re: set_difficulty in stratum on: May 07, 2014, 07:19:24 AM
are you sure that is shift right by difficulty?

in your example

maxHash = 0x00000000ffff0000000000000000000000000000000000000000000000000000 >> difficulty;

if i get a difficulty = 256 from set_difficulty, the maxHash is equal to 0!!! and sometimes the difficulty is more than 300!

in some code, i saw this

server_difficulty = BASE_DIFFICULTY / difficulty
where BASE_DIFFICULTY = 0x00000000ffff0000000000000000000000000000000000000000000000000000
8  Bitcoin / Mining software (miners) / Re: set_difficulty in stratum on: May 07, 2014, 06:24:32 AM
oh! i see, i needn't to calculate the target, only use base_difficulty and the difficulty from the set_difficulty, i can get the the max hash to compare with the hash  calculated by miner.

but, in the getwork protocol there is no set_difficulty, where i can get the max hash or target?

thx, again!
9  Bitcoin / Mining software (miners) / set_difficulty in stratum on: May 06, 2014, 09:01:31 AM
i wonder that what's the relationship between the params in set_difficulty and the target used for comparing with the nonce? or the target just comes from the Bits?

thx
10  Bitcoin / Mining software (miners) / Re: a question about the stratum on: May 06, 2014, 01:29:56 AM
get it!thank u very much!
11  Bitcoin / Mining software (miners) / Re: a question about the stratum on: May 05, 2014, 02:01:58 AM

many thanks again!

so as you posted above, i can get a work from stratum server. and disconnect the network. then the miner software increase extranonce2 (randomly?!) to build different header. for each header, in the worest condition, I should guess the nonce for 2^32 -1 times. until I find a nonce whose result hash can meet the target. I reconnect to the stratum server, and submit the extranonce2, nonce and ...in the predefined format. is it correct?
12  Bitcoin / Mining software (miners) / Re: a question about the stratum on: May 04, 2014, 08:25:02 AM
As far as I've seen, the extranonce2 info is always 4 bytes....

here's a snippet from ScalaMiner (https://github.com/colinrgodsey/scalaminer) for generating the header from stratum info (extraNonceInt is a randomly generated 32b int):

Code:
def getWork(hashType: ScalaMiner.HashType, extraNonceInt: Int, job: MiningJob,
extraNonceInfo: ExtraNonce, targetBytes: Seq[Byte], needsMidstate: Boolean) = {
val bytes = intToBytes(extraNonceInt)
val enBytes = Seq.fill[Byte](extraNonceInfo.extranonce2Size -
bytes.length)(0) ++ bytes

val extraNonce = extraNonceInfo.extranonce1 ++ enBytes

val sha256 = new ScalaSha256

val coinbase = ScalaMiner.BufferType.empty ++
job.coinbase1 ++ extraNonce ++ job.coinbase2

val coinbaseHash = doubleHash(coinbase, sha256)

val merkleRoot = reverseEndian(job.merkleBranches.foldLeft(coinbaseHash) { (a, b) =>
doubleHash(a ++ b, sha256)
})

val ntime = (System.currentTimeMillis / 1000) + job.dTime

val serializedHeader = ScalaMiner.BufferType.empty ++
job.protoVersion ++ job.previousHash ++ merkleRoot ++
intToBytes(ntime.toInt) ++ job.nBits ++ intToBytes(0) ++ //enBytes ++
workBasePad

//require(serializedHeader.length == 128, "bad length " + serializedHeader.length)

//TODO: this is the 'old' target?
val target = ScalaMiner.BufferType.empty ++ (if(targetBytes.isEmpty)
"ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000".fromHex.toSeq
else targetBytes)

val midstate = if(needsMidstate) calculateMidstate(serializedHeader.take(64))
else Nil

Stratum.Job(Work(hashType, serializedHeader, midstate, target),
job.id, merkleRoot, enBytes)
}


to colinrgodsey
    first of all, thank u for replying me
    and my new confusion comes:
    1) the extraNonceInt in your post is the so-called extranonce2?
    2) how can it randomly generated?
    3) where does it come from?
13  Bitcoin / Mining software (miners) / Re: a question about the stratum on: May 04, 2014, 01:24:16 AM
anyone helpsssss!
14  Bitcoin / Mining software (miners) / a question about the stratum on: April 30, 2014, 01:37:17 AM
with extranonce2 coinb1 coinb2 extranonce1, i can get the coinbase. and then the coinbase operate with merkle branch somehow, i can get the merkle root. and then combine the version hash1...etc together, i can get the block header. so for example the extranonce2_size is 4 so the extranonce2 is from 0 to 2^32 - 1. is it means that when i get a notify from server, i can generate 2^32 block header from it? is my understanding all right? thx guys!
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!