KomodoPlatform / pycc

Crypto-Conditions for Komodo in Python
5 stars 5 forks source link

make OP_RETURN data format safe and efficient #12

Open Alrighttt opened 4 years ago

Alrighttt commented 4 years ago

['faucet.drip', ([1], [1, 1]), {}, '03a8339e98111ee9dc74a956164e6507a67005f4a2c45c0481f1b9d7c3c7d5fd9a', '03a8339e98111ee9dc74a956164e6507a67005f4a2c45c0481f1b9d7c3c7d5fd9a']"

If a pubkey is stored like this in OP_RETURN by pycctx, it it first being converted to ascii prior to being added to the OP_RETURN. This results in the data taking twice as much space.

ssadler commented 4 years ago

Currently, OP_RETURN contains and ascii blob which is just the result of repr called on the params, and it is "parsed" with eval, which is highly unsafe.

This should be replaced with a binary format with automatic deduplication and safe parsing.