How to locate nonce in past blocks or transactions

11 replies 450 views
titanoneFull Member
Posts: 25 · Reputation: 722
#1Dec 19, 2023, 05:33 PM
Hey everyone, I'm curious if there's a script, tool, or method available to find the nonce value from older transactions or blocks. I know the nonce is already determined for all mined blocks, but I’m just wondering if there’s any way to dig this info up?
5 Reply Quote Share
nodeio223Full Member
Posts: 163 · Reputation: 694
#2Dec 19, 2023, 08:42 PM
LoyceV very nicely compiled all of the nonces used in the blocks here: https://loyce.club/blockdata/nonce.txt. I'm not sure where to find the extra nonce though, they're located in the Coinbase transaction.
4 Reply Quote Share
titanoneFull Member
Posts: 25 · Reputation: 722
#3Dec 20, 2023, 12:30 AM
Thanks for that. Their is always some ninja here with knowledge needed. This is obviously historical block data? Any idea how to find individual transaction nonce? Thanks
5 Reply Quote Share
Posts: 749 · Reputation: 103
#4Dec 20, 2023, 04:58 AM
It turns out that the extraNonce is not included in the block or block header formats. This is a reply from theymos: There is no nonce for individual transactions, because it only applies to block generation. Individual transactions have no use knowing the nonce, since that would just waste more bytes making the tx larger. It's a 32-bit counter located in the last 4 bytes of the block header.
4 Reply Quote Share
titanoneFull Member
Posts: 25 · Reputation: 722
#5Dec 20, 2023, 08:54 AM
The transaction nonce is what is used to create the signature of the transaction or the r,s. It's private as it involves the private key to sign transactions
2 Reply Quote Share
Posts: 886 · Reputation: 114
#6Dec 20, 2023, 11:54 AM
Is the data you're looking for included in any of those files? http://blockdata.loyce.club/inputs/blockchair_bitcoin_inputs_20110615.tsv.gz http://blockdata.loyce.club/outputs/blockchair_bitcoin_outputs_20110615.tsv.gz http://blockdata.loyce.club/transactions/blockchair_bitcoin_transactions_20110615.tsv.gz (Reference thread: Bitcoin block data: inputs, outputs and transactions) If it's in here, I can get you the data. I'm kinda clueless here, but if it's private, it's not on the blockchain, right?
4 Reply Quote Share
titanoneFull Member
Posts: 25 · Reputation: 722
#7Dec 20, 2023, 04:01 PM
Brute forced as in mining is only way I am familiar with
4 Reply Quote Share
nodeio223Full Member
Posts: 163 · Reputation: 694
#8Dec 21, 2023, 10:01 AM
Correct. It's in the Coinbase transaction and since it's not a protocol standard, it can be a bit ambiguous, any changes in the transactions will alter the merkle root though I think using an extranonce makes it simpler. The r and s values are 32 bytes each and located in the signature. If you want to parse it but I imagine that will take sometime, not sure what this can yield though. They're meant to be completely random under normal circumstances.
1 Reply Quote Share
Posts: 749 · Reputation: 103
#9Dec 21, 2023, 02:38 PM
Ah, I seem to get it now. He's talking about in the ECDSA signature algorithm where a secret number k, the so-called transaction nonce (though this is the first time I heard it being called a nonce to be honest) is chosen that is used to create r and s. Obviously that's not available in the raw transaction as he pointed out, but in another thread here I made a process for getting the nonce k from the private key, the message data - in this case the raw transaction with a few fields unfilled - , r and s: https://bitcointalk.org/index.php?topic=5316741.msg56331333#msg56331333
0 Reply Quote Share
titanoneFull Member
Posts: 25 · Reputation: 722
#10Dec 21, 2023, 08:50 PM
Yes you got it my friend sorry. I can't find much data on it. Block nonce is usually 10 decimal characters 8 hex 32 bit. Was wandering what format the secret K value is if it is also a 32 bit string
3 Reply Quote Share
titanoneFull Member
Posts: 25 · Reputation: 722
#11Dec 22, 2023, 12:08 AM
Interesting thread thank you. Although I don't see the point  in finding K if you have P? Finding K leads you to P. I find this interesting: S1 = (h1+rx1*P)/k   =>  k = (h1+rx1*P)/S1 S2 = (h2+rx2*P)/(k+1)  =>  k+1 = (h2+rx2*P)/S2 ((h1+rx1*P)/S1)  + 1 = (h2+rx2*P)/S2 ......... P = (h2*S1 - h1*S2 - S2)/(rx1*S2 - rx2*S1)
1 Reply Quote Share
Posts: 132 · Reputation: 11
#12Dec 22, 2023, 05:07 AM
Hello friends. Inspired by the table on iceland's rsz, I created code in phyton for the cases where k,k+1...k+m. Since there is no such example whose private key I know, I ask you to check it. If it works, I will publish it on github. As far as I can see, there is no such resource, we can all benefit from it. Can anyone who sees it please check it out and give their opinions?
3 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics