Segwit address encode

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

Encode a witness program as a native segwit address using Bech32 for v0 and Bech32m for v1-v16.

Use when you need to: encode native segwit address · witness program to bech32 address · witness program to bech32m address.

Decide before calling

Read the versioned contract and the supported scope below. Reuse segwit-address-encode@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-encode@1.0.0 for encode 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:

{
  "hrp": "bc",
  "witness_version": 0,
  "program_hex": "751e76e8199196d454941c45d1b3a323f1433bd6"
}

Response:

{
  "result": {
    "address": "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
    "encoding": "bech32",
    "script_pubkey_hex": "0014751e76e8199196d454941c45d1b3a323f1433bd6"
  }
}

How to call it

MCP

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

{
  "id": "segwit-address-encode",
  "version": "1.0.0",
  "input": {
    "hrp": "bc",
    "witness_version": 0,
    "program_hex": "751e76e8199196d454941c45d1b3a323f1433bd6"
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/segwit-address-encode/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"hrp":"bc","witness_version":0,"program_hex":"751e76e8199196d454941c45d1b3a323f1433bd6"}'

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

CLI

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

Get the client at /clients/cli/.