{
  "x402Version": 2,
  "id": 7517,
  "slug": "7517",
  "resource": "https://animica.dev/x402/random/int",
  "description": "Uniform integers in [min, max] derived from ONE verified randomness draw by rejection sampling (never modulo bias) — up to 1000 per request. The response carries the raw draw, the node's source/health/attestation and the exact rule, so you can recompute every integer offline.",
  "type": "http",
  "accepts": [
    {
      "scheme": "exact",
      "network": "eip155:8453",
      "payTo": "0x5D17c40FD6b119dc6006C4Ab3C20a917FCaB2aCD",
      "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "amount": "5808",
      "maxTimeoutSeconds": 60
    },
    {
      "scheme": "exact",
      "network": "animica:1",
      "payTo": "anim1zqpsmegc0qcvzjfukm89xs0zeu3eqyyyel7kelehuszvwfarqypky2gr946ga",
      "asset": "ANM",
      "amount": "68989547038",
      "maxTimeoutSeconds": 60
    }
  ],
  "outputSchema": {
    "animica": {
      "catalog": "https://animica.dev/.well-known/x402",
      "content_type": "application/json",
      "currency": "USDC",
      "description": "Uniform integers in [min, max] derived from ONE verified randomness draw by rejection sampling (never modulo bias) — up to 1000 per request. The response carries the raw draw, the node's source/health/attestation and the exact rule, so you can recompute every integer offline.",
      "documentation": "https://animica.dev/x402#product-random_int",
      "free_trial": {
        "endpoint": "POST /x402/random/int/trial",
        "limit_per_day": 3,
        "note": "Same code and same response shape as the paid endpoint. No payment, no payment headers. Quota is per client per UTC day; when it is spent this endpoint says so and points back here.",
        "price": "0",
        "url": "https://animica.dev/x402/random/int/trial"
      },
      "name": "Uniform random integers",
      "openapi": "https://animica.dev/x402/openapi.json",
      "price": "0.005808",
      "product": "random_int",
      "provider": "Animica",
      "terms": {
        "amount_atomic": "5808",
        "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "chain_id": 8453,
        "network": "eip155:8453",
        "pay_to": "0x5D17c40FD6b119dc6006C4Ab3C20a917FCaB2aCD",
        "scheme": "exact"
      },
      "x402_version": 2
    },
    "bazaar": {
      "discoverable": true,
      "info": {
        "input": {
          "body": {
            "count": 3,
            "max": 6,
            "min": 1
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "example": {
            "attestation": {
              "alg": "ed25519",
              "attested": false,
              "backend": "software",
              "digest_hex": "14a2636cf09e18539ab6ed62de65af350c2f6014d269b74d127fc1604c7aa68a",
              "public_key_hex": "8a2228f4bde8f72964a7ff4aa759f24932ae1cccd9462ad94ca6e508d6b87a64",
              "signature_hex": "bee4d32ee31dd92b07f1eee3113ed722c3c96c5fae98c509bcca8f66a5ceaff3eb4a6cd41cd97fc32deebdeeab18b4affea467549dd4ef387ddbdae6d415e900"
            },
            "bytes": 32,
            "derivation": {
              "algorithm": "uniform-int-rejection-sampling",
              "domain": "animica/qrng/public/v1",
              "entropy_hex": "8e8d85d9c03247ffdff7b3db1c917b7a0e97a569e8cf098071dd91cc9121ae55",
              "kind": "range",
              "recompute": {
                "beacon_hex": "8e8d85d9c03247ffdff7b3db1c917b7a0e97a569e8cf098071dd91cc9121ae55",
                "kind": "range",
                "output": [
                  5,
                  1,
                  2
                ],
                "params": {
                  "count": 3,
                  "hi": 6,
                  "lo": 1
                },
                "request_id": "",
                "round_id": 0
              },
              "request_id": "",
              "rules": {
                "seed": "seed = sha3_256(\"animica/qrng/public/v1\" || \"|k:\" || kind || \"|r:\" || request_id || \"|b:\" || bytes(randomness))",
                "stream": "stream = sha3_256(seed || be8(counter)) for counter = 0,1,2,… concatenated; consumed left to right, never reused",
                "uniform_int": "randbelow(n): k = floor((bitlen(n)+7)/8)+1 bytes per attempt, read big-endian as x; limit = 2^(8k); accept when x < limit - (limit mod n); value = x mod n. Rejected attempts still consume their k bytes. n <= 1 consumes nothing and returns 0. This is rejection sampling — plain \"x mod n\" would bias small values."
              },
              "seed_hex": "5fb4cc0e8007c201060453ee9b7cacb38444d32d76d423c61e601117fadd3068",
              "steps": [
                "seed the DRNG with kind=\"range\" and your request_id over the raw randomness above",
                "for i = 0..2: ints[i] = 1 + randbelow(6)"
              ],
              "stream_bytes_consumed": 6,
              "verifier": {
                "api": "AnimicaBeacon.drngSeed(entropy, kind, request_id) + AnimicaBeacon.QDRNG reproduce the stream; AnimicaBeacon.verifyResult(derivation.recompute) === true whenever `recompute` is present",
                "file": "randomness/beacon_api/static/verify.js (Animica repo, github.com/animicaorg) — zero-dependency, runs in Node and the browser",
                "note": "verify.js calls the seed material `beacon` because it was written for beacon rounds. This product is NOT a beacon round: the seed material is the raw `randomness` bytes above, which the node signed (see `verification`)."
              }
            },
            "encoding": "hex",
            "health": {
              "min_entropy_per_byte": 7.8216,
              "passed": true
            },
            "product": "random_int",
            "randomness": "8e8d85d9c03247ffdff7b3db1c917b7a0e97a569e8cf098071dd91cc9121ae55",
            "result": {
              "count": 3,
              "ints": [
                5,
                1,
                2
              ],
              "max": 6,
              "min": 1
            },
            "source": {
              "attested": false,
              "device_path": null,
              "is_hardware": false,
              "is_quantum": false,
              "model": "os.urandom CSPRNG",
              "name": "software-fallback",
              "notes": "non-attested fallback for testing/degraded mode",
              "vendor": "os"
            },
            "verification": {
              "attested": false,
              "method": "signed-digest-attestation",
              "rules": [
                "attestation.digest_hex == sha3_256(bytes(randomness))",
                "ed25519_verify(pubkey=attestation.public_key_hex, message=raw_bytes(attestation.digest_hex), signature=attestation.signature_hex)"
              ],
              "trust_model": "signed by the serving node, not client-recomputable: you trust the node's entropy source, then verify it signed exactly these bytes. Check health.passed and attestation.attested before relying on it.",
              "verifier": "randomness/beacon_api/static/verify.js in the animica repo (github.com/animicaorg) — dependency-free Node module exporting sha3_256; pair with any ed25519 verifier"
            }
          },
          "type": "json"
        }
      },
      "schema": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "properties": {
          "input": {
            "properties": {
              "body": {
                "properties": {
                  "count": {
                    "description": "how many integers, 1..1000 (default 1; alias n)",
                    "type": "integer"
                  },
                  "max": {
                    "description": "upper bound, inclusive (>= min)",
                    "type": "integer"
                  },
                  "min": {
                    "description": "lower bound, inclusive",
                    "type": "integer"
                  },
                  "request_id": {
                    "description": "your own tag; mixed into the DRNG seed so you can recompute this exact draw",
                    "type": "string"
                  }
                },
                "required": [
                  "min",
                  "max"
                ],
                "type": "object"
              },
              "bodyType": {
                "enum": [
                  "json"
                ],
                "type": "string"
              },
              "method": {
                "enum": [
                  "POST"
                ],
                "type": "string"
              },
              "type": {
                "const": "http",
                "type": "string"
              }
            },
            "required": [
              "type",
              "method"
            ],
            "type": "object"
          },
          "output": {
            "properties": {
              "example": {},
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "type": "object"
          }
        },
        "required": [
          "input"
        ],
        "type": "object"
      }
    },
    "discovery": {
      "discoverable": true,
      "info": {
        "entropy": {
          "attested": false,
          "health_passed": true,
          "is_hardware": false,
          "is_quantum": false,
          "min_entropy_per_byte": 7.7725,
          "model": "os.urandom CSPRNG",
          "note": "observed on the gateway's own readiness draw, published unpaid so the trust model is knowable before purchase; the same fields ride verbatim on every paid response",
          "observed_at": "2026-08-22T08:41:02.928Z",
          "signer_backend": "software",
          "source": "software-fallback",
          "vendor": "os"
        },
        "input": {
          "bodyFields": {
            "count": {
              "description": "how many integers, 1..1000 (default 1; alias n)",
              "required": false,
              "type": "integer"
            },
            "max": {
              "description": "upper bound, inclusive (>= min)",
              "required": true,
              "type": "integer"
            },
            "min": {
              "description": "lower bound, inclusive",
              "required": true,
              "type": "integer"
            },
            "request_id": {
              "description": "your own tag; mixed into the DRNG seed so you can recompute this exact draw",
              "required": false,
              "type": "string"
            }
          },
          "bodyType": "json",
          "method": "POST",
          "type": "http"
        },
        "output": {
          "description": "result {ints}, randomness (hex raw draw), source, health, attestation, verification, derivation {rules, steps, recompute} for offline recomputation, payment metadata",
          "type": "json"
        }
      }
    }
  },
  "tags": [
    "animica",
    "bazaar",
    "discovery"
  ],
  "sourceHost": "animica.dev",
  "lastUpdated": "2026-08-22T08:41:03.739Z",
  "quality": {
    "calls30d": 3,
    "uniquePayers30d": 1,
    "lastCalledAt": "2026-08-22T08:41:03.571Z"
  },
  "liveness": {},
  "verified": false,
  "featured": false,
  "provider": {
    "host": "animica.dev",
    "manifest_name": "animica.dev",
    "source": "cdp-mirror",
    "source_manifest_url": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources",
    "submitted_at": "2026-09-18T22:00:31.484Z"
  }
}