Skip to content
Log inStart free

Design paper

Programmable payments: conditional money flows as event-driven state machines

Abstract

Marketplaces, subscriptions, usage billing and multi-party payouts need money to move when something happens, not on a fixed calendar. We describe a design for a programmable payments engine in which payouts, holds, splits, refunds and reserves are written as declarative rules over commerce events and compiled to finite state machines. The design has six parts: a payment graph of parties and accounts, a rule language, an event subscription layer, a jurisdictional policy layer, a risk-informed condition layer, and an execution layer with idempotent steps and compensating actions, plus an audit record that explains every transfer and every hold. We argue each part from published work on smart contracts and their failures, long-lived transactions, model checking, messaging without distributed transactions, fraud detection under delayed labels, two-sided platforms and explanations of automated decisions. We give a component map, a worked split model with its inputs shown, and the measurements a deployment would need before any outcome could be claimed. This is a design proposal, not a measured result.

Method. Design paper: the architecture is argued from the cited literature; we report no measurements of our own. Table 2 is a worked model with its inputs shown and labelled hypothetical.

References

  1. 1

    Rochet, J.-C., & Tirole, J. (2003). Platform competition in two-sided markets. Journal of the European Economic Association, 1(4). doi.org/10.1162/154247603322493212

  2. 2

    Committee on Payments and Market Infrastructures (2016). Fast payments: Enhancing the speed and availability of retail payments (CPMI Papers No. 154). Bank for International Settlements. www.bis.org/cpmi/publ/d154.htm

  3. 3

    Szabo, N. (1997). Formalizing and securing relationships on public networks. First Monday, 2(9). doi.org/10.5210/fm.v2i9.548

  4. 4

    Luu, L., Chu, D.-H., Olickel, H., Saxena, P., & Hobor, A. (2016). Making smart contracts smarter. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. doi.org/10.1145/2976749.2978309

  5. 5

    Clarke, E. M., Emerson, E. A., & Sistla, A. P. (1986). Automatic verification of finite-state concurrent systems using temporal logic specifications. ACM Transactions on Programming Languages and Systems, 8(2). doi.org/10.1145/5397.5399

  6. 6

    Garcia-Molina, H., & Salem, K. (1987). Sagas. Proceedings of the 1987 ACM SIGMOD International Conference on Management of Data. doi.org/10.1145/38713.38742

  7. 7

    Helland, P. (2016). Life beyond distributed transactions. ACM Queue, 14(5). doi.org/10.1145/3012426.3025012

  8. 8

    Kleppmann, M. (2017). Designing data-intensive applications: The big ideas behind reliable, scalable, and maintainable systems. O'Reilly Media. dataintensive.net/

  9. 9

    Bolton, R. J., & Hand, D. J. (2002). Statistical fraud detection: A review. Statistical Science, 17(3). doi.org/10.1214/ss/1042727940

  10. 10

    Dal Pozzolo, A., Boracchi, G., Caelen, O., Alippi, C., & Bontempi, G. (2018). Credit card fraud detection: A realistic modeling and a novel learning strategy. IEEE Transactions on Neural Networks and Learning Systems, 29(8). doi.org/10.1109/TNNLS.2017.2736643

  11. 11

    Kohavi, R., Tang, D., & Xu, Y. (2020). Trustworthy online controlled experiments: A practical guide to A/B testing. Cambridge University Press. doi.org/10.1017/9781108653985

  12. 12

    Wachter, S., Mittelstadt, B., & Russell, C. (2017). Counterfactual explanations without opening the black box: Automated decisions and the GDPR. arXiv:1711.00399 (Harvard Journal of Law & Technology, 2018). arxiv.org/abs/1711.00399

Cite this paper

Tanqory Research (2025). Programmable payments: conditional money flows as event-driven state machines. Tanqory. https://tanqory.com/research/programmable-payments-conditional-flows

More research

All research