Skip to content

Instantly share code, notes, and snippets.

@t4sk
Last active January 8, 2017 23:54
Show Gist options
  • Save t4sk/d65cbda0341b640244ae288f5b314daa to your computer and use it in GitHub Desktop.
Save t4sk/d65cbda0341b640244ae288f5b314daa to your computer and use it in GitHub Desktop.
How to compute double sha256

How compute double sha256

This example is from BIP 143 - Native P2WPKH

Compute double sha256

> export PREV_OUTS=fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f00000000ef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a01000000
> echo -n $PREV_OUTS | xxd -r -p | openssl dgst -sha256 -binary | openssl dgst -sha256
96b827c8483d4e9b96712b6713a7b68d6e8003a781feba36c31143470b4efd37

References

BIP 143

How to compute double sha256 shown in examples of bip 143?

How do you perform double-SHA-256 encoding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment