Credit providers and MPP channel profiles
The runtime uses two policy models to decide how a merchant can receive and charge payments. Credit-provider policy selects approved provider adapters before payment options are shown. MPP channel profiles select a compatible channel deployment and require explicit trust for any hook actions that can affect a charge.
Credit provider policy
Credit-provider policy is a merchant-wide setting. It is separate from payment intents and session settings, so the selected provider applies as part of the operator's available payment setup.
Provider selection
An operator names the credit providers that the runtime may use. The model currently accepts the supported Coinflow provider and treats an omitted list as no credit-provider selection. Unknown names fail during configuration parsing instead of becoming an unreviewed payment option.
The runtime keeps provider selection beside other operator payment policy, such as supported currencies. A provider name alone does not approve the provider adapter; the adapter must also pass the SDK's provider validation before the runtime advertises payment options.
References: rust/…/credit_provider.rs• L1-16 rust/…/credit_provider.rs• L22-55
Provider validation
Validation converts the configured provider names to the SDK provider types and checks them as one operator policy. A failed check becomes a configuration error, which prevents the runtime from starting or exposing an invalid provider choice.
This boundary keeps provider support explicit. Existing configurations remain valid when they do not contain a provider list, while new provider names need both model support and adapter review.
References: rust/…/credit_provider.rs• L6-16 rust/…/credit_provider.rs• L34-55
MPP channel profiles
An MPP channel profile describes the Solana payment-channel deployment that a server is willing to use. The profile combines a channel program, an optional version, and optional hook instructions; together these values determine channel compatibility and the trust policy for channel-backed charges.
Server profile
The server profile is an explicit opt-in policy. Without an explicit version, the runtime uses the default deployment and does not enable V2 channel-backed charges. An explicit program or version must resolve to a valid deployment, and an explicit hook descriptor is valid only with version 2.
The server owns the channel through its operator transaction signer, while the merchant remains the payout recipient. Therefore, selecting V2 without an operator signer is a configuration error rather than a fallback to native charging.
References: rust/…/mpp_channel_profile.rs• L15-52 rust/…/mpp_channel_profile.rs• L55-70 rust/…/mpp_channel_profile.rs• L220-242
Charge mode
The selected profile shapes how the runtime creates an MPP charge. A valid V2 profile enables channel-backed charges and uses the configured hooks. Any other profile keeps native charge behavior, so native charges do not consult the channel-hook trust policy.
The same charge choice is used when the runtime creates a challenge and when it rebuilds route pricing during verification. This keeps the amount and charge mode aligned across the request lifecycle.
flowchart LR
P[Server channel profile] --> V{Explicit valid V2?}
V -- No --> N[Native MPP charge]
V -- Yes --> S{Operator signer present?}
S -- No --> E[Configuration error]
S -- Yes --> C[Channel-backed MPP charge]
C --> H[Configured hook policy]
References: rust/…/mpp_channel_profile.rs• L55-85 rust/…/mpp_channel_profile.rs• L122-146
Remote profile trust
Before wallet access, the runtime checks the channel details supplied by the remote request. It resolves the program, version, hooks, and network as one deployment descriptor. This prevents a valid program identifier from being used with an incompatible version or network.
Hook actions need a stronger match than program compatibility. The remote hook descriptor must be valid for V2 and must exactly equal the locally trusted descriptor, including its arguments and account permissions. Even an empty descriptor needs explicit approval on the channel-backed charge path.
References: rust/…/mpp_channel_profile.rs• L87-120 rust/…/mpp_channel_profile.rs• L148-187 rust/…/mpp_channel_profile.rs• L245-267
Runtime relationships
Credit-provider policy controls which external credit path may be advertised. MPP channel policy controls whether a charge uses native payment behavior or a versioned channel deployment. The two policies are independent, but both reject unsupported or unapproved choices before they can shape a payment flow.
For the broader runtime flow, see Rust payment runtime. Session creation and metering use the channel charge mode described in runtime session channels and metering, while gateway and worker boundaries are covered in runtime payment gateway and runtime API and workers.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the provider model, SDK adapter mapping, and pre-advertisement validation in sync.
- Keep the default channel deployment, accepted version rules, and charge-mode selection aligned.
- Keep server-side channel descriptors and remote challenge descriptors compatible with the same network rules.
- Treat hook descriptor changes as trust-policy changes. Update the local approval path with the profile that remote requests must match.
- Preserve the distinction between native charges and channel-backed charges so native requests do not inherit channel-hook checks.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| An unknown credit provider name is configured | Operator configuration is rejected | Parse only supported provider values |
| The SDK rejects a selected provider adapter | Payment options are not advertised | Validate providers before advertisement |
| A channel program or version does not resolve for the deployment | Server or remote MPP validation fails | Resolve the full deployment before use |
| Hooks are supplied without V2 | Profile or request is rejected | Require version 2 for hook descriptors |
| A channel-backed charge has no operator signer | Charge setup fails instead of silently falling back | Require the signer for V2 channel charges |
| Remote hooks differ from the trusted descriptor | Wallet access or the charge challenge is rejected | Require exact local hook approval |
Key files
| File | Why to read it |
|---|---|
| rust/…/credit_provider.rs | Defines merchant-wide provider selection and validation before payment options are advertised. |
| rust/…/mpp_channel_profile.rs | Defines channel deployment selection, V2 charge enablement, remote profile checks, and hook trust. |
| rust/…/mpp_channel_profile.rs• L55-85 | Shows how the selected profile changes MPP charge mode while preserving native behavior. |
| rust/…/mpp_channel_profile.rs• L87-187 | Shows the compatibility and exact-trust checks applied to remote channel profiles. |