{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "HeldRelease",
 "ref": "HeldRelease#ce65",
 "hash": "sema:HeldRelease#mh:SHA-256:ce65cfd49c0f96fa291163b563d1a0ad78e09059fdd4889f571cba8d101b721f",
 "stub": "ce65",
 "layer": "Society",
 "type": "Protocols",
 "summary": "Escrow primitive: value held until condition preimage revealed or timeout",
 "mechanism": "Value#37fd (UniqueHandle#1853) held until condition met, released or returned on timeout. DEPOSIT: Party A sends value + condition_hash + timeout to escrow address. CLAIM: Party B submits condition_preimage; if hash(preimage) matches condition_hash, value releases to B. TIMEOUT: If timeout expires without valid claim, value returns to A. State#4f25 transitions: EMPTY --deposit--> HELD --claim(valid)--> RELEASED_TO_B | --timeout--> RETURNED_TO_A. Primitives: hash CommitmentDevice#548b (SHA256 pre-commitment locks the claim surface before the preimage exists), timelock (block height), 2-of-2 multisig or smart contract.",
 "invariants": [
  "Exactly one of Empty, Held, Released or Returned; no partial State#4f25.",
  "Releases only on a preimage whose hash matches the committed Condition#b480.",
  "Returns to the sender if the condition is unmet by `hold_duration`."
 ],
 "parameters": [
  {
   "name": "hold_duration",
   "type": "Duration",
   "range": "[1s, 24h]",
   "description": "Longest the value stays held before it returns to the sender."
  }
 ],
 "signature": [],
 "preconditions": [],
 "postconditions": [],
 "failure_modes": [
  "Preimage loss: If Party B loses the preimage, value returns to A on timeout (safe but B loses).",
  "Condition#b480 ambiguity: Hash commits to bytes, not semantics - parties must agree on preimage meaning off-chain.",
  "Timeout racing: Near timeout, both CLAIM and TIMEOUT may be in flight - needs atomic resolution.",
  "Oracle dependency: If condition requires external verification, oracle becomes trust point."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "HeldRelease",
 "builds_on": [
  {
   "alias": "commitment_device",
   "relation": "references",
   "library": "bootstrap",
   "slug": "CommitmentDevice",
   "ref": "CommitmentDevice#548b",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/CommitmentDevice"
  },
  {
   "alias": "state",
   "relation": "references",
   "library": "bootstrap",
   "slug": "State",
   "ref": "State#4f25",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/State"
  },
  {
   "alias": "value",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Value",
   "ref": "Value#37fd",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Value"
  },
  {
   "alias": "condition",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Condition",
   "ref": "Condition#b480",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Condition"
  },
  {
   "alias": "unique_handle",
   "relation": "accepts",
   "library": "bootstrap",
   "slug": "UniqueHandle",
   "ref": "UniqueHandle#1853",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/UniqueHandle"
  }
 ],
 "related": [],
 "used_by": [
  {
   "slug": "Award",
   "relation": "composes_with",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Award"
  },
  {
   "slug": "Oracle",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Oracle"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/HeldRelease",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/HeldRelease.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
