Skip to content

Handle block signature verification

DuniterPy correctly check the signature of the user (tx, wot) and the peer documents. The signature of this document is based on its raw format. Excepted the block document signature which is based on the InnerHash and the Nonce of the block. For the Block document, a special case should be handled as follow:

#prepended = signature + bytes(document.raw(), "ascii")
prepended = signature + bytes("InnerHash: {0}\nNonce: {1}\n".format(document.inner_hash, document.nonce), "ascii")

So we need to handle it correctly in the line:

https://git.duniter.org/clients/python/duniterpy/blob/dev/duniterpy/key/verifying_key.py#L37

Edited by Moul
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information