| num_convertA | Convert a big-integer between bases (hex/dec/bin/oct). Parses value as a from_base integer (a leading 0x/0b/0o and a - sign
are accepted) and renders it in to_base, prefixed for non-decimal output.
pad_bytes zero-fills the output to that byte width (a minimum, never
truncating); it is bit-aligned, so it is rejected for decimal output.
Arbitrary precision — a 32-byte RPC value converts losslessly. |
| hashA | Compute a cryptographic, CRC, or fast non-crypto digest of bytes. length (output bytes) is required for shake_*; key keys blake2b/blake2s
(decoded with input_format); seed reseeds xxh*/fnv1a_*. CRC and fast
hashes additionally report their integer value as int.
|
| encodeA | Encode bytes/text into a string form (base-N, URL, IDNA, bech32, hexdump, bytes32). data is decoded to bytes via input_format (text|hex|base64). options
is a per-scheme dict: padding (bool, default true — base32/base64 family),
alphabet (custom symbol set — base58/base62), hrp (required for
bech32/bech32m), width (bytes per line — hexdump, default 16). idna and
bytes32 read data as a text string / short string respectively. bytes32 is
a fixed-width 32-byte EVM word: inputs of <32 bytes are right-padded with
0x00; decode returns all 32 bytes (it does NOT strip trailing nulls, so the
round-trip is lossless — rstrip them yourself for a short string).
|
| decodeA | Decode a base-N/URL/IDNA/bech32/hexdump string back to bytes or text. The inverse of encode over the same scheme set. The recovered bytes are
rendered per output_format (text=UTF-8 | hex=bare, no 0x | base64); pick
hex/base64 for binary payloads that are not valid UTF-8. options carries
alphabet for base58/base62. bech32/bech32m additionally return their hrp.
base58/base58check/base45/idna need the encoding extra. |
| data_uriA | Build a data: URI from a payload, or parse one into its parts (RFC 2397). action=build (needs data, read via input_format): wraps it as
data:[media_type][;base64],<payload>; base64=true base64-encodes the
payload, else it is percent-encoded. action=parse (needs uri): returns
media_type (defaulting to text/plain when absent), the ;k=v parameters,
is_base64, and the decoded data rendered via output_format. |
| bytes_editA | Edit a hex byte-buffer: pad/trim to width, slice, concat, size, or 0x-prefix. data is hex (a leading 0x is optional). Actions:
pad: widen to length bytes with the fill byte on side (left=prepend,
right=append); never truncates if already wider. trim: strip the fill byte (default 00) from side (left=leading,
right=trailing) — the inverse of pad. slice: take data[start:end] (Python indexing; negatives allowed). concat: append each hex buffer in parts to data. size: report the byte length, buffer unchanged. prefix: side=left adds a 0x prefix, side=right strips it.
Returns {action, result, size}: result is the 0x-prefixed hex buffer (bare
hex when prefix-stripping), size its byte length. |
| unicode_normalizeA | Normalize text to a Unicode normalization form (NFC/NFD/NFKC/NFKD). NFC/NFD are canonical compose/decompose; NFKC/NFKD also fold compatibility
characters (ligatures, full-width, circled digits) to their plain forms.
changed is true when result differs from the input — i.e. the text was
not already in form. |
| charset_transcodeA | Convert text between character encodings (e.g. latin-1/cp1252 <-> utf-8). The input is encoded under from_charset to recover its raw bytes, which are
then decoded under to_charset. If the bytes aren't valid to_charset text
they're returned as bare hex with output_format='hex' (otherwise 'text').
errors selects the codec error handler (strict|replace|ignore|…). |
| string_escapeA | Escape text for a source-code or markup context (JSON/JS/C/shell/HTML/...). style picks the convention: json|js|python|c|backslash (backslash escapes),
html|xml (entities), unicode_escape (\uXXXX/\xNN), quoted_printable, or
mime_word (=?UTF-8?B?...?=). shell yields a paste-safe single-quoted token.
For URL %-escaping use encode(scheme='url') instead. Inverse: string_unescape.
|
| string_unescapeA | Reverse a source-code or markup escaping back to the original text. Style-for-style inverse of string_escape (json|js|python|c|backslash escape
sequences, html|xml entities, unicode_escape, quoted_printable, mime_word,
and shell). Malformed escape sequences raise ValueError. |
| randomA | Generate cryptographically secure random bytes, a token, or a passphrase. All randomness is drawn from the OS CSPRNG (secrets). kind selects the
shape and which sizing arg applies: bytes|hex|urlsafe draw nbytes (default
32) random bytes — bytes renders them via output_format (hex/base64), hex
is the same bytes as hex, urlsafe is RFC 4648 url-safe base64; token is a
length-character (default 32) alphanumeric [A-Za-z0-9] string; passphrase
joins words (default 6) words with separator (default '-'), drawn from
wordlist or the bundled EFF large diceware list. Returns {kind, value,
entropy_bits}; the value is the only secret and is never logged elsewhere. |
| eth_hashB | Compute an Ethereum hash: raw keccak-256, EIP-191, or EIP-712 typed-data. |
| eth_selectorC | Derive the 4-byte function selector or 32-byte event topic from a signature. |
| rlp_codecA | RLP-encode structured data, or RLP-decode a hex string. Encode data is a recursive structure: a leaf (hex string, or a non-negative
integer stored minimal big-endian) or a JSON array of items (nested allowed);
a JSON-array string is parsed too. action=encode -> {encoded:'0x...'}.
Decode data is a 0x-hex string; action=decode -> {decoded} with leaves as
0x-hex and lists as arrays. |
| abi_codecA | ABI-encode values or ABI-decode call/return/log data. types is a list of ABI type strings (e.g. ["uint256", "address",
"(uint8,bytes)[]"]); aliases like uint/int/byte are normalized.
action=encode (needs values) -> {encoded, mode}. mode=packed is
abi.encodePacked (tight, no padding) and is encode-only. action=decode
(needs data, standard only) -> {values}; ints are returned as decimal
strings and addresses EIP-55 checksummed.
|
| eth_storage_slotA | Compute the storage slot for a mapping/array entry given a layout. layout: {"kind": "mapping"|"dynamic_array", "slot": , ...}
mapping -> needs key; "key_type" (default uint256). For nested
mappings pass key (and optionally "key_type") as lists.
dynamic_array -> needs index; optional "element_size" in slots (default 1).
Returns the slot both as a decimal string and a 0x 32-byte hex word. |
| eth_tx_codecA | Serialize signed tx fields into a raw transaction, or decode a raw tx. action=encode (needs fields) serializes the supplied, already-signed fields
(it does not sign) -> {type, raw:'0x...', hash}. fields is an object; the
type is taken from a type key or inferred from which fields are present
(maxFeePerGas -> 1559, blobVersionedHashes -> 4844, accessList -> 2930, else
legacy). Numbers accept int / decimal / 0x-hex; to/data are 0x-hex.
action=decode (needs data, a 0x-hex raw tx) -> {type, fields, hash, from},
recovering from from the signature; numeric fields come back as decimal
strings, addresses EIP-55 checksummed. |
| eth_address_caseC | Apply or verify an EIP-55 mixed-case address checksum. |
| infoA | Report mcp-bytesmith availability, version, and enabled toolsets. |