Back to Home
Security ArchitectureBenchmark: Multi-Chain Release (Solana & NEAR)

Security & Cryptographic Invariants

TidePay was designed with zero custodial surface area. By replacing pooled escrow vaults with delegated pull authority, the protocol eliminates honeypot systemic risk.

1. Non-Custodial Core Invariance

Traditional recurring billing systems in Web3 attempt to lock user capital in multi-signature escrow vaults or pooled liquidity pools. This creates attractive targets for exploits.

Delegated Pull Authority Design

Subscribers retain 100% custody of their tokens. When subscribing, the user executes an SPL token ApproveChecked instruction, granting spending allowance to TidePay's Program Derived Authority (tidepay_auth PDA). Funds only move when an epoch is due.

2. Anti-Reentrancy & Temporal Enforcement

To guard against re-entrancy and double-spend attacks during epoch processing, TidePay enforces two strict on-chain guarantees:

1. State Before CPI Mutation

subscription.last_epoch_timestamp and cycle_count are incremented on-chain before calling external CPI token transfers, preventing recursive re-entrancy.

2. Cluster Clock Authority

Settlements reject client-side timestamps. Validity relies strictly on the Solana cluster validator clock: Clock::get()?.unix_timestamp >= next_epoch.

3. Deterministic PDA Seed Derivations

All state accounts are isolated with cryptographic PDA derivations and Anchor 8-byte discriminators:

MerchantPlan[b"plan", merchant_pubkey, plan_id]
SubscriptionRecord[b"subscription", plan_pubkey, subscriber_pubkey]
ProgramAuthority[b"tidepay_auth"]

4. SPL Token & Token-2022 Safety

  • Exact Decimals EnforcementAll token movements use transfer_checked instead of raw transfer, strictly validating mint decimals and avoiding rounding miscalculations.
  • Rent Cleanliness & Lamport ReclamationSubscription cancellations explicitly close the account and return rent lamports directly to the subscriber wallet via close = subscriber.
  • Keeper Crank IdempotencyCrank relayer microservices maintain in-memory concurrency locks to prevent in-flight duplicate transaction submissions.

5. Responsible Vulnerability Disclosure

TidePay welcomes responsible disclosures from security researchers, white-hat engineers, and auditors. If you identify an issue in our on-chain program, keeper crank, or developer SDK, please report it directly:

Security Contactsecurity@tidepay.xyz
GitHub Security Advisories →