# Solidity abi.encodePacked Equivalent

> Solidity abi.encodePacked Equivalent is a paid API for AI agents from twin.unykorn.org, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-01).

Encodes typed Solidity values using abi.encodePacked (tight, non-padded ABI encoding), returning the packed hex result along with a payment receipt.

## Facts

- Endpoint: POST https://twin.unykorn.org/encode-packed?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/solidity-abi-encodepacked-equivalent-8c5d5516
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_a3ePocZ4Vvas3uqkNYJk_

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability solidity-abi-encodepacked-equivalent-8c5d5516 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Solidity abi.encodePacked equivalent — Genesis402 / UnyKorn Operator Network

## Output

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.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "params": {
   "type": "object",
   "properties": {
    "types": {},
    "values": {}
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "type": "encode-packed",
  "receipt": {
   "tx_hash": "0x<64hex>",
   "amount_usd": 0.002,
   "receipt_id": "g402-<16hex>"
  },
  "generated_at": "<iso8601>"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/solidity-abi-encodepacked-equivalent-8c5d5516/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from twin.unykorn.org](https://www.zero.xyz/host/twin.unykorn.org/llms.txt)
