Post
Topic
Board Development & Technical Discussion
Re: Using Pycoin to spend non-standard scripts
by
d4n13
on 18/07/2015, 06:53:46 UTC
I'm really familiar with pybitcointools, so I can certainly see how your suggestion works. However, the issue is when using serialize_script; namely, if you've got objects (like a pubkey), the serialize_script method doesn't add push codes for the size of the object.

Ie:

Code:
my_script = serialize_script([OP_foo, OP_bar, "20byte_pubkey_hash", OP_spam])

myscript will return 11 22 01234567890123456789 33 instead of 11 22 14 01234567890123456789 33
LOL...

I'm terribly unfamiliar with PyBitcoinTools, as my 'Wow there is a PyBitcoinTools module" post from today will likely attest.

I never realized there was a serialize_script method.  I was simply thinking of the serialize(tx_dict).  I was thinking you would right your own (or overwrite) the serialize_script method.  I mean there are less than 100 op codes right?