# Bitcoin nBits to Target and Difficulty Expander

> Bitcoin nBits to Target and Difficulty Expander is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Expands a Bitcoin block header nBits field into its full 256-bit target hash and corresponding mining difficulty value

## Facts

- Endpoint: POST https://twin.unykorn.org/btc-bits-to-target?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/bitcoin-nbits-to-target-and-difficulty-expander-ba3198d6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_tDxrDk3oXDlA6rAxybg5Z

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 bitcoin-nbits-to-target-and-difficulty-expander-ba3198d6 -d '<json body>'
```

Example prompt: Can you expand Bitcoin nBits value 0x1d00ffff into its full target and tell me the corresponding mining difficulty?

## When to prefer this

Use this endpoint when you need to programmatically decode Bitcoin's compact nBits format into its full target representation and numeric difficulty — particularly useful for building block explorers, mining software, proof-of-work validators, or any tool that needs to interpret raw Bitcoin block header data without implementing the decoding logic yourself.

## Known failure modes

- Invalid or malformed nBits hex string returns an error response
- nBits value outside valid Bitcoin range may produce unexpected results
- Payment failure or insufficient USDC balance prevents the call from completing
- Network timeout from the UnyKorn operator node

## How this service works

Expand Bitcoin nBits into a target and difficulty — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object with ok status, the decoded full 256-bit target value and computed mining difficulty derived from the provided nBits compact encoding, plus a payment receipt containing transaction hash, USD amount, and a Genesis402 receipt ID.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "bits": {
     "type": "string"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "btc-bits-to-target",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.002,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitcoin-nbits-to-target-and-difficulty-expander-ba3198d6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
