{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gryd.world/protocol/schemas/ghost-spawn.json",
  "title": "Locus ghost.spawn payload (v3)",
  "description": "OP_RETURN payload for op=ghost.spawn (public world NPC). Canonical JSON. See SPEC.md §7.3. Unknown fields are allowed and must be preserved by indexers (SPEC.md §11).",
  "type": "object",
  "required": ["p", "v", "op", "lat", "lng", "type_key", "owner", "owner_pubkey"],
  "properties": {
    "p": { "const": "locus" },
    "v": { "enum": [2, 3] },
    "op": { "const": "ghost.spawn" },
    "lat": { "$ref": "common.json#/$defs/lat" },
    "lng": { "$ref": "common.json#/$defs/lng" },
    "geohash": { "$ref": "common.json#/$defs/geohash" },
    "geo_ipv6": { "$ref": "common.json#/$defs/geoIPv6" },
    "city_prefix": { "$ref": "common.json#/$defs/cityPrefix" },
    "ghost_id": { "type": "string" },
    "type_key": { "type": "string", "description": "Ghost archetype key (e.g. greeter, oracle)." },
    "behavior": {},
    "content": {},
    "owner": { "$ref": "common.json#/$defs/bsvAddress" },
    "owner_pubkey": { "$ref": "common.json#/$defs/pubkey" },
    "nonce": { "$ref": "common.json#/$defs/nonce" },
    "ts": { "$ref": "common.json#/$defs/ts" },
    "metadata": { "type": "object" }
  },
  "additionalProperties": true
}
