Quiz Entry - updated: 2026.07.30
What is the Off-Chain Secret Enabled Dynamic Authorization (Hashlock) pattern, and how does it authorise someone unknown in advance?
Commit the hash of a secret on-chain and lock funds against it; whoever later reveals the matching secret is authorised — so the authoriser doesn't have to be named when the transaction is first submitted.
- Problem. A blockchain authorises via digital signatures tied to addresses defined in the first transaction, so it can't dynamically bind authority to a party unknown at deployment time.
- Solution. Use an off-chain secret. In a payment, a smart contract acts as an escrow: the sender deposits money together with the hash of a secret (a random string, the pre-image). Whoever obtains the secret off-chain can claim the money by revealing it — the receiver never had to be defined beforehand. A variant locks several transactions with the same secret, so revealing it unlocks all of them at once. This dynamic property is also called a hashlock.
- Benefits. Dynamism (bind authority after the fact), lost-key tolerance (no specific private key needed), routability (one revealed secret opens every transaction locked by it — the basis of multi-hop payment channels), and interoperability (the secret can be exchanged by any means, letting other systems trigger on-chain events).
- Drawbacks. One-off secret (verification is on-chain, so once used the secret is exposed and can't be reused); it may need to be combined with a signature; and a lost secret locks the funds forever.
Go deeper:
Lightning Network (Wikipedia) — HTLCs put this hashlock to work: revealing one secret pulls a payment along an entire multi-hop route, exactly the "routability" benefit above.