Author

Topic: Validating DER sig (brainwallet Tx eg) (Read 872 times)

legendary
Activity: 1260
Merit: 1019
July 28, 2015, 10:20:21 PM
#4
Strictly speaking, BC Core also treats the follow-up byte
I told about first byte
sr. member
Activity: 255
Merit: 250
Senior Developer - Armory
July 28, 2015, 10:15:47 PM
#3
How, using pybitcointools (or Python), does one validate these DER sigs (given we know both privkeys)?
Throw away your knowledge of privkeys.
Validating ecdsa signature does not require privkeys.

Start from here
http://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx
http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html
http://bitcoin.stackexchange.com/questions/32305/how-does-the-ecdsa-verification-algorithm-work-during-transaction

dersigs in your transaction (or may be is it my transaction?  Grin ) are
Code:
303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302205eff1e344551d115b708155eed631cafa4fe719be5ec68c1f3abbf8670d34e11
303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302201e74d38e5abd2836e9e17acf1b94f267b4f99704e2b22eac02ab136ec4740b76

Strictly speaking, BC Core also treats the follow-up byte ("sighash") as part-and-parcel with the actual DER signature, even though it's not included as part of the DER encoding. In this case, both transactions are SIGHASH_ALL (0x01).
legendary
Activity: 1260
Merit: 1019
July 28, 2015, 08:49:05 AM
#2
How, using pybitcointools (or Python), does one validate these DER sigs (given we know both privkeys)?
Throw away your knowledge of privkeys.
Validating ecdsa signature does not require privkeys.

Start from here
http://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx
http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html
http://bitcoin.stackexchange.com/questions/32305/how-does-the-ecdsa-verification-algorithm-work-during-transaction

dersigs in your transaction (or may be is it my transaction?  Grin ) are
Code:
303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302205eff1e344551d115b708155eed631cafa4fe719be5ec68c1f3abbf8670d34e11
303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302201e74d38e5abd2836e9e17acf1b94f267b4f99704e2b22eac02ab136ec4740b76
full member
Activity: 233
Merit: 102
July 27, 2015, 07:58:12 PM
#1
https://blockchain.info/tx/54a44539ada32ea5eb218ed5d853a08712be6129d8ec752b8c77f6c88bfe721a

So we have:

  • sha256("cat")
  • sha256("password")

Code:
'01000000020fa5ed9983859c6703c5469bdda6f30ee2b59febe89d3e9755e601a35bfe837c020000007f3c303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302205eff1e344551d115b708155eed631cafa4fe719be5ec68c1f3abbf8670d34e11014104a45ebc40f95cc06ef93a5f5e9daa22774a5c9a120ac14d87c328b44c1158f81cddd109246a4d8bff5f93cbba79a17f2dc6e7c73da8d6bd0d98615d1bf353f8beffffffff0fa5ed9983859c6703c5469bdda6f30ee2b59febe89d3e9755e601a35bfe837c030000007f3c303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302201e74d38e5abd2836e9e17acf1b94f267b4f99704e2b22eac02ab136ec4740b76014104b568858a407a8721923b89df9963d30013639ac690cce5f555529b77b83cbfc76950f90be717e38a3ece1f5558f40179f8c2502deca11183bb3a3aea797736a6ffffffff01dc05000000000000232103d68f90ba81455256cb7a0df14fb3930d6df61393207f2f3e71659414d296e0f0ac00000000'

dersig1 = "3c303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302205eff1e344551d115b708155eed631cafa4fe719be5ec68c1f3abbf8670d34e11"
dersig2 = "3c303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302201e74d38e5abd2836e9e17acf1b94f267b4f99704e2b22eac02ab136ec4740b76"

How, using pybitcointools (or Python), does one validate these DER sigs (given we know both privkeys)?

(PS: if someone can weigh on this related question, I'd greatly appreciate it
Jump to: