{"id":"bech32-validate","version":"1.0.0","description":"Check Bech32 or Bech32m text and return a reason, without throwing when the checksum fails.","supported_operations":["check whether bech32 text has a valid checksum","check whether bech32m text has a valid checksum","report a reason when bech32 text is rejected","detect mixed case without decoding symbols","bech32 validation of separator and hrp","bech32m validation of the 2bc830a3 constant","say if a checksummed string is empty or too short","validate bech32 text and keep going on a bad checksum"],"unsupported_operations":["return the 5-bit symbol array","repair an invalid checksum","decide bech32 versus bech32m from a witness version","convert between 8-bit bytes and 5-bit symbols"],"semantics":["Well-typed text that fails the format returns {valid:false, reason}. It throws only for a non-object, unknown or missing fields, a non-string, NaN, Infinity, a lone surrogate, or more than 90 characters.","reason is ok, empty, mixed_case, no_separator, empty_hrp, hrp_character, data_character, short_checksum, or bad_checksum. Checks run in that order after the length limit.","A valid string reports the lowercase HRP, data_length (checksum excluded), and variant. Polymod residue 1 is bech32 (BIP 173). Residue 0x2bc830a3 is bech32m (BIP 350).","All-uppercase is allowed and is not mixed case. An uppercase HRP whose checksum was computed without lowercasing fails as bad_checksum, matching BIP 173 vector A1G7SGD8.","Segwit program length, witness version, and padding of the converted program are not checked.","Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity."],"limits":{"max_text_chars":90},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","minLength":0,"maxLength":90}}},"output_schema":{"type":"object","additionalProperties":false,"required":["valid","reason","variant","hrp","data_length"],"properties":{"valid":{"type":"boolean"},"reason":{"type":"string","enum":["ok","empty","mixed_case","no_separator","empty_hrp","hrp_character","data_character","short_checksum","bad_checksum"]},"variant":{"type":["string","null"],"enum":["bech32","bech32m",null]},"hrp":{"type":"string","minLength":0,"maxLength":83,"pattern":"^[\\x21-\\x40\\x5b-\\x7e]*$"},"data_length":{"type":"integer","minimum":0,"maximum":82}}},"examples":[{"input":{"text":"a12uel5l"},"output":{"valid":true,"reason":"ok","variant":"bech32","hrp":"a","data_length":0}},{"input":{"text":"A1G7SGD8"},"output":{"valid":false,"reason":"bad_checksum","variant":null,"hrp":"","data_length":0}},{"input":{"text":"a1lqfn3a"},"output":{"valid":true,"reason":"ok","variant":"bech32m","hrp":"a","data_length":0}}],"execute_url":"/v1/tools/bech32-validate/versions/1.0.0/execute"}