Bitcoin Forum
October 20, 2020, 05:25:49 PM *
News: Latest Bitcoin Core release: 0.20.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin math question  (Read 202 times)
imjustagirl
Jr. Member
*
Offline Offline

Activity: 117
Merit: 6


View Profile
December 19, 2019, 03:49:37 PM
 #1

Bitcoin transaction formula question.
If k is the nonce, it goes through the same pattern to become the R value as the private key does to become the public key, right? k * Gx = R
So if I take a k value and input it into for example bitaddress.org (or any other software for that matter) like it was the private key, the first part of the public key is supposed to match the R value of my transaction? (minus the 04 at the beginning)
But I don't get this value. Am I missing something?

1JPnqMd1Q43L3KbZ7SoTSdRCD2aLj2sikF Tip Me!
1603214749
Hero Member
*
Offline Offline

Posts: 1603214749

View Profile Personal Message (Offline)

Ignore
1603214749
Reply with quote  #2

1603214749
Report to moderator
1603214749
Hero Member
*
Offline Offline

Posts: 1603214749

View Profile Personal Message (Offline)

Ignore
1603214749
Reply with quote  #2

1603214749
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 2282
Merit: 3512


Just writing some code


View Profile WWW
December 19, 2019, 04:10:39 PM
Merited by fillippone (2), gmaxwell (1), hugeblack (1)
 #2

Yes, you should get the same thing.

gmaxwell
Moderator
Legendary
*
qt
Online Online

Activity: 3206
Merit: 4389



View Profile
December 19, 2019, 09:06:55 PM
Merited by Foxpup (2), fillippone (2), ETFbitcoin (1), hugeblack (1)
 #3

(or any other software for that matter) like it was the private key,

A bunch of these sites are "brain wallet tools" (for brain wallet fools) and they hash the data being input into them. E.g. they compute  sha256(input)*G rather than input*G.  If it accepts anything other than a number then it's almost certainly hashing it.
imjustagirl
Jr. Member
*
Offline Offline

Activity: 117
Merit: 6


View Profile
December 20, 2019, 11:37:28 AM
Last edit: December 20, 2019, 12:22:11 PM by imjustagirl
 #4

Here is what I mean.
The famous tx here with repeated r values:9ec4bc49e828d924af1d1029cacf709431abbde46d59554b62bc270e3b29c4b1  
p = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
K = GF(p)
r1 = 0xd47ce4c025c35ec440bc81d99834a624875161a26bf56ef7fdc0f5d52f843ad1
r2 = 0xd47ce4c025c35ec440bc81d99834a624875161a26bf56ef7fdc0f5d52f843ad1
s1 = 0x44e1ff2dfd8102cf7a47c21d5c9fd5701610d04953c6836596b4fe9dd2f53e3e
s2 = 0x9a5f1c75e461d7ceb1cf3cab9013eb2dc85b6d0da8c3c6e27e3a5a5b3faa5bab
z1 = 0xc0e2d0a89a348de88fda08211c70d1d7e52ccef2eb9459911bf977d587784c6e
z2 = 0x17b0f41c8c337ac1e18c98759e83a8cccbc368dd9d89e5f03cb633c265fd0ddc
PK = 0xC477F9F65C22CCE20657FAA5B2D1D8122336F851A508A1ED04E479C34985BF96  (the private key correctly resolves to 1BFhrfTTZP3Nw4BNy4eX4KFLsn9ZeijcMm)
Ok, so we figure out the nonce now, we have all other data.

K((PK*r1)+z1)/s1 gives N=0x1EE0FAC1872E11EB3E02F24D7623203BBA6DB0E13DEF6DD3E8EBFD1920286254

However K((z1-z2)/(s1 - s2)) gives the right N = 0x7A1A7E52797FC8CAAA435D2A4DACE39158504BF204FBE19F14DBB427FAEE50AE

Why is the first nonce formula not working right? If you have all the params of a transaction, shouldn't this formula work?
The second one resolves right K(((s1*N)-z1)/r1) by this formula, but not my first nonce formula, which uses only the first tx parameters, why?

More over, the following formulas all work for my own transactions:
K((PK*r1)+z1)/s1  gives the right N

K((r2*z1)+(r1*s2*c)-(r1*z2))/((s1*r2)-(s2*r1)) gives the right N

K(((s1*N)-z1)/r1) gives the right PK

But here it does not  Huh

1JPnqMd1Q43L3KbZ7SoTSdRCD2aLj2sikF Tip Me!
MixMAx123
Member
**
Offline Offline

Activity: 83
Merit: 89


View Profile
December 20, 2019, 07:28:44 PM
 #5


K((PK*r1)+z1)/s1 gives N=0x1EE0FAC1872E11EB3E02F24D7623203BBA6DB0E13DEF6DD3E8EBFD1920286254



My calculation gives this result:  N=7a1a7e52797fc8caaa435d2a4dace39158504bf204fbe19f14dbb427faee50ae


Use this ECC calculator to calculate it quickly!
https://github.com/MrMaxweII/Secp256k1-Calculator
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!