# LogicNodes Random From Block

> LogicNodes Random From Block is a paid API for AI agents from logicnodes.io, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-28).

Generates one or more verifiable random numbers derived from a specified EVM blockchain block hash, using an optional salt for uniqueness.

## Facts

- Endpoint: POST https://logicnodes.io/paid/v1/tools/random_from_block?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-28
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/logicnodes-random-from-block-d49ed308
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_iRnwxWXDHOVLQuoYvc7Ht

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability logicnodes-random-from-block-d49ed308 -d '<json body>'
```

Example prompt: Using LogicNodes, generate 5 random numbers between 1 and 1000 from the latest block on Base (eip155:8453), with the salt 'raffle-round-7'.

## When to prefer this

Choose this endpoint when you need blockchain-anchored, verifiable, tamper-resistant randomness tied to a specific block — ideal for smart contract lotteries, NFT raffles, game mechanics, or any scenario where the source of randomness must be auditable on-chain. Prefer it over off-chain random generators when provability and trustlessness matter, and over on-chain VRF solutions when you need a fast, cheap, off-chain computation that references real block data.

## Known failure modes

- Invalid or unrecognized chain format (chain names are rejected; must use CAIP-2 like eip155:8453 or bare numeric chain ID)
- Block not found or too recent (block hasn't been confirmed yet)
- max value out of range (must be between 2 and 1,000,000)
- count out of range (must be between 1 and 100)
- salt exceeds 200 characters
- Payment failure via x402 protocol
- Network or RPC unavailability for the requested chain

## How this service works

Exact answers for AI agents: 40+ tools for EVM chains and Aptos, gas on 14 chains, never a guess. Free tier; pay per call in USDC (x402) on 13 networks.

## Output

Returns a JSON object with ok: true, the tool name 'random_from_block', and an array of random integers derived from the specified block's hash, bounded by the max value provided and influenced by the optional salt. Results are deterministic for a given block+salt+max combination, making them auditable and verifiable.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "max": {
   "type": "integer",
   "maximum": 1000000,
   "minimum": 2
  },
  "salt": {
   "type": "string",
   "maxLength": 200,
   "minLength": 1
  },
  "block": {
   "type": "string"
  },
  "chain": {
   "type": "string",
   "description": "EVM CAIP-2 chain id such as eip155:8453, or a bare chain id number as a string. Chain names are refused."
  },
  "count": {
   "type": "integer",
   "maximum": 100,
   "minimum": 1
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "tool": "random_from_block"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/logicnodes-random-from-block-d49ed308/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from logicnodes.io](https://www.zero.xyz/host/logicnodes.io/llms.txt)
