¿Cómo recuperar la clave pública ECDSA de la firma?
Sé que todo lo que se necesita es un hash del mensaje sin firmar y la firma.
¿Pero puede haber algún método detallado para calcular la clave pública ECDSA?
al mirar un tx firmado (P2PKH), la firma se ve así:
483045022100A428348FF55B2B59BC55DDACB1A00F4ECDABE282707BA5185D39FE9CDF05D7F0022074232DAE76965B6311CEA2D9E5708A0F137F4EA2B0E36D0818450C67C9BA259D0121025F95E8A33556E9D7311FA748E9434B333A4ECFB590C773480A196DEAB0DEDEE1
Esto se puede dividir en dos partes:
firma: 483045022100A428348FF55B2B59BC55DDACB1A00F4ECDABE282707BA5185D39FE9CDF05D7F0022074232DAE76965B6311CEA2D9E5708A0F137F4EA2B0E36D0818450C69D0C697C
clave pública: 21025F95E8A33556E9D7311FA748E9434B333A4ECFB590C773480A196DEAB0DEDEE1
y además se ve así en detalle (con la dirección de pubkey al final):
##################################################################
48: OP_DATA_0x48: push hex 48 (decimal 72) bytes as data
30: OP_SEQUENCE_0x30: type tag indicating SEQUENCE, begin sigscript
45: OP_LENGTH_0x45: length of R + S
02: OP_INT_0x02: type tag indicating INTEGER
21: OP_LENGTH_0x21: this is SIG R
00A428348FF55B2B:59BC55DDACB1A00F
4ECDABE282707BA5:185D39FE9CDF05D7
F0
02: OP_INT_0x02: type tag indicating INTEGER
20: OP_LENGTH_0x20: this is SIG S
74232DAE76965B63:11CEA2D9E5708A0F
137F4EA2B0E36D08:18450C67C9BA259D
01: OP_SIGHASHALL: this terminates the ECDSA signature (ASN1-DER structure)
#########################################################
21: OP_DATA_0x21: type tag indicating LENGTH
02: OP_INT_0x02: type tag indicating INTEGER
5F95E8A33556E9D7:311FA748E9434B33
3A4ECFB590C77348:0A196DEAB0DEDEE1
* This terminates the Public Key (X9.63 COMPRESSED form)
* corresponding bitcoin address is:
1HTNtayFkoBV28wqDygMbW33qSnRjxAuNR
pebwindkraft
Denis Leónov
sr-gi
Denis Leónov
sr-gi
Denis Leónov
Actually, it is not possible to uniquely recover the public key from an ECDSA signature
desde este enlacesr-gi