# Bitcoin Output Script Type Identifier

> Bitcoin Output Script Type Identifier 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).

Identifies and classifies the type of a Bitcoin output script from its hex-encoded bytecode

## Facts

- Endpoint: POST https://twin.unykorn.org/btc-script-type?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-output-script-type-identifier-b87d92a9
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_gl1BuPd9At8x5k0Sw_9ye

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-output-script-type-identifier-b87d92a9 -d '<json body>'
```

Example prompt: What type of Bitcoin output script is this: 0x76a914c0e2dfe3cba86c06e9c8fe7f8b1c3e9a1d2f4b788ac — is it P2PKH, P2SH, P2WPKH, or something else?

## When to prefer this

Choose this endpoint when you need to programmatically classify raw Bitcoin output scripts from their hex bytecode — for example when parsing raw transactions, auditing UTXOs, or building wallet software that must distinguish P2PKH, P2SH, P2WPKH, P2WSH, and P2TR script types. It is a pay-per-call micropayment API (x402 protocol, $0.002 USDC) suitable for agents that need on-demand script classification without running a full Bitcoin node.

## Known failure modes

- Invalid hex format (not 0x-prefixed or containing non-hex characters) — validation error
- Empty or malformed script bytes — classification may return unknown type
- Unrecognized or non-standard script patterns — may return a generic or null type
- Payment failure via x402 protocol — endpoint returns 402 before processing
- Network timeout on the UnyKorn operator node

## How this service works

Identify a Bitcoin output script — Genesis402 / UnyKorn Operator Network

## Output

Returns a JSON object containing a boolean `ok` field, a `type` field with the classified Bitcoin script type (e.g. P2PKH, P2SH, P2WPKH, P2WSH, P2TR), a `generated_at` ISO8601 timestamp, and a `receipt` object with the transaction hash, USD amount paid, and a unique receipt ID for the x402 micropayment.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "hex": {
     "type": "string",
     "pattern": "^0x[0-9a-fA-F]*$"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/bitcoin-output-script-type-identifier-b87d92a9/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)
