{
  "handle": "HeldRelease",
  "mechanism": "{{value}} ({{unique_handle}}) 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}} transitions: EMPTY --deposit--> HELD --claim(valid)--> RELEASED_TO_B | --timeout--> RETURNED_TO_A. Primitives: hash {{commitment_device}} (SHA256 pre-commitment locks the claim surface before the preimage exists), timelock (block height), 2-of-2 multisig or smart contract.",
  "gloss": "Escrow primitive: value held until condition preimage revealed or timeout",
  "failure_modes": [
    "Preimage loss: If Party B loses the preimage, value returns to A on timeout (safe but B loses).",
    "{{condition}} 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."
  ],
  "invariants": [
    "Exactly one of Empty, Held, Released or Returned; no partial {{state}}.",
    "Releases only on a preimage whose hash matches the committed {{condition}}.",
    "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."
    }
  ],
  "_meta": {
    "tier": 1,
    "ring": 0,
    "supersedes": [
      "sema:HeldRelease#mh:SHA-256:49566d2180cf09f70f2d9972dddd190dfb23c4cda4ff69ccab97b76930a34585",
      "sema:HeldRelease#mh:SHA-256:3ed68df815a35cd4f70e51c3504036ced51f92529b82c4ac9bb4fa2e1d5c5436",
      "sema:HeldRelease#mh:SHA-256:533b77d8341545dd80bd5a940492f028059ee8105cf523b26e4c16736ced46a5",
      "sema:HeldRelease#mh:SHA-256:08506ccf6d4e8e46131ed3766b8d6f70feb878ffdfa9284e01b367418f06fa95"
    ],
    "path": [
      "Society",
      "Protocols"
    ]
  },
  "sema_id": "sema:HeldRelease#mh:SHA-256:ce65cfd49c0f96fa291163b563d1a0ad78e09059fdd4889f571cba8d101b721f",
  "sema_ref": "HeldRelease#ce65",
  "sema_stub": "ce65",
  "dependencies": {
    "accepts": {
      "unique_handle": "sema:UniqueHandle#mh:SHA-256:185337050ca62b46cf88be534139cf31c2313c660f845daa395507c7faebcb1c"
    },
    "references": {
      "commitment_device": "sema:CommitmentDevice#mh:SHA-256:548b0a08b4956329e458f4e9bd150ea3d40c1867ca99e04b3e4f1bb31c9c6278",
      "condition": "sema:Condition#mh:SHA-256:b480f3c4da11ba6d86f6d14e0fb8521268f3c4bb38588460f7ff4253ad8d78d5",
      "state": "sema:State#mh:SHA-256:4f25e6a16ccd37dc0bc154cccc7055cb504d49daa8b712f372a425eb6c7b8cb2",
      "value": "sema:Value#mh:SHA-256:37fd75758d04cdd7f57a636ccb5394d463713d60c33b694e37ab71f4a5a896f8"
    }
  },
  "sema_layer": "Society",
  "sema_category": "Protocols",
  "used_by": {
    "composes_with": {
      "Award": "sema:Award#mh:SHA-256:4c5d0b7992809eebff99b727da727b08f4659773607c2621d8181b5d816e4b23"
    },
    "references": {
      "Oracle": "sema:Oracle#mh:SHA-256:cd1654cf7f025dc5e571546d808a995cdeee2a566ed84dcf0278017dd56ddd64"
    }
  }
}
