How to find nonce values in old blocks or transactions?

11 replies 304 views
fullnodeSenior Member
Posts: 188 · Reputation: 1205
#1Jan 28, 2021, 03:04 PM
Hey everyone, does anyone know if there's a tool or script to find the nonce values of old blocks or transactions? I mean, we know the nonce for mined blocks, but can we get that info for historical data?
8 Reply Quote Share
cobra51Newbie
Posts: 52 · Reputation: 31
#2Jan 28, 2021, 07:08 PM
Check this out. LoyceV put together a list of nonces from the blocks right here: https://loyce.club/blockdata/nonce.txt. But I’m not sure about finding the extra nonce, that one's in the Coinbase transaction.
3 Reply Quote Share
fullnodeSenior Member
Posts: 188 · Reputation: 1205
#3Jan 28, 2021, 08:27 PM
Thanks for the link! There’s always someone here with the right info. So this is historical block data, right? Any chance we can find the nonce for individual transactions?
2 Reply Quote Share
0xNodeMember
Posts: 307 · Reputation: 80
#4Jan 28, 2021, 10:14 PM
So, the extraNonce isn't part of the block or header format. Theymos mentioned there's no nonce for single transactions because it’s only for block generation. Adding that to transactions would just bloat them.
2 Reply Quote Share
fullnodeSenior Member
Posts: 188 · Reputation: 1205
#5Jan 30, 2021, 12:37 AM
The transaction nonce is actually used to make the signature for the transaction. It's secret since it involves the private key to sign things.
3 Reply Quote Share
orbit1337Senior Member
Posts: 161 · Reputation: 941
#6Jan 30, 2021, 05:49 PM
Is any of the info you need in these 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 If it’s here, I can help you grab it. But if it’s private, it won’t be on the blockchain, right?
1 Reply Quote Share
fullnodeSenior Member
Posts: 188 · Reputation: 1205
#7Jan 30, 2021, 09:14 PM
Brute forcing it like mining is all I know to do.
4 Reply Quote Share
cobra51Newbie
Posts: 52 · Reputation: 31
#8Jan 31, 2021, 02:31 AM
Yep, it's in the Coinbase transaction. It can get tricky since it's not a standard protocol. Any change in transactions will mess up the merkle root, but using an extranonce could simplify it. Those r and s values are found in the signature. Good luck parsing that, not sure what you'll get since they should be random.
4 Reply Quote Share
0xNodeMember
Posts: 307 · Reputation: 80
#9Jan 31, 2021, 07:26 AM
Got it. You're referring to the ECDSA signature algorithm where k, or the transaction nonce, is picked to create r and s. It’s not in the raw transaction, but I mentioned earlier that I found a way to extract nonce k from the private key, the message data, and other values here: https://this forum.org/index.php?topic=5316741.msg56331333#msg56331333.
3 Reply Quote Share
fullnodeSenior Member
Posts: 188 · Reputation: 1205
#10Jan 31, 2021, 10:41 AM
Right, exactly! I’m just struggling to find more data on it myself. Block nonces are typically 10 decimal digits or 8 hex 32-bit. I wonder what format the secret K is in. Is it also a 32-bit string?
3 Reply Quote Share
fullnodeSenior Member
Posts: 188 · Reputation: 1205
#11Jan 31, 2021, 04:47 PM
Interesting thread, appreciate it. But why bother finding K if you already have P? Knowing K would give away P. Check this out: S1 = (h1+rx1*P)/k => k = (h1+rx1*P)/S1 S2 = (h2+rx2*P)/(k+1) => k+1 = (h2+rx2*P)/S2 There’s a whole calculation here...
2 Reply Quote Share
greg_moonMember
Posts: 2 · Reputation: 167
#12Jan 31, 2021, 10:46 PM
Hey friends, I got inspired by the table from Iceland's rsz and made some Python code for cases with k, k+1, k+m. I don't know any private key examples to test, so I need you guys to check it out. If it works, I’ll share it on GitHub. Seems like there’s no resource like this yet, so it could help everyone!
6 Reply Quote Share

Related topics