Preimage
A preimage is the data that is input into a hash function to calculate a hash.
A preimage is the data that is input into a hash function to calculate a hash. Since a hash function is a one-way function, the output, the hash, cannot be used to reveal the input, the preimage. Any piece of data can be used as a preimage.
For example, addresses are created by taking the hash of a public key. Likewise, a block header is the preimage for a block’s Proof-of-Work, which is a hash.
Hashes are often used as commitments to preimages, because the commitment to the preimage can be published without revealing the preimage. For example, if bitcoin is sent to a P2PKH address, which is the hash of a public key, that bitcoin is committed to a certain public key even though the public key is not known by anyone but the owner, who we will call Alice. When Alice wishes to spend the bitcoin, she publishes the preimage, the public key, along with a signature, proving their control of the corresponding private key.
With those two pieces of information, anyone validating the blockchain can verify that the bitcoin actually belonged to that public key, and that Alice controls that public key. The Lightning Network also uses preimages as proof that a Lightning invoice has been paid. In this context, the hashed time locked contract (HTLC) serves as the commitment, promising to pay a routing node a fee in exchange for routing the desired payment, while the preimage, the (unhashed) time-locked contract, is the proof that the commitment has been satisfied.
HTLCs are sent from the payer node to the routing node, to the receiving node, who returns the preimage of the HTLC to the routing node, who uses the preimage to claim the fee they were promised.
Preimage is a concept relevant to Bitcoin, finance, or blockchain technology that investors should understand. Onramp's comprehensive Bitcoin glossary provides clear explanations of Preimage and hundreds of other terms to support informed investment decisions.
Frequently Asked Questions
What is Preimage?
Preimage is a term used in Bitcoin, finance, or blockchain technology. Understanding Preimage helps investors and enthusiasts build a stronger foundation of knowledge about digital assets and financial markets.
Why is Preimage important?
Preimage is relevant to understanding how Bitcoin, financial markets, or blockchain technology operates. Knowledge of such concepts helps investors make better-informed decisions about their portfolios.
Where can investors learn more about Preimage?
Onramp's Bitcoin glossary offers detailed, accessible explanations of Preimage and over 500 other terms related to Bitcoin, finance, and blockchain technology for investors at all experience levels.
