Segwit address decode

segwit-address-decode · version 1.0.0 · Encoding & checksums · free, no key needed

Decode a native segwit address into witness version, program hex, and script pubkey.

Use when you need to: decode native segwit address · segwit address to witness program · parse bech32 witness address.

Decide before calling

Read the versioned contract and the supported scope below. Reuse segwit-address-decode@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use segwit-address-decode@1.0.0 for decode native segwit address. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "address": "BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4",
  "expected_hrp": "bc"
}

Response:

{
  "result": {
    "normalized_address": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
    "hrp": "bc",
    "witness_version": 0,
    "program_hex": "751e76e8199196d454941c45d1b3a323f1433bd6",
    "encoding": "bech32",
    "script_pubkey_hex": "0014751e76e8199196d454941c45d1b3a323f1433bd6"
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "segwit-address-decode",
  "version": "1.0.0",
  "input": {
    "address": "BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4",
    "expected_hrp": "bc"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/segwit-address-decode/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"address":"BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4","expected_hrp":"bc"}'

The machine-readable contract is at /v1/tools/segwit-address-decode/versions/1.0.0.

CLI

node cli.mjs run segwit-address-decode 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.