Skip to content

Instantly share code, notes, and snippets.

@vincenzopalazzo
Created March 24, 2019 19:14
Show Gist options
  • Save vincenzopalazzo/78c3545090ce609a145f4f6261a7fa0f to your computer and use it in GitHub Desktop.
Save vincenzopalazzo/78c3545090ce609a145f4f6261a7fa0f to your computer and use it in GitHub Desktop.
The python script for calculate a double sha256 for block and transaction
from binascii import unhexlify
from hashlib import sha256
header = unhexlify("0101000000010000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000")
print(sha256(sha256(header).digest()).hexdigest())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment