MPP.Methods.XRPL.Session (mpp v0.17.0)

Copy Markdown View Source

XRPL session verification over native payment channels.

Implements draft-xrpl-session-00 at mpp-specs commit 213b098. Open submits a signed PaymentChannelCreate, then treats amount + signature as the first claim. Voucher and close are off-ledger claims over the cumulative drop total. The highest accepted claim (cumulative, signature, ledger PublicKey) is retained on MPP.Session.Channel.proof.

Close submits PaymentChannelClaim with tfClose unless defer_redemption is true, in which case redeem/2 submits later. The Destination (server) pays the claim transaction Fee from its own XRP; set destination_secret to that account's family seed.

Configure rpc_url (HTTPS) and network (mainnet / testnet / devnet). min_settle_delay defaults to 3600 seconds; closing_margin defaults to 3600 seconds of ledger close-time. The session store is namespaced by network so the same PayChannel ID on two ledgers cannot share a mark.

API Functions

FunctionArityDescriptionParam Kinds
redeem2Submit the stored highest PaymentChannelClaim for a channel.-
verify2Verify an XRPL session credential and update the channel store.-
challenge_method_details1Expose the draft's public session method details.-
validate_config!1Validate RPC, network and settle-delay configuration.-
credential_types0Session credentials are discriminated by action, not payload.type.-
method_name0Return the XRPL payment method identifier.-

Summary

Functions

Expose the draft's public session method details.

Session credentials are discriminated by action, not payload.type.

Return the XRPL payment method identifier.

Submit the highest retained claim as PaymentChannelClaim.

Validate RPC, network and settle-delay configuration.

Verify an XRPL session credential and update the channel store.

Functions

challenge_method_details(session)

@spec challenge_method_details(MPP.Method.intent()) :: map() | nil
@spec challenge_method_details(MPP.Intents.Session.t()) :: map()

Expose the draft's public session method details.

# descripex:contract
%{}

credential_types()

@spec credential_types() :: [String.t()]
@spec credential_types() :: [String.t()]

Session credentials are discriminated by action, not payload.type.

# descripex:contract
%{}

method_name()

@spec method_name() :: String.t()

Return the XRPL payment method identifier.

# descripex:contract
%{}

redeem(channel_id, config)

@spec redeem(String.t(), map()) :: {:ok, String.t()} | {:error, MPP.Errors.t()}

Submit the highest retained claim as PaymentChannelClaim.

Used automatically on close unless defer_redemption is true. The Destination pays the transaction Fee from its XRP balance.

validate_config!(config)

@spec validate_config!(map()) :: :ok
@spec validate_config!(map()) :: :ok

Validate RPC, network and settle-delay configuration.

# descripex:contract
%{}

verify(payload, session)

@spec verify(map(), MPP.Intents.Session.t()) ::
  {:ok, MPP.Receipt.t()} | {:error, MPP.Errors.t()}

Verify an XRPL session credential and update the channel store.

# descripex:contract
%{}