Bitcoin Forum
May 25, 2024, 09:21:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: witness_v0_scripthash type signature message(z value) calculate for Verify  (Read 108 times)
mamuu (OP)
Member
**
Offline Offline

Activity: 71
Merit: 19


View Profile
May 15, 2021, 09:31:56 PM
 #1

Hello everyone

I am directly asking my question, I am trying to find the z value of a signature with signature type witness_v0_scripthash.

In other words, I'm trying to calculate the K point.

I learned how to calculate z value in signatures with signature types pubkey and pubkeyhash. I could not do it with the same method. Is this method correct? Can you help me? Thank you.


Example TX

Type : witness_v0_scripthash
Transaction
01000000000101842556e841ccf129e2077b3c9f700d6a458273a281ee230a8a1aa87b4ff6786b0 100000000ffffffff02852e23000000000017a91467f0f8cf7877cabf2b735af6ca101b7384314d c38767bf81000000000016001418a65824d303be627b3e4072fcb389d3dce26a120248304502210 087c189f6b0bc8b8d8bc7ebc8192d9f750e9b4f8150e87a928ba0176fa7329c85022056a33740a3 e01e72dbfa6a3b79d2e9a2c4a0e17dadb9a71e5a639cea8e24e94c0121036edf4b70e69f477684e 1947b34a695b7e0340253456794e71950129c1408c7cc00000000

tx
fd4db43eda3e1ecd205df6469526ccc67005596fa32a4ec13e132aaee6a6ad7b   

signature
304502210087c189f6b0bc8b8d8bc7ebc8192d9f750e9b4f8150e87a928ba0176fa7329c85022056a33740a3e01e72dbfa6a3b79d2e9a2c4a0e17dadb9a71e5a639cea8e24e94c01,036edf4b70e69f477684e1947b34a695b7e0340253456794e71950129c1408c7cc

R
0087c189f6b0bc8b8d8bc7ebc8192d9f750e9b4f8150e87a928ba0176fa7329c85

S
56a33740a3e01e72dbfa6a3b79d2e9a2c4a0e17dadb9a71e5a639cea8e24e94c

Pubkey
036edf4b70e69f477684e1947b34a695b7e0340253456794e71950129c1408c7cc

1DWA3Sa8i6eHVWV4AG4UP2SBhYB2XrfiHW
pooya87
Legendary
*
Offline Offline

Activity: 3458
Merit: 10588



View Profile
May 16, 2021, 02:48:15 AM
 #2

You should read BIP-143, all the information you seek is explained there.

In other words, I'm trying to calculate the K point.
If by "K" you mean the corresponding point of the ephemeral key used in signing referred to "k" in some standards, then you can't do that. The whole security of ECDSA relies on the fact that this is impossible to compute.

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

Activity: 71
Merit: 19


View Profile
May 16, 2021, 09:11:03 AM
 #3

You should read BIP-143, all the information you seek is explained there.

In other words, I'm trying to calculate the K point.
If by "K" you mean the corresponding point of the ephemeral key used in signing referred to "k" in some standards, then you can't do that. The whole security of ECDSA relies on the fact that this is impossible to compute.

I'm not looking for the private k value
I want to calculate the K point which is public.

in pubkey and pubkeyhash type signatures


N = 115792089237316195423570985008687907852837564279074904382605163141518161494337

type (X) = EllipticCurve Point on x ^ 3 + 7 for PrimeFileld
type (G) = EllipticCurve Base Point on x ^ 3 + 7 for PrimeFileld

type (R) = (max 256-bit) Integer
type (S) = (max 256-bit) Integer
type (Z) = (max 256-bit) Integer

(How to calculate K on EllipticCurve): retrun EcPoint

(R / S% N) * X + (Z / S% N) * G

This gives us the point K on the Elliptic Curve
If K.x == R
signature is correct.

Alice Signed. How does Bob understand this. Somehow it has to calculate the message (Z value) so that it can check the signature.

My question is I'm trying to figure out how Bob calculates this on my Z value. Not calculating K. If I wanted to find the equivalent of point K in positive numbers, I would be interested in ECDLP. But our topic is not ECDLP. Thanks.

1DWA3Sa8i6eHVWV4AG4UP2SBhYB2XrfiHW
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!