A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

New answers tagged

0

As other's have said, the essential point is the algebraic definition for additive inverses in elliptic arithemetic. -(x,y)=(x,-y) But if it helps, there are also some nice geometric illustrations like this one from Vitalik Buterin's Exploring Elliptic Curve Pairings: Suppose R = (x,y). Since the elliptic curve is symmetric with respect to the x-axis, we ...


0

Here is the sample of code for subtraction of two points. # -*- coding: utf-8 -*- def OnCurve(x,y): # Check if the point is on the curve A = (y*y)%P B = (x*x*x)%P C = False if A == (B + 7): C = True return C def ECadd(xp,yp,xq,yq): # EC point addition m = ((yq-yp) * modinv(xq-xp,P))%P xr = (m*m-xp-xq)%P yr = (m*(xp-...


4

You can negate a point (x, y) by simply changing it to (x, −y). The document that defines ECDSA reminds us of this fact: https://www.secg.org/sec1-v2.pdf Here's a screenshot: So once you have negated one of your points, just add it to the other one, and you have achieved subtraction.


3

DER The Distinguished Encoding Rules (DER) format is used to encode ECDSA signatures in Bitcoin. An ECDSA signature is generated using a private key and a hash of the signed message. It consists of two 32-byte numbers (r,s). As described by Pieter here the DER signature format has six components: 0x30 byte: header byte to indicate compound structure one ...


2

There are different formats used to encode public keys and signatures into binary (octet-streams). They are defined in Standards for Efficient Cryptography 1 (SEC). A public key is a point on an elliptic curve, consisting of an x and y coordinate. There needs to be a standard way for serializing these parts and deserializing them later. The standard defines ...


0

I didn't actually understand what you want. Hardened public keys cannot be generated from the master public key, and a priori cannot be attributed to the owner of the non-hardened addresses above. There's no "hardened xpub (extended public key)" at all. There are only "hardened childs" or "normal (non-hardened) childs", of one parent xprv (extended ...


Top 50 recent answers are included