Decode Input-Script Number

0

You can divide on some pages the input script number in R and S. Now I wanted to ask if someone can tell me a Python code how to divide the input script number into R and S or can define, so I have only R and S.

Thank you

example Number:4830450221008377df63977c2b3212f11ffbf098b328b4f246a86d131faa75effe53cef8568a02200c7187e5898f4dc605819bb6cdb7e357ec6993ce1ad11a87a621a7a579fe6d92014104a2b3aef09705da98696f357dfa78605f6490f4115d55a8e0a5ada4152f77a50e4faa479b0ed241bb8699e356644dbe8de5058c2bbb739e42f8928e95ad8d7a18

vinny

Posted 2018-02-17T04:27:59.917

Reputation: 1

Answers

1

I have no ready-usable python code, and doubt there is. But here is the transaltion and details, which I generated with a set of shell scripts. This explains, and should help you to get started. More details can be found by searching the web for "ECDSA signature" and "ASN1-DER structure".

    48: OP_DATA_0x48:        push hex 48 (decimal 72) bytes on stack
    30: OP_SEQUENCE_0x30:    type tag indicating SEQUENCE, begin sigscript
    45: OP_LENGTH_0x45:      length of R + S
    02: OP_INT_0x02:         type tag INTEGER indicating length
    21: OP_LENGTH_0x21:      this is SIG R (33 Bytes)
        008377DF63977C2B:3212F11FFBF098B3
        28B4F246A86D131F:AA75EFFE53CEF856
        8A
    02: OP_INT_0x02:         type tag INTEGER indicating length
    20: OP_LENGTH_0x20:      this is SIG S (32 Bytes)
        0C7187E5898F4DC6:05819BB6CDB7E357
        EC6993CE1AD11A87:A621A7A579FE6D92
    01: OP_SIGHASHALL:       this terminates the ECDSA signature (ASN1-DER structure)
    41: OP_DATA_0x41:        length uncompressed Public Key (X9.63 form, 65 Bytes)
        04A2B3AEF09705DA:98696F357DFA7860
        5F6490F4115D55A8:E0A5ADA4152F77A5
        0E4FAA479B0ED241:BB8699E356644DBE
        8DE5058C2BBB739E:42F8928E95AD8D7A
        18

pebwindkraft

Posted 2018-02-17T04:27:59.917

Reputation: 4 568