portal402
design and whitepaperagent interoperability · solana · wormhole · ipfs
- problem
- Autonomous AI agents are tied to the blockchain or runtime they were built on. Moving one somewhere else means rebuilding it, with no way to prove the copy behaves like the original.
- what i designed
- Portal402, a layer for porting x402 agents between blockchains and off-chain systems. Signed adapters describe how an agent's actions translate, an on-chain registry verifies them, and every port runs through a lifecycle that leaves an auditable checkpoint at each stage.
- status
- It is at the design stage. The architecture, lifecycle, roles and threat model are written up in a whitepaper on the project's website. The prototype isn't built yet.
design walkthrough
- submit_adapter(agent_7f3a, adapter, sig)
- 202 · INIT recorded
- verify(hash, sig, builder_pubkey)
- VERIFIED · entry #0042, CID
- send_payload(CID, metadata)
- deliver_payload
- ACK
- sign_tx(agent_7f3a, adapter #0042) · ACTIVATE
- activation_confirmed(tx_hash)
- log_success()
- SUCCESS · proof hash e41d…07ac
a second port, with a forged adapter
- submit_adapter(agent_9b21, adapter, sig)
- verify(…) · signature mismatch
- REJECTED · nothing ported
Rejected at VERIFY. The adapter's signature doesn't match its builder's key, so nothing was ported.
how it works
- INIT. A builder submits an adapter for an agent, and the request is recorded with its hash.
- VERIFY. The registry checks the adapter's hash and the builder's signature.
- if it's invalid. The port is rejected before anything moves.
- REPLICATE. The agent's metadata and context are serialised and sent to the target chain over Wormhole.
- if the bridge times out. The port rolls back.
- ACTIVATE. The user signs the activation transaction and the adapter's mappings are applied.
- if a mapping fails. The activation reverts and the failure is logged.
- SUCCESS. The outcome is logged with a proof hash, so the whole port can be replayed and checked.
example adapter
# example adapter: agent_7f3a, Solana -> Ethereum
schema_version: 1
agent: agent_7f3a
source: { chain: solana, runtime: x402 }
target: { chain: ethereum, runtime: x402 }
# $values come from the x402 payment request; unlisted actions carry over as-is
mappings:
- action: pay_for_request
from: spl_token.transfer
to: erc20.transfer
args:
amount: $maxAmountRequired
recipient: $payTo
asset: # USDC lives at a different address on each chain
from: EPjF…Dt1v
to: 0xA0b8…eB48
- action: verify_result
from: payai.verify_task
to: portal402.verify_task
state:
carry: [memory_cid, reputation, open_tasks]
reset: [nonce]
builder:
pubkey: 7xKqF2…r9Wm
signature: 3fA1…c0d2 # over the canonical JSON of everything above
technical breakdown
what gets ported
Portal402 moves an agent's behaviour between chains: what it does, its state and its identity. A cross-chain bridge moves only tokens. An agent on Solana and its copy on Ethereum should be provably the same agent, which today's agent frameworks have no shared way to show.
the parts
- Portal Adapters. Declarative JSON or YAML files that map an agent's actions in one environment to equivalent functions in another. Each carries the builder's public key, a schema version and a signature, and is stored on IPFS so it can't change after the fact.
- Adapter Registry. An on-chain catalogue of verified adapters, holding each one's hash, version and signature. Submissions are checked before they're listed, which keeps out duplicates and tampered files.
- Wormhole. Carries adapter payloads and proofs between chains, for example from Solana to Ethereum, without the protocol holding anyone's funds.
- IPFS. Stores adapters and metadata. The registry refers to each one by its content ID.
- libp2p. Peer-to-peer messaging for discovery, telemetry and keeping state in sync, with no central server.
who does what
- Builders write adapters.
- Users choose an agent and an adapter, start a port and sign the activation from their own wallet.
- Operators run the nodes that verify ports and relay them between chains.
threat model
| threat | defence |
|---|---|
| Forged or malicious adapters | Builder signature check and an on-chain hash |
| Replayed or impersonated requests | A nonce that increases with every verification |
| A bridge transfer that stalls part-way | Delivery acknowledgements and a 60-second timeout rollback |
| An adapter changed after it was approved | IPFS content addressing; the registry must match the stored content ID |
| Someone else's key used to activate | Activation is a transaction the user signs in their own wallet |
design principles
- The protocol never holds keys or funds.
- Any node can replay the proofs and reach the same answer.
- Adapters, which follow a fixed schema, decide how an agent adapts; there is no per-agent custom code.
- Every stage is logged on-chain for auditing.
builds on
Portal402 extends x402, a standard for agents to authenticate, route tasks and verify results, as used in the PayAI agent ecosystem on Solana. x402 assumes agents share one runtime and network; Portal402 adds the layer that lets them leave it.
stack
- Solana
- Ethereum
- Wormhole
- IPFS
- libp2p
- x402
- Next.js (project website)
status
It is at the design stage. I designed the architecture and wrote it up as a whitepaper, published on a project website I built. The next phase is a working prototype: an adapter registry on Solana's test network and a CLI for submitting adapters and porting agents. None of that is built yet, which is why the demo above is a walkthrough of the design.
more projects
knowledge base search
in daily usequoting automation
built, not rolled outai customer support agent
live on the client sitesecure web search
red-teaming in progressan AI-ready knowledge base
300+ articles