Skip to main content

FPSF-SS-001 — Reference

Layer: Reference · Audience: developers (daily reference) For normative requirements, see the Formal Specification.


Glossary

TermDefinition
AcquirerA registered third-party participant entitled to a share of the processing fee on payments they referred. Identified on-chain by an Acquirer ID.
Acquirer IDA 16-byte (bytes16) UUID identifying a registered Acquirer within the Settlement Contract.
Acquiring FeeA percentage-based fee charged on behalf of a registered Acquirer. Applied only when the payment includes a non-zero Acquirer ID. Per-token.
AdministratorThe privileged account that controls Settlement Contract operational parameters. MUST NOT have the ability to move user funds.
Base FeeThe absolute minimum fee component of the Operator Fee, charged on every transfer, in token units. Per-token.
Basis Points FeeThe percentage component of the Operator Fee, expressed in basis points of the principal. Per-token.
Binding SignatureAn EIP-712 signature over the full operation parameters, authorizing the processor to submit the operation. Field name: payWithPermitSig.
Broadcast LayerThe off-chain subsystem receiving, validating, queuing, and broadcasting signed payment payloads.
ChargeA processor-issued record representing an expected payment.
Checkout EngineThe merchant-facing subsystem managing payment session lifecycle.
Client WalletA conformant application that constructs and submits signed payment payloads on behalf of a payer.
Ephemeral TokenA short-lived, single-use token authorizing a wallet to retrieve session parameters. Confers no signing authority.
Operator FeeThe combined fee earned by the Payment Processor on every transfer: baseFeeAmount[token] + floor(principal * operatorFeeBps[token] / 10000).
Order ReferenceA 16-byte (bytes16) reference created by the merchant for tracking. Embedded in PermittedTransfer events. Always a separate field from acquirerId.
Payload IDA client-generated UUID for idempotency.
PayerThe individual who holds the stablecoin and signs the payment commitment.
Payment ProcessorAn operator that deploys and runs a conformant instance of the Stablecoin Stack.
Permit SignatureAn ERC-2612 off-chain signature authorizing the Settlement Contract to call permit(). Field name: permitSig.
Principal AmountThe token amount intended to reach the beneficiary before fee deduction.
RelayerThe account that submits signed transactions on-chain, absorbing gas costs. Operated by the Payment Processor.
Service ProviderAn Acquirer who has opted in to public discovery via the Basic Data Service.
Settlement ContractThe on-chain Solidity smart contract that verifies signatures, executes transfers, and distributes fees.
Total With Feesprincipal + operatorFee + acquiringFee. The value in PermitParams.value.
Zero-UUID0x00000000000000000000000000000000. Used as acquirerId when no Acquirer is involved. Suppresses Acquiring Fee without reverting.

Payload Fields Reference

ERC20RelayerSig

FieldFormatRequiredConstraints
hashbytes32 — 66-char hexREQUIRED0x + 64 lowercase hex. The EIP-712 digest signed.
vintegerREQUIRED27 or 28. Normalize 0→27, 1→28. Reject all other values.
rbytes32 — 66-char hexREQUIREDFull 32 bytes, zero-padded.
sbytes32 — 66-char hexREQUIREDFull 32 bytes, zero-padded.

PermitParams

FieldFormatRequiredConstraints
ownerEVM addressREQUIREDMUST match signer recovered from payWithPermitSig.
spenderEVM addressREQUIREDTypically the Settlement Contract address.
valueuint256REQUIREDTotal with fees (principal + operatorFee + acquiringFee).
nonceuint256REQUIREDMUST match current on-chain ERC-2612 nonce of owner.
deadlineuint256REQUIREDMUST be strictly greater than processor clock at submission.

PayWithPermitParams

FieldFormatRequiredDescription
tokenEVM addressREQUIREDERC-2612-compliant stablecoin.
beneficiaryEVM addressREQUIREDMerchant receiving address.
orderReferencebytes16 — 34-char hexREQUIRED16-byte order reference. 0x + 32 hex chars. Zero if absent.
acquirerIdbytes16 — 34-char hexREQUIRED16-byte Acquirer ID. Use Zero-UUID if no acquirer. Always present.
permitParamsPermitParamsREQUIREDowner MUST match recovered signer of payWithPermitSig.

BuyAcquiringPackPermitParams

FieldFormatRequiredConstraints
tokenEVM addressREQUIREDMust be in acquiringAllowedTokens.
feeValueuint256REQUIREDMUST equal permitParams.value and acquiringPrice[token].
acquiringEVM addressREQUIREDMust not already be registered.
acquiringFeeBps_uint256REQUIREDMust not exceed maxAcquiringFeeBps[token].
permitParamsPermitParamsREQUIREDvalue MUST equal feeValue.

TransferRequest

FieldRequiredDescription
payWithPermitParamsREQUIREDPayment parameters.
payWithPermitSigREQUIREDBinding Signature over payWithPermitParams.
permitSigREQUIREDPermit Signature. Forwarded to Settlement Contract.
payloadIdREQUIREDClient-generated UUID- Idempotency key

