Remote identity providers
Remote identity providers let the payment runtime use wallets whose signing keys stay outside the local process. The runtime discovers a usable wallet, binds it to a local account, and gives payment flows the same signer boundary used by local identities. The current registry includes Ledger hardware wallets, Privy, Pay Connect, and Openfort.
Integration boundary
The remote identity boundary separates wallet custody from account choice and payment work. A provider declares the credentials or device access it needs, lists wallets it can use, and connects one wallet to a signer. The rest of the runtime uses the shared result instead of provider-specific calls.
The boundary covers these responsibilities:
- collect and validate provider credentials when a provider needs them;
- discover wallets that the credentials or device can sign for;
- connect one wallet and resolve its public address;
- return a signer that payment flows can use without receiving private-key bytes.
Credentialed providers keep their credentials in the platform secret store. The account record keeps the provider id, provider wallet id, and expected public address. Ledger keeps no credential blob because the device itself supplies signing authority. This lets remote and local identities use the same account and payment model.
Provider registry
The provider registry is the runtime lookup point for supported remote backends. Each backend has a stable id that setup stores in the account record and later uses to select the provider contract.
The registry currently exposes payconnect, openfort, and privy, plus ledger when the Ledger feature is enabled. A new provider must supply the same discovery and connection behavior. Account selection, credential handling, and signer use remain shared.
References: rust/…/mod.rs• L31-35 rust/…/mod.rs• L48-69 rust/…/mod.rs• L236-249
Credential boundary
The credential boundary protects the local side of a remote connection. The runtime loads a provider credential record through the account's approval policy before it asks a credentialed provider to connect.
These credentials authorize provider requests. They are not a copy of the wallet key. Missing or damaged credentials stop account resolution before signing. Ledger follows a different path because its key stays on the attached device and nothing is stored locally for the provider.
References: rust/…/mod.rs• L72-86 rust/…/mod.rs• L89-117 rust/…/mod.rs• L120-153 rust/…/mod.rs• L195-201
Provider discovery
Provider discovery changes credentials or device access into a list of wallets that the runtime can use. Each result has a provider wallet id and a Solana address. Setup can therefore offer a real wallet choice and verify the identity that will sign later payments.
Setup accepts credential values from protected files or provider environment variables. It can also ask for missing values through masked prompts. The provider may be queried as soon as it has enough information to list wallets. One wallet is selected automatically, several wallets require a choice, and no wallets produces provider guidance instead of a new local wallet.
This diagram shows how setup turns provider access into a bound payment identity.
flowchart LR
I[Credential files, environment, or prompts] --> V[Credential validation]
V --> D[Provider or device discovery]
D --> C{Usable wallets}
C -->|one| S[Select wallet]
C -->|many| P[Operator choice]
C -->|none| E[Provider guidance]
S --> A[Connect and resolve address]
P --> A
A --> K[Store account binding]
Setup resolves the wallet address before it saves the account. Credentialed providers then store their credential blob. Hardware providers save only the device-backed account binding.
Account binding
Account binding turns the selected provider wallet into a local payment identity without copying its key. The account is written only after the selected wallet connects and its address is known.
| Account value | Role |
|---|---|
keystore: remote | Selects provider-backed or hardware signing. |
provider | Names the registered backend. |
account | Identifies the provider wallet or Ledger derivation path. |
pubkey | Caches the expected Solana address for display and later checks. |
References: rust/…/new.rs• L279-337 rust/…/new.rs• L340-457 rust/…/new.rs• L934-973 rust/…/accounts.rs• L107-148
Ledger hardware-wallet operations
Ledger is a hardware identity provider. The private key stays on the device, and the runtime uses a Solana derivation path as the wallet id. Each transaction requires confirmation on the device.
Ledger discovery reads the supported Solana derivation paths and returns the paths that the connected device can answer. Interactive setup waits for a device to be attached and unlocked. Runtime resolution can use a bounded wait in foreground flows, while non-interactive callers fail without an unbounded device wait.
Ledger accounts have no provider credentials to load or delete. Destroying the account removes the local account binding but does not affect the key on the device.
Ledger signing limits
Ledger can sign supported transactions but cannot export the key. Its message signature is an off-chain envelope rather than a raw signature over the supplied bytes. Payment paths that need raw message proofs must reject the Ledger identity, and transaction negotiation is capped at version 0.
References: rust/…/ledger.rs• L1-19 rust/…/ledger.rs• L123-155 rust/…/ledger.rs• L157-275 rust/…/mod.rs• L421-461 rust/…/destroy.rs• L138-154
Privy wallet operations
Privy provides remote Solana wallets held in its custody service. The runtime uses the Privy app credentials and authorization key to discover wallets, connect the selected wallet, and request policy-checked signatures. Private key material remains in Privy's enclave.
Privy discovery lists the app's Solana wallets. Setup uses the returned wallet id and address to create a stable account binding. The authorization key allows the runtime to act as a signer for wallets where the Privy policy grants that authority.
Privy signing
Privy signing connects the selected wallet to a provider-backed Solana signer. The provider checks its wallet policy for each signing request, while the runtime checks that the connected wallet still matches the address stored in the account.
Privy supports raw message signatures and transaction signing through the common signer interface. Payment code therefore does not need a separate Privy path.
References: rust/…/privy.rs• L1-18 rust/…/privy.rs• L46-95 rust/…/privy.rs• L122-222
Pay Connect wallet operations
Pay Connect provides a tenant-scoped remote wallet service for the payment runtime. Its API token gives the runtime access to wallet records and provider signing. The private key remains with Pay Connect.
Pay Connect discovery returns the wallets available to the token. Setup binds one returned wallet id and address to the local account. Connection checks that the selected wallet is still visible and then creates a signer for later message and transaction operations.
Pay Connect signing
Pay Connect sends message and transaction signing requests to the selected wallet service. The runtime verifies the returned signature and checks that a returned transaction keeps the original message. This protects the common signer boundary from an invalid or changed provider response.
Pay Connect supports raw message signatures and transaction signing. Provider approval remains outside payment flow code, which receives only the shared signer result.
References: rust/…/payconnect.rs• L21-60 rust/…/payconnect.rs• L96-144 rust/…/payconnect.rs• L181-265
Signer resolution
Signer resolution joins a selected account to its backend at payment time. For a remote account, the runtime reads the provider and wallet id, loads credentials when needed, connects the wallet, and checks its current address against the cached identity.
After resolution, local and remote identities are interchangeable. MPP, x402, sessions, and other payment paths receive a ResolvedSigner that can expose a public key and produce the signatures that the selected backend supports.
This diagram shows the path from account choice to a payment-ready signer.
sequenceDiagram
participant F as Payment flow
participant R as Signer resolver
participant A as Account registry
participant K as Credential source
participant P as Provider or device
F->>R: Resolve account for network
R->>A: Read provider, wallet id, cached address
R->>K: Load credentials when required
R->>P: Connect selected wallet
P-->>R: Signer and current public address
R->>R: Compare current and cached address
R-->>F: Common payment signer
Remote connection is synchronous and can perform network or device I/O. Async callers must isolate it from their async worker with a blocking boundary.
Network identity
Remote signers can serve more than one Solana network because they sign bytes without holding local chain state. If a named remote account has no entry on a non-mainnet network, the runtime can reuse the same-named remote account from mainnet.
Mainnet still needs an explicit account. The fallback changes account lookup only. It does not bypass credential approval or the provider address check.
Identity mismatch handling
The cached public address guards the account identity. If the provider wallet now resolves to another address, the runtime stops before signing and asks the operator to reconnect. This covers wallet replacement, credential changes, and a provider project mismatch.
When a credentialed connection fails, the runtime can repeat discovery with the same credentials. The result can distinguish rejected credentials, no usable wallet, and a selected wallet that those credentials cannot see.
References: rust/…/mod.rs• L318-361 rust/…/mod.rs• L363-477 rust/…/mod.rs• L479-538 rust/…/signer.rs• L26-132 rust/…/signer.rs• L227-374 rust/…/signer.rs• L537-614
Local and remote identities
Local and remote identities share account selection and payment interfaces. They differ in where signing authority lives and how approval happens at use time.
| Identity type | Secret authority | Runtime result | Typical use |
|---|---|---|---|
| Local keypair | Local platform store or file | In-memory signer | User-controlled payment account |
| Ephemeral account | Local account record for a temporary network | In-memory signer | Local and test payments |
| Remote account | Provider custody | Provider-backed signer | Payment wallet with remote policy control |
| Ledger account | Attached hardware device | Hardware-backed signer | Device-confirmed payments |
The common signer abstraction is the key seam. Payment code selects an account by network and name, then asks the resolved signer for a supported signature without branching on custody type. Remote and Ledger identities cannot be exported as local keypair bytes.
See the runtime overview for the wider account and payment model. See cloud payment onboarding for the hosted setup context.
References: rust/…/mod.rs• L37-80 rust/…/signer.rs• L26-42 rust/…/signer.rs• L69-95 rust/…/signer.rs• L463-515
Change checklist
When these files or sections are changed, remember to consider these:
- Keep provider ids aligned across the registry, account records, setup backend choices, and provider credential names.
- Keep discovery filters aligned with each provider's signing capability so setup cannot select a wallet that later fails to sign.
- Keep the account binding rules aligned with credentialed providers and credential-less hardware providers.
- Keep the cached
pubkeycheck aligned with wallet replacement and credential rotation behavior. - Keep network fallback limited to remote identities so local keys are not silently reused on another network.
- Keep blocking provider and device resolution outside async workers.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Remote account has no provider id or names an unregistered provider | Account resolution cannot select a signer. | Validate the account against the provider registry. |
| Credentialed provider credentials are missing, damaged, rotated, or revoked | Resolution stops before a signing request. | Reconnect the account and replace its credential record. |
| Provider cannot see the configured wallet id | Connection fails even when the credential itself is valid. | Run discovery and compare the configured id with the returned wallets. |
| Provider wallet resolves to a different address | The runtime rejects the account before signing. | Reconnect the account so its cached pubkey matches the selected wallet. |
| Ledger is absent, locked, busy, or uses an unsupported app configuration | Discovery or signing cannot start. | Attach and unlock the device, or update the compatible Ledger software. |
| Ledger is used for a raw-message proof or a version-1 transaction | The payment path cannot use the hardware signer. | Select a provider or local identity that supports raw messages and the required transaction version. |
| Remote signer resolution runs on an async worker | Blocking provider I/O delays other async work. | Use a blocking task boundary for synchronous resolution. |
Key files
| File | Why to read it |
|---|---|
| rust/…/mod.rs | Defines the provider contract, registry, credential source, account binding, and remote signer resolution. |
| rust/…/ledger.rs | Shows hardware-wallet discovery, device approval, derivation-path identity, and Ledger limits. |
| rust/…/privy.rs | Shows Privy wallet discovery and provider-backed signing. |
| rust/…/payconnect.rs | Shows Pay Connect wallet discovery and response-checked signing. |
| rust/…/openfort.rs | Shows another credentialed provider and the filtering needed to expose only signable Solana wallets. |
| rust/…/accounts.rs | Defines how remote and hardware identities are represented beside local accounts. |
| rust/…/signer.rs | Shows network-aware account selection and the common signer used by payment flows. |
| rust/…/mod.rs | Defines custody, approval, export, raw-message, and transaction-version capabilities. |
| rust/…/new.rs | Shows setup input, discovery, wallet choice, address verification, and persistence order. |
| rust/…/destroy.rs | Shows how credentialed remote accounts, hardware accounts, and local account records are removed. |
| rust/…/lib.rs | Shows the public runtime module boundary that exposes accounts, remote providers, and signers. |