> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Key management

> The borrower holds an EOA. The agent holds an Ed25519 workload key. SohoPay holds neither.

Two keys show up in a SohoPay payment, and they are not interchangeable. The borrower key authorizes the relationship. The agent key authorizes a single voucher. SohoPay's hardware-backed attestation key signs settlement batches and is not a key you manage. See [Settlement attestation](/protocol/settlement-attestation.md).

## Borrower EOA

The borrower signs three EIP-712 payloads in their own wallet:

* Wallet proof, during [onboarding](/guides/borrower-onboarding.md).
* `AgentAuthorizationGrant`, on the consent page, which sets the agent's limits.
* Repayment authorization, when they pay the facility down. See [ERC-3009](/protocol/erc-3009.md).

Stop and get explicit consent before asking the borrower to sign. Never ask them to paste a seed phrase, a private key, or a raw signature JSON into chat.

## Agent workload key

Install [`@sohopay/agent-signer`](/sdks/agent-signer). Call `generateWorkloadKey()` once per terminal and persist the private key on the host. Register the public key with `register_agent_workload_key` using `signPoP`.

On `VOUCHER_ISSUED`, call `signVoucher` with the unsigned voucher and the `signing` block from the prepare response, then `buildPaymentSignatureHeader`. The library checks the payment id and the key thumbprint before it signs. It rejects a JWK that contains private material.

> [!WARNING]
>
> The workload key can spend up to the active grant. Protect it like a payment credential. It cannot sign a wallet proof, a grant, or a repayment.

## Rotation and revoke

`rotate_agent_key` needs the `agent:key:register` scope. `revoke_agent` needs `agent:revoke` and an EOA signature from the borrower. Revoke when a host is lost. A revoked agent cannot spend until the borrower authorizes a replacement.

## What SohoPay does not do

SohoPay does not generate an agent wallet inside an MPC ceremony, and it does not co-sign the voucher. If a prepare response says signing is disabled or custodial signing is unavailable, stop. There is no fallback where SohoPay signs for the agent.

## Next steps

> [card] [Agent signer](/sdks/agent-signer.md)
>
> The functions you call.

> [card] [EIP-712](/protocol/eip-712.md)
>
> What the borrower signs.
