Paper 2020/927

A Gas-Efficient Superlight Bitcoin Client in Solidity

Stelios Daveas, Kostis Karantias, Aggelos Kiayias, and Dionysis Zindros


Superlight clients enable the verification of proof-of-work-based blockchains by checking only a small representative number of block headers instead of all the block headers as done in simplified payment verification (SPV). Such clients can be embedded within other blockchains by implementing them as smart contracts, allowing for cross-chain verification. One such interesting instance is the consumption of Bitcoin data within Ethereum by implementing a Bitcoin superlight client in Solidity. While such constructions have demonstrated security and efficiency in theory, no practical implementation exists. In this work, we put forth the first practical Solidity implementation of a superlight client which implements the NIPoPoW superblocks protocol. Contrary to previous work, our Solidity smart contract achieves sufficient gas-efficiency to allow a proof and counter-proof to fit within the gas limit of a block, making it practical. We provide extensive experimental measurements for gas consumption. The optimizations that enable gas-efficiency heavily leverage a novel technique which we term hash-and-resubmit, which almost completely eliminates persistent storage requirements, the most expensive operation of smart contracts in terms of gas. Instead, the contract asks contesters to resubmit data and checks their veracity by hashing it. Other optimizations include off-chain manipulation of proofs in order to remove expensive look-up structures, and the usage of an optimistic schema. We show that such techniques can be used to bring down gas costs significantly and may be of independent interest. Lastly, our implementation allows us to calculate concrete cryptoeconomic parameters for the superblocks NIPoPoWs protocol and in particular to make recommendations about the monetary value of the collateral parameters. We provide such parameter recommendations over a variety of liveness settings.

Note: Add acknowledgement

Available format(s)
Publication info
Preprint. MINOR revision.
BlockchainSuperlight clientsNIPoPoWsSolidityDesign Patterns
Contact author(s)
sdaveas @ gmail com
kkarantias @ gmail com
akiayias @ inf ed ac uk
dionyziz @ gmail com
2020-11-22: last of 4 revisions
2020-07-26: received
See all versions
Short URL
Creative Commons Attribution


      author = {Stelios Daveas and Kostis Karantias and Aggelos Kiayias and Dionysis Zindros},
      title = {A Gas-Efficient Superlight Bitcoin Client in Solidity},
      howpublished = {Cryptology ePrint Archive, Paper 2020/927},
      year = {2020},
      note = {\url{}},
      url = {}
Note: In order to protect the privacy of readers, does not use cookies or embedded third party content.