BuyAcquiringPackRequest

FieldRequiredDescription
buyAcquiringPackParamsREQUIREDRegistration parameters.
payWithPermitSigREQUIREDBinding Signature over buyAcquiringPackParams.
permitSigREQUIREDPermit Signature. Signed value MUST equal feeValue.

Contract Interface Reference

State Variables

VariableTypeDescription
baseFeeAmountmapping(address => uint256)Absolute base fee per token.
operatorFeeBpsmapping(address => uint256)Operator fee in basis points per token.
maxAcquiringFeeBpsmapping(address => uint256)Maximum acquiring fee in basis points per token.
acquiringFeeBpsmapping(address => mapping(address => uint256))Acquiring fee per acquirer wallet per token.
balancesmapping(address => mapping(address => uint256))Internal balances: token → participant → amount.
usedHashesmapping(bytes32 => bool)Consumed Binding Signature digests. true = reverts.
acquirerWalletsmapping(bytes16 => address)Acquirer ID → wallet address.
acquiringAllowedTokensmapping(IERC20Permit => bool)Tokens accepted for Acquirer registration.
acquiringPricemapping(address => uint256)Registration fee per token.

Functions

transferWithPermit

function transferWithPermit(
IERC20Permit token,
address tokenOwner,
uint256 amount,
uint256 deadline,
uint8 v1, bytes32 r1, bytes32 s1,
uint8 v2, bytes32 r2, bytes32 s2,
address beneficiary,
bytes16 orderReference,
bytes16 acquirerId
) external

buyAcquiringPack

function buyAcquiringPack(
IERC20Permit token,
address payer,
address acquiring,
uint256 acquiringFeeBps_,
uint256 price,
uint256 deadline,
uint8 v1, bytes32 r1, bytes32 s1,
uint8 v2, bytes32 r2, bytes32 s2
) public

calculateFees

function calculateFees(
address token,
uint256 principal,
bytes16 acquirerId
) public view returns (
uint256 operatorFee,
uint256 acquiringFee,
uint256 totalWithFees
)

breakdownTransferAmount

function breakdownTransferAmount(
address token,
uint256 totalWithFees,
bytes16 acquirerId
) public view returns (
uint256 principal,
uint256 operatorFee,
uint256 acquiringFee
)

getBalances (single token)

function getBalances(
address token,
address[] calldata users
) external view returns (uint256[] memory)

getBalances (multi-token)

function getBalances(
address[] calldata tokens,
address[] calldata users
) external view returns (uint256[][] memory)

getAcquiringWallet

function getAcquiringWallet(
bytes16 acquirerId
) public view returns (address)

Events

PermittedTransfer

event PermittedTransfer(
bytes32 indexed domainSeparator,
address indexed token,
address indexed payer,
address beneficiary,
uint256 value,
uint256 operatorFee,
uint256 acquiringFee,
bytes16 orderReference,
bytes16 acquirerId
)

Note: orderReference and acquirerId are separate bytes16 fields in the event.

AcquirerCreated

event AcquirerCreated(
bytes16 indexed acquirerId,
address indexed wallet,
address indexed token,
uint256 feeBps
)

CommissionGenerated

event CommissionGenerated(
bytes16 indexed acquirerId,
address indexed token,
uint256 amount
)

AcquiringFeeUpdated

event AcquiringFeeUpdated(
address indexed acquiring,
address indexed token,
uint256 feeBps
)

Withdrawal

event Withdrawal(
address indexed owner,
address indexed beneficiary,
address indexed token,
uint256 amount
)

Error Categories

CodeTrigger
STRUCTURAL_ERRORMissing field, wrong type, encoding violation
SEMANTIC_ERRORExpired deadline, nonce mismatch, repeated payloadId, feeValue mismatch
CRYPTOGRAPHIC_ERRORSignature recovery failure, signer ≠ owner, hash field mismatch
BROADCAST_ERROROn-chain revert or submission failure after successful validation

Component Index

ComponentSubsystemSpec Section
Settlement ContractOn-chain§§11–14
core-checkout-engineCheckout Engine§6.2
checkout-public-widgetCheckout Engine§6.2
ca-serverCheckout Engine§6.2
login-serverCheckout Engine§6.2
credentials-managerCheckout Engine§6.2
merchant-dashboardCheckout Engine§6.2
wallet-gatewayBroadcast Layer§6.3, FPSF-SS-002
broadcast-serviceBroadcast Layer§6.3
broadcast-submitterBroadcast Layer§6.3
balance-and-historyBroadcast Layer§6.3
transfer-historyEvent Indexing§6.4
basic-data-serverShared Infrastructure§6.5
Client WalletClient§6.6

FPSF-SS-001 v1.0.0 · Draft · Fabric Payment Standards Foundation · Apache-2.0