Preimage
A preimage is the input that produces a given output when run through a hash function. If SHA-256 of some value equals a known digest, that value is the digest's preimage. Secure hash functions make recovering a preimage from an output computationally infeasible, since an attacker faces a search space of 2^256 possibilities for a 256-bit hash.
Why it matters
Preimage resistance is one of the load-bearing assumptions of bitcoin. Addresses are hashes of public keys, contract commitments hide values until they are revealed, and proof-of-work assumes no one can reverse a hash. In the Lightning Network the word has a specific operational meaning: the preimage is the payment secret whose revelation proves a payment was completed.
How it works
In a Lightning payment, the recipient generates a random secret, hashes it with SHA-256, and embeds the hash in an invoice. Each node along the route locks funds that can only be claimed by presenting the matching preimage before a timeout. When the recipient reveals the secret to claim the final hop, it propagates backward hop by hop, settling every link in the route. This makes the multi-hop payment atomic: either the preimage is revealed and everyone is paid, or the timeouts expire and all funds return to their senders.
Ready to convert your gold to Bitcoin?
Get Your Free Kit →