Finding K nonce more efficiently

16 replies 483 views
benseedFull Member
Posts: 60 · Reputation: 461
#1Feb 25, 2024, 05:33 AM
Hey all, I’ve been using this method from ecdsa123 to figure out the K nonce. After 6 weeks, I finally got the right k nonce (256 bits) using his approach. Just curious if there’s a quicker way to calculate k nonce. Can it be done with direct calculations based on the given values?
2 Reply Quote Share
omega_bearFull Member
Posts: 116 · Reputation: 780
#2Feb 25, 2024, 07:42 AM
Maybe this can help, this about nonce https://bitcointalk.org/index.php?topic=5491531.0
6 Reply Quote Share
omega_bearFull Member
Posts: 116 · Reputation: 780
#3Feb 25, 2024, 12:27 PM
6 weeks is very fast !!!  have you result from real srz from btc transaction  ?
1 Reply Quote Share
omega_bearFull Member
Posts: 116 · Reputation: 780
#4Feb 26, 2024, 12:49 AM
what i you have for 256 bit nonce ?
3 Reply Quote Share
omega_bearFull Member
Posts: 116 · Reputation: 780
#5Feb 26, 2024, 01:00 AM
expand code,add formulas for r,s,z and after ask openai, in my situations this help. openai find bast and fastest solution regards
0 Reply Quote Share
benseedFull Member
Posts: 60 · Reputation: 461
#6Feb 26, 2024, 03:39 AM
OH
1 Reply Quote Share
benseedFull Member
Posts: 60 · Reputation: 461
#7Feb 26, 2024, 09:53 AM
i did. it went i i did it went into some imaginary calculations that wasted my time, sometimes 2 days until i realize the calculations are not right.
2 Reply Quote Share
benseedFull Member
Posts: 60 · Reputation: 461
#8Feb 26, 2024, 01:22 PM
yes the result is from real rsz from a dormant wallet of 8 years.
3 Reply Quote Share
omega_bearFull Member
Posts: 116 · Reputation: 780
#9Feb 26, 2024, 06:45 PM
Bro, check your pm please )
1 Reply Quote Share
ninj42016Full Member
Posts: 45 · Reputation: 251
#10Feb 26, 2024, 11:06 PM
Running this on GPU will be mush faster,. Let me see if i can write a CUDA program for this.
4 Reply Quote Share
benseedFull Member
Posts: 60 · Reputation: 461
#11Feb 27, 2024, 02:00 AM
wow. Thank you. Please do. I still feel 6 weeks is too long though. I just got lucky.
5 Reply Quote Share
benseedFull Member
Posts: 60 · Reputation: 461
#12Feb 28, 2024, 07:22 AM
I currently ran the program on i9 processor and a Nvidia 3090 GPU.
1 Reply Quote Share
benseedFull Member
Posts: 60 · Reputation: 461
#13Feb 28, 2024, 09:33 AM
in case you need the full code i had use in sagemath.
4 Reply Quote Share
omega_bearFull Member
Posts: 116 · Reputation: 780
#14Feb 28, 2024, 11:06 AM
Thank you very mach for your code, mister
5 Reply Quote Share
cobra2013Senior Member
Posts: 308 · Reputation: 1912
#15Feb 28, 2024, 01:03 PM
@COBRAS @krashfire Please give me an example rsz if your code works correctly. sample rsz r=0x s=0x z=0x And, if 2 signatures match how long, it takes to K nonce edit i got error, public_key1 (37231416379298332252575862495769965965364321245932635159006725536777825338696 : 9676366176353189190669004767334277632269117223198125569199055354600699161111 : 1) pub1_x= 0x52503c225437e35c61b9ee5ec88ea71600e7a710dbebac88b27c2d1a667ac548 public_key2 (84773528361026042599480815013664408603889872484555722313313932231857335756436 : 21504221066078790871098131651817310599861599747961732812418866800256292472755 : 1) pub2_x= 0xbb6c1de01f36618ae05f7c183c22dfa8797e779f39537752c27e2dc045b0e694 signature matches signature matches --------------------------------------------------------------------------- AttributeError                            Traceback (most recent call last) Cell In [1], line 83      81 for i in range(Integer(1), n):      82     k = (r * i + z) * modinv(s, n) % n ---> 83     if check_k(k):      84         print(f"Found correct k: {k}")      85         private_key = (s * k - z) * modinv(r, n) % n Cell In [1], line 78, in check_k(k)      76 def check_k(k):      77     P = k * G ---> 78     return P.x() == r File /home/sc_serv/sage/src/sage/structure/element.pyx:489, in sage.structure.element.Element.__getattr__()     487         AttributeError: 'LeftZeroSemigroup_with_category.element_class' object has no attribute 'blah_blah'...     488     """ --> 489     return self.getattr_from_category(name)     490     491 cdef getattr_from_category(self, name) noexcept: File /home/sc_serv/sage/src/sage/structure/element.pyx:502, in sage.structure.element.Element.getattr_from_category()     500     else:     501         cls = P._abstract_element_class --> 502     return getattr_from_other_class(self, cls, name)     503     504 def __dir__(self): File /home/sc_serv/sage/src/sage/cpython/getattr.pyx:362, in sage.cpython.getattr.getattr_from_other_class()     360     dummy_error_message.cls = type(self)     361     dummy_error_message.name = name --> 362     raise AttributeError(dummy_error_message)     363 att
3 Reply Quote Share
omega_bearFull Member
Posts: 116 · Reputation: 780
#16Feb 28, 2024, 02:45 PM
@krashfire find in 6 week, and this is looks like lucky. you can find rsz in previous topics/messages of  @krashfire, for example
4 Reply Quote Share
ninj42016Full Member
Posts: 45 · Reputation: 251
#17Feb 28, 2024, 04:26 PM
Can you please explain the logic behind this? GPU can probably reduce it to few days. you can PM me if needed.
0 Reply Quote Share

Related topics