As other's have said, the essential point is the algebraic definition for additive inverses in elliptic arithemetic.
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 ...
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
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-...
You can negate a point (x, y) by simply changing it to (x, −y).
The document that defines ECDSA reminds us of this fact:
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.
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
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 ...
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 ...