{
  "$defs": {
    "BondAmount": {
      "description": "Exact, non-negative decimal amount used by every bond money field.\n\nThe wire form is always a JSON string in canonical plain-decimal notation.\nValues are constrained to PostgreSQL `NUMERIC(38,18)`: at most 20 integer\ndigits and 18 fractional digits, with no sign or exponent. This keeps\nsignature bytes, threshold checks, and database values identical.",
      "pattern": "^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$",
      "type": "string"
    },
    "BondStatus": {
      "description": "Status of a publisher bond.\nPer MARS Specification Appendix A (bondReference schema).",
      "oneOf": [
        {
          "const": "active",
          "description": "Bond is active and fully collateralized.",
          "type": "string"
        },
        {
          "const": "partially_slashed",
          "description": "Bond has been partially slashed but still covers minimum.",
          "type": "string"
        },
        {
          "const": "fully_slashed",
          "description": "Bond has been fully slashed — entry should be revoked.",
          "type": "string"
        },
        {
          "const": "released",
          "description": "Bond has been released back to the publisher.",
          "type": "string"
        }
      ]
    },
    "SlashDistribution": {
      "description": "Distribution of slashed bond funds.\nPer MARS Specification Section 7.4:\n  30% reporter, 40% harmed parties, 30% network treasury.",
      "properties": {
        "harmedPartiesShare": {
          "$ref": "#/$defs/BondAmount",
          "description": "Amount going to harmed parties (40%)."
        },
        "reporterShare": {
          "$ref": "#/$defs/BondAmount",
          "description": "Amount going to the reporter (30%)."
        },
        "treasuryShare": {
          "$ref": "#/$defs/BondAmount",
          "description": "Amount going to network treasury (30%)."
        }
      },
      "required": [
        "reporterShare",
        "harmedPartiesShare",
        "treasuryShare"
      ],
      "type": "object"
    },
    "SlashEvent": {
      "description": "A slashing event recorded against a bond.\nPer MARS Specification Section 7.4.",
      "properties": {
        "amount": {
          "$ref": "#/$defs/BondAmount",
          "description": "Amount slashed in MINTS."
        },
        "distribution": {
          "$ref": "#/$defs/SlashDistribution",
          "description": "Distribution of slashed funds."
        },
        "reason": {
          "description": "Reason for the slash.",
          "type": "string"
        },
        "reporterDid": {
          "description": "DID of the reporter who triggered the slash.",
          "type": "string"
        },
        "timestamp": {
          "description": "When the slash occurred.",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "timestamp",
        "amount",
        "reason",
        "reporterDid",
        "distribution"
      ],
      "type": "object"
    }
  },
  "$id": "urn:mars:schema:v1:bond",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "Full bond record (server-side).\nPer MARS Specification Section 7.2.",
  "properties": {
    "amount": {
      "$ref": "#/$defs/BondAmount",
      "description": "Amount staked in MINTS."
    },
    "bondId": {
      "description": "Unique bond identifier.",
      "type": "string"
    },
    "createdAt": {
      "description": "When the bond was created.",
      "format": "date-time",
      "type": "string"
    },
    "currency": {
      "description": "Currency — always \"MINTS\".",
      "type": "string"
    },
    "entryDid": {
      "description": "DID of the entry this bond covers.",
      "type": "string"
    },
    "publisherDid": {
      "description": "DID of the publisher who posted the bond.",
      "type": "string"
    },
    "registryDid": {
      "description": "DID of the registry holding the bond.",
      "type": "string"
    },
    "slashHistory": {
      "description": "History of slashing events.",
      "items": {
        "$ref": "#/$defs/SlashEvent"
      },
      "type": "array"
    },
    "status": {
      "$ref": "#/$defs/BondStatus",
      "description": "Current status."
    }
  },
  "required": [
    "bondId",
    "publisherDid",
    "entryDid",
    "registryDid",
    "amount",
    "currency",
    "createdAt",
    "status"
  ],
  "title": "Bond",
  "type": "object"
}
