SQL reference: 17_ledger_and_cleanup
Production API: https://asi-database-node-api.arybit.co.ke
Source: Database/17_ledger_and_cleanup.sql
Engine: MySQL legacy. Status: disabled; qualification pending.
Migration ID: 17_ledger_and_cleanup. SHA-256 (LF): 794582d4ba942f362427275c3b6dcce79d1940bbbe8118f9af5dabc3928fbdb4.
Pending isolated MySQL/MariaDB compatibility, dependency and tenant-isolation validation.
Source overview
========================================================= Arybit Auth - Schema Module (MySQL Version) MODULE: 17_ledger_and_cleanup VERSION: 2.2.0 • January 2026
Implementation of critical security review recommendations:
- Append-only Ledger for balances (Double-entry accounting foundation)
- Drop plaintext token columns (Attack surface reduction)
Declared objects
balance_movementsdrop_col_safefinalize_2fa_wrapperrecord_balance_movementtrg_ledger_update_balanceupdate_user_balance
This is a static source reference, not a runtime qualification. Object extraction does not interpret SQL semantics. Review the source and manifest before any schema change.