Small script that parses and regenerates variants of the BIP 174 scheme.
Requires Python 3 and construct
. Protobuf is based on
trezorlib
implementation,
extended to support Fixed32 fields. It doesn't support packed arrays
though, which messes up the measurement a little.
Presumes UNIX-based environment, only tested on Linux but should work elsewhere too.
Create and activate a virtualenv:
python3 -m venv virtualenv
source virtualenv/bin/activate
pip install -r requirements.txt
Feed one of the test vectors (taken from here) to the tool:
python3 analyze.py < case-sighash.hex
All code is covered by LGPLv3.