{"uid":"cap_jWb71ntgJXC353bemRqEu","slug":"pad-hex-to-fixed-byte-width-37960266","name":"Pad Hex to Fixed Byte Width","description":"Pad hex to a fixed byte width — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/eth-pad-hex?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"hex":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"},"size":{"type":"integer","minimum":0},"direction":{"type":"string"}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"eth-pad-hex","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.001,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_Jdqo8Thmd29okwyYrOFJQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Pads a hex string to a specified fixed byte width, with configurable direction, useful for EVM data encoding tasks.","exampleAgentPrompt":"Pad the hex value 0x1a2b to 32 bytes with left padding so I can use it in an Ethereum ABI-encoded calldata field.","exampleUseCases":[{"title":"ABI calldata hex normalization","prompt":"I need to pad 0xff to exactly 32 bytes on the left side so it fits as a uint256 in an Ethereum ABI-encoded function call."},{"title":"EVM memory word alignment","prompt":"Can you right-pad the hex string 0xdeadbeef to 16 bytes? I'm constructing raw EVM memory data and it needs to fill a full word."},{"title":"Smart contract parameter formatting","prompt":"Take this hex value 0x4e20 and pad it to 8 bytes using left padding — I'm preparing parameters for a low-level smart contract interaction."}],"resultDescription":"Returns a JSON object with ok:true, the type field 'eth-pad-hex', the padded hex result, a payment receipt including transaction hash, USD amount, and a receipt ID, plus an ISO8601 timestamp of when it was generated.","failureModes":["Invalid hex string (not matching ^0x[0-9a-fA-F]*$) returns a validation error","Size value less than 0 is rejected","Unrecognized direction value may cause an error or default behavior","Payment failure (x402) results in 402 response before processing","Network or server errors return non-200 HTTP status"],"whenToPreferThis":"Choose this endpoint when you need a reliable, pay-per-call utility to pad hex strings to exact byte widths for EVM/Ethereum data encoding, especially within an agent workflow that already uses the UnyKorn/Genesis402 x402 operator network for other blockchain utility calls. Prefer it over hand-rolling padding logic when you want a consistent, auditable result with a payment receipt.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:29.593Z","isFirstParty":false,"canonicalSlug":"pad-hex-to-fixed-byte-width-37960266"}