1 Answer
1

k and n are not values that you calculate. k is randomly generated while n is predefined by the curve parameters.

n is the order of the curve G. It is defined by the curve parameters for the secp256k1 curve which are defined here: http://www.secg.org/sec2-v2.pdf. In those parameters, n = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141.

k is a randomly generated integer that is used only once for a signature. It is known as the nonce and acts as a source of randomness. If the same k is used to sign two different messages with the same private key, the private key will be leaked.

I already told you what n is and it is not that. As I said in my answer, you do not calculate n or k. n is given to you by the parameters for secp256k1, and k is randomly generated. You cannot calculate them.
– Andrew Chow♦Sep 14 '18 at 13:41

@MasNdoloxz+ as shown in SEC2, the number you quote here is 'p', the modulus of the underlying finite field F_p. Like a,b,G,n it is fixed as part of the definition of the curve and you do not compute it. (All the parameters were actually computed once, decades ago, following the process in SEC1 as modified by the Koblitz constraint, but it's neither necessary nor practical for you to re-do that computation.)
– dave_thompson_085Sep 14 '18 at 14:33

@AndrewChow im sorry, im newbie for this, but im always continue to study this. i just want know step by step from zero. so i need teacher for this. sorry my bad english, im from indonesia. one again, the point is prime G = fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f , N = fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141 . i need teacher for this thanksyou
– Mas NdoloxzSep 18 '18 at 15:03

@AndrewChow i need teacher step by step for secp256k1 and recovering PrivateKey used value R S Z this sounds impossible, actually I already have a private key, only I want to test it. I am interested in bitcoin.stackexchange.com/questions/25814/… from this question must be two different messages with the same private key. what about 1 message, can i recover?
– Mas NdoloxzSep 18 '18 at 15:13