2018-02-01-1729Z


OK, so AmericanCoin uses sha256d for the block hash, and scrypt for the proof-of-work. that's why the "block hashes" rarely have any leading zeroes.

I found the block by grepping the output of blockparse.py, the following is just an after-the-fact demo:

jcomeau@aspire:/usr/src/blockparser$ python
Python 2.7.12+ (default, Sep  1 2016, 20:27:38) 
[GCC 6.2.0 20160822] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from blockparse import *
>>> import scrypt
>>> logging.getLogger('').setLevel(logging.WARN)
>>> blocks = nextblock(['/tmp/blk0001.dat'], 315149)
>>> myblock = next(blocks)
WARNING:root:NOTE: "height" values shown are relative to start of first file and may include orphaned blocks
>>> show_hash(hashlib.sha256(hashlib.sha256(myblock[1]).digest()).digest())
'12b6268311614e5a81bcb50e310c1aeabf01cd6e28c3e1a403dcd177498fbcb7'
>>> show_hash(scrypt.hash(myblock[1], myblock[1], 1024, 1, 1, 32))
'00000024a678bf4909239e5b92def58447735d0a026fd7bd1056c7814413670e'

Back to blog or home page

last updated 2018-02-01 13:06:22. served from tektonic.jcomeau.com