{"uid":"cap_a3ePocZ4Vvas3uqkNYJk_","slug":"solidity-abi-encodepacked-equivalent-8c5d5516","name":"Solidity abi.encodePacked Equivalent","description":"Solidity abi.encodePacked equivalent — Genesis402 / UnyKorn Operator Network","url":"https://twin.unykorn.org/encode-packed?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"params":{"type":"object","properties":{"types":{},"values":{}}}}},"responseSchema":{"type":"json","example":{"ok":true,"type":"encode-packed","receipt":{"tx_hash":"0x<64hex>","amount_usd":0.002,"receipt_id":"g402-<16hex>"},"generated_at":"<iso8601>"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_H4_XNw_NL60xmClchnDVv","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Encodes typed Solidity values using abi.encodePacked (tight, non-padded ABI encoding), returning the packed hex result along with a payment receipt.","exampleAgentPrompt":"Can you do an abi.encodePacked on types ['address','uint256'] with values ['0xAbCd...1234', 1000000000000000000] for me? I need the packed hex output to compute a keccak256 hash off-chain.","exampleUseCases":[{"title":"Off-chain keccak256 leaf for Merkle tree","prompt":"I'm building a Merkle tree for an airdrop and need abi.encodePacked on types ['address','uint256'] with values ['0xDeadBeef00000000000000000000000000000001', 500] so I can hash the leaf node off-chain."},{"title":"Signature payload for EIP-191 verification","prompt":"Help me pack the values for a signed message — types are ['bytes32','address','uint256'] and values are ['0xabc...def', '0x1234...5678', 42] — I need the packed encoding to feed into my signing script."},{"title":"Reproduce Solidity hash from backend","prompt":"My smart contract does keccak256(abi.encodePacked(uint8, address, bytes32)) — can you run encodePacked for me with types ['uint8','address','bytes32'] and values [1, '0xDead000000000000000000000000000000000001', '0xcafe...'] so I can verify the hash matches on the backend?"}],"resultDescription":"Returns a JSON object with ok:true, the encoding type label 'encode-packed', the packed hex string result, and a payment receipt containing a transaction hash, amount in USD, and a unique receipt ID.","failureModes":["Mismatched types and values array lengths return an error","Invalid Solidity type strings (e.g. typos like 'uint257') cause encoding failure","Values incompatible with their declared types (e.g. passing a string for bytes32) may cause errors","Network or payment processing failure results in no receipt returned","Oversized or deeply nested inputs may time out"],"whenToPreferThis":"Use this endpoint when you need Solidity-compatible abi.encodePacked (tight, non-padded encoding) outside of the EVM — such as computing keccak256 hashes off-chain, verifying on-chain signatures, or building Merkle tree leaves. Prefer this over a full abi.encode when you specifically need packed (no padding) encoding, which is what Solidity's abi.encodePacked produces. It is part of the UnyKorn operator network and charges a small USDC microfee per call, making it suitable for pay-per-use agent workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T18:55:45.841Z","isFirstParty":false,"canonicalSlug":"solidity-abi-encodepacked-equivalent-8c5d5516"}