public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: MC 5760 <mocay5760@gmail•com>
To: bitcoin-dev@lists•linuxfoundation.org
Subject: [bitcoin-dev] Generate and verify ECDSA signature without "r"
Date: Sat, 5 Nov 2022 15:46:15 +0700	[thread overview]
Message-ID: <CA+Ej=UZBNUoqYW7Rw1d1K=7JwiovuHg6YchQkcrE0_RhjT+Wbw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

1. Address: private key -> ECC -> public key compression -> Bech32m encode

2. scriptPubkey: Address -> Bech32m decode -> public key compression

3. Segwit: (dsha256(txid_input & index) * x public key + dsha256(unsigned
raw transaction) mod (private key)) mod (N) => Will give a number of 32
bytes

4. Verify:

x1, y1 = ECC(G, dsha256(txid_input & index))

p1 = ECC(G, dsha256(unsigned raw transaction) mod (Segwit))

p2 = ECC((x1,y1) * x public key mod (Segwit)

x2, y2 = ECAddpoint(p1, p2)

If x2 = x public key => OK

I wrote the python code here:
https://github.com/tanvovan/bitcoin/blob/main/p2pc.py

[-- Attachment #2: Type: text/html, Size: 4562 bytes --]

                 reply	other threads:[~2022-11-05  8:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+Ej=UZBNUoqYW7Rw1d1K=7JwiovuHg6YchQkcrE0_RhjT+Wbw@mail.gmail.com' \
    --to=mocay5760@gmail$(echo .)com \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox