Bitcoin Forum
April 30, 2024, 05:08:37 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Finding nonce in historical transactions / blocks  (Read 242 times)
release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
February 14, 2021, 03:07:02 AM
Merited by hugeblack (2), vapourminer (1)
 #1

Hi guys just wandering if their is a script/tool/method for finding nonce value of old transactions and/or blocks? Obviously the nonce has been found for every mined block but just wondering if their is a way to find this information out?

Thanks
1714496917
Hero Member
*
Offline Offline

Posts: 1714496917

View Profile Personal Message (Offline)

Ignore
1714496917
Reply with quote  #2

1714496917
Report to moderator
1714496917
Hero Member
*
Offline Offline

Posts: 1714496917

View Profile Personal Message (Offline)

Ignore
1714496917
Reply with quote  #2

1714496917
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714496917
Hero Member
*
Offline Offline

Posts: 1714496917

View Profile Personal Message (Offline)

Ignore
1714496917
Reply with quote  #2

1714496917
Report to moderator
1714496917
Hero Member
*
Offline Offline

Posts: 1714496917

View Profile Personal Message (Offline)

Ignore
1714496917
Reply with quote  #2

1714496917
Report to moderator
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
February 14, 2021, 03:18:55 AM
 #2

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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
February 14, 2021, 03:47:56 AM
 #3

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
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6715


bitcoincleanup.com / bitmixlist.org


View Profile WWW
February 14, 2021, 06:47:54 AM
Merited by vapourminer (1)
 #4

I'm not sure where to find the extra nonce though, they're located in the Coinbase transaction.

It turns out that the extraNonce is not included in the block or block header formats. This is a reply from theymos:

...
extraNonce is used by bitcoind, but it's not part of the protocol. There is no extraNonce field in blocks or transactions.



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

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
February 14, 2021, 06:53:37 AM
 #5

I'm not sure where to find the extra nonce though, they're located in the Coinbase transaction.

It turns out that the extraNonce is not included in the block or block header formats. This is a reply from theymos:

...
extraNonce is used by bitcoind, but it's not part of the protocol. There is no extraNonce field in blocks or transactions.



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

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.

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
LoyceV
Legendary
*
Offline Offline

Activity: 3290
Merit: 16577


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
February 14, 2021, 08:40:02 AM
Merited by vapourminer (1)
 #6

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.

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
I'm kinda clueless here, but if it's private, it's not on the blockchain, right?

release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
February 14, 2021, 08:45:46 AM
 #7

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.

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
I'm kinda clueless here, but if it's private, it's not on the blockchain, right?

Brute forced as in mining is only way I am familiar with
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
February 14, 2021, 09:00:45 AM
 #8

It turns out that the extraNonce is not included in the block or block header formats. This is a reply from theymos:
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.
I'm kinda clueless here, but if it's private, it's not on the blockchain, right?
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.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6715


bitcoincleanup.com / bitmixlist.org


View Profile WWW
February 14, 2021, 12:00:08 PM
Merited by vapourminer (1), ABCbits (1)
 #9

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
I'm kinda clueless here, but if it's private, it's not on the blockchain, right?

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

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
February 14, 2021, 01:14:21 PM
 #10

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
I'm kinda clueless here, but if it's private, it's not on the blockchain, right?

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


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
release (OP)
Member
**
Offline Offline

Activity: 184
Merit: 14


View Profile
February 14, 2021, 01:24:04 PM
 #11

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
I'm kinda clueless here, but if it's private, it's not on the blockchain, right?

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


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)
Bglhn
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
March 19, 2024, 11:43:15 PM
 #12

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?

Code:
def h(n):
    return hex(n).replace("0x","")

def extended_gcd(aa, bb):
    lastremainder, remainder = abs(aa), abs(bb)
    x, lastx, y, lasty = 0, 1, 1, 0
    while remainder:
        lastremainder, (quotient, remainder) = remainder, divmod(lastremainder, remainder)
        x, lastx = lastx - quotient*x, x
        y, lasty = lasty - quotient*y, y
    return lastremainder, lastx * (-1 if aa < 0 else 1), lasty * (-1 if bb < 0 else 1)

def modinv(a, m):
    g, x, y = extended_gcd(a, m)
    if g != 1:
        raise ValueError
    return x % m
   
N = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141



R1 = 0x49bf1b1c8364c4179bd82a3be28b1a326c2c1b2d120c3264865ecbc4dbaed4b3
S1 = 0x4ad0d60d72880bf0a51d88d0d5138ffa3593273bd0b3d48a5afe04023db9c2c9
Z1 = 0x1362d682d8872a0451e5f0d86f743a62bf0730b57ddddc901668d837cbfa2f48
R2 = 0x00ad7991e3b3d36f6f17a22fad1faddc53e7c124e5b6626db172c79299fce5cfb6
S2 = 0x10ecd8352675027f74edc18180ac083d75a1488497c6c3078a5966015514ac46
Z2 = 0xfec02a5d53eb20a6e470b7c321e0da83ea6d677f600f67033abf4b0e6b8745aa
m = 1

print (h(((S2*m*R1 + Z1*R2 - Z2*R1) * (S1*R2 - S2*R1)^(-1)) % N))
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!