Agents
Post-quantum agents
An ordinary agent signs with an ECDSA key. A post-quantum agent is a small contract that acts in the Gate for its key holder and accepts only HSS signatures, the same hash-based scheme as the post-quantum lock. The owner plugs its address in like any agent, with the same adapters, markets and caps.
How it acts
Each agent is a MortiseQuantumAgent made by 0x063fA59C6B6938d6e2Acf07BAED9c5D644A05131. The agent signs one call with its key: the chain, the agent, a deadline, the gas the Gate gets and the relayer allowed to send it are all in what it signs. A relayer account sends the transaction and pays its gas; it cannot change the call, and the Gate checks the call as for any agent. A call the Gate refuses still uses its signature number, so a refused call cannot be replayed.
| Key | Lives | Can |
|---|---|---|
| Agent phrase (HSS) | agent.phrase on the agent's machine, mode 600 | Sign the agent's calls, inside the owner's limits |
| Relayer key (ECDSA) | relayer.key on the same machine, mode 600 | Send signed calls and pay their gas; nothing in the vault |
| Index record | The hss directory, never copied | Make sure no signature number is used twice |
Make its keys
On the machine the agent runs on:
npx -y @mortiseagentvault/[email protected] quantum-new ~/.mortiseIt writes a new phrase and relayer key, both readable by you only, and an empty index directory, then prints the agent's address and the relayer's. It never replaces files that exist and never prints the phrase. Copy the phrase to an offline backup, send the relayer a little ETH, and give the agent's address to the vault's owner to plug in.
Run it over MCP
The first start creates the agent contract, with the relayer paying. From then on the agent's tools are the same as an ordinary agent's.
{
"mcpServers": {
"mortise": {
"command": "npx",
"args": ["-y", "@mortiseagentvault/[email protected]"],
"env": {
"MORTISE_VAULT": "0xYourVault",
"MORTISE_QUANTUM_PHRASE_FILE": "/home/you/.mortise/agent.phrase",
"MORTISE_QUANTUM_STATE_DIR": "/home/you/.mortise/hss",
"MORTISE_RELAYER_KEY_FILE": "/home/you/.mortise/relayer.key"
}
}
}
}Another machine
To run the agent elsewhere from its phrase, start the server once with MORTISE_QUANTUM_RESTORE=1. The relayer funds one small transaction from the phrase's restore counter, and the new machine signs from a range no earlier machine can reach. From then on only that machine signs: any machine set up before it stops until it restores again. Remove the variable after that start. The same start gets an agent past 64 signed calls that never reached the chain.