richardkiss/pycoin

`tx -s` prints wrong z value for segwit transactions

richardkiss opened this issue · 5 comments

The source for this tx can be found at https://gist.github.com/richardkiss/0c7d3da47c94d1d662a3cebe0ce32bb8

tx -s 0100000001117887afe5b31d70b4cbd2c06de7907dfaa8aac08789a7ae8f4adb55580e4d1a00000000\
85483045022100c9794be4c51d2b5ca82510e456e321c1f403d7c10109c3944d76e4b574246a1b022\
05f920a39a8f32595606071539130da5e5186fdd66575247411886193625eefc901210279be667ef9d\
cbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f817981976a914751e76e8199196d454941\
c45d1b3a323f1433bd688acffffffff0164000000000000001976a914751e76e8199196d454941c45d1\
b3a323f1433bd688ac0000000000f2052a0100000017a914cd7b44d0b03f2d026d1e586d7ae18903\
b0d385f687 | grep z:
      z: 0xc9aed3b525b17e85d5afb4c368086881ba3bd14e5e7e5ff2f11e22bfcb261f73 SIGHASH_ALL

The z value is actually 0x14e7ab9ca658ca76d8b8111b82dd54fcafd2178f4cd42c235f587ce1bf3ad45.

Any updates on this issue?

@maninder95 I haven't had much time to work on this lately. Is this a blocker for you?

Yes. I can't fix it on my own, my coding skills are not there yet. I would appreciate if you could address this at some point.
Is there any alternative tools to calculate Z value you could recommend in the meantime?

tx -d performs disassembly, and it prints the correct z value, so that's a workaround for the time being.

Fixed in 20ce00f