A library for verifying Lamport Signatures from within an Ethereum EVM smart contract. Written in Solidity. This library is part of an ongoing effort by Pauli Group to ensure that blockchain technology continues to be viable in the face of Quantum Computing.
- LamportBase.sol - an abstract contract that contains logic for effective ownership of a contract secured by a Lamport Signature
- LamportTest2.sol - a contract that inherits from LamportBase. An example of how to use the library to secure ownership of a contract
- Inherit from LamportBase.sol
- use the
onlyLamportOwner
modifier on any function that you want to be secured by a Lamport Signature - correctly pass the paramerters to the modifier. Take special note of the fact that all the relevent parameters (except the next pkh) must be combined using abi.encodePacked() before being passed to the modifier. Please look at
broadcastWithNumberAndAddress
in LamportTest2.sol for an example of how to do this. - remember! Any parameters not included in the signed hash would be left vulnrable to quantum attacks and thus could be altered before being written to the blockchain. I recommend that you include all parameters in the signed hash. The modifier will handle packing your
nextPKH
with your already packed parameters before hashing and passing toverify_u256
.currentpub
does not need to be signed. It is already secured by the hashpkh
.
bash test.sh