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.
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:
subscription.last_epoch_timestamp and cycle_count are incremented on-chain before calling external CPI token transfers, preventing recursive re-entrancy.
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:
4. SPL Token & Token-2022 Safety
- Exact Decimals EnforcementAll token movements use
transfer_checkedinstead of rawtransfer, 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: