Raxol.Payments.PrivacyTier (Raxol Payments v0.2.0)

Copy Markdown View Source

Maps trust scores to privacy tiers, fees, and settlement targets.

Based on the Xochi whitepaper Glass Cube model. Higher trust scores unlock deeper privacy at lower fees. Users can always opt into less privacy than their score allows.

Tiers

ScoreTierFee (bps)Settlement
--Open-2public
--Public0public
0-24Standard30public
25-49Stealth25stealth
50-74Private20shielded
75+Sovereign15shielded

Summary

Functions

List all tiers in ascending privacy order.

Required attestation proof types for a given tier.

Determine privacy tier from a trust score.

Get tier info for a named tier.

Check if a settlement type requires PXE bridge.

Types

settlement()

@type settlement() :: :public | :stealth | :shielded

t()

@type t() :: %{
  tier: tier(),
  fee_bps: integer(),
  settlement: settlement(),
  data_retention:
    :full_analytics | :full | :amounts | :ranges | :wallet | :nothing
}

tier()

@type tier() :: :open | :public | :standard | :stealth | :private | :sovereign

Functions

all()

@spec all() :: [t()]

List all tiers in ascending privacy order.

attestation_requirements(tier)

@spec attestation_requirements(tier()) :: [atom()]

Required attestation proof types for a given tier.

from_trust_score(score, opts \\ [])

@spec from_trust_score(
  non_neg_integer() | nil,
  keyword()
) :: t()

Determine privacy tier from a trust score.

Options

  • :tier_override -- force a specific tier (user opts into less privacy)

info(tier)

@spec info(tier()) :: t()

Get tier info for a named tier.

shielded?(arg1)

@spec shielded?(t()) :: boolean()

Check if a settlement type requires PXE bridge.