Research/Payments

Programmable Money: Conditional Payments, Escrow, and Smart Transfers

How programmable money works: conditional transfers, automated escrow, streaming payments, and real-world applications.

bcTanjiMay 20, 2026

Programmable money is digital currency with embedded logic: payments that execute, route, or reverse themselves based on conditions rather than manual instructions. Instead of a human clicking "release funds" or an accounts-payable team scheduling a wire, the payment itself carries the rules for when and how value moves. This shift from passive money to active money is already reshaping how businesses handle escrow, subscriptions, payroll, and conditional refunds.

The concept is not new. ACH scheduling, Stripe recurring billing, and standing orders have automated payment timing for decades. What is new is embedding arbitrary conditions directly into the payment layer: release funds when a shipping container clears customs, stream salary by the minute, or refund automatically if a service-level agreement is breached. In 2025, stablecoin transaction volume hit $33 trillion, up 72% year-over-year, and much of that growth is driven by programmable use cases that traditional rails cannot support.

What Makes Money Programmable

Traditional payment automation operates on top of money: an application layer tells a bank to move funds at a scheduled time. The money itself is inert. Programmable money moves the logic into the payment instrument. Three properties distinguish it from conventional automation:

  • Conditionality: transfers execute only when cryptographic or computational conditions are satisfied
  • Atomicity: multi-step operations either complete entirely or revert entirely, with no partial state
  • Composability: one payment can trigger downstream actions (split revenue, fund an escrow, initiate a swap) in a single operation

These properties emerge from two technical foundations: Bitcoin Script and its extensions (including Hash Time-Locked Contracts), and smart contract platforms that support Turing-complete logic. Bitcoin Script is intentionally limited, which makes it predictable and secure. Smart contracts on Ethereum and other platforms are more expressive but introduce larger attack surfaces.

Traditional Payment Automation vs On-Chain Programmability

The distinction between scheduling a payment and programming a payment is critical. Traditional payment rails automate timing but not conditions. A recurring Stripe charge fires on a calendar date regardless of whether the customer used the product. An ACH direct debit pulls funds whether or not the underlying service was delivered. The logic lives in application code, not in the payment itself.

CapabilityTraditional AutomationOn-Chain Programmability
Condition typesTime-based only (schedules, recurring dates)Arbitrary: cryptographic proofs, oracle data, multi-party approvals
AtomicityNone: partial failures require reconciliationFull: transactions succeed or revert entirely
Settlement speed1 to 4 business days (ACH), minutes (FedNow)Seconds to sub-second on Layer 2s
Operating hoursBusiness days only for most rails24/7/365
ComposabilityRequires middleware and API orchestrationNative: one transaction triggers downstream logic
Dispute resolutionManual chargebacks (45 to 120 days)Encoded in contract logic (seconds to days)
Cost per transaction$0.20 to $0.50 (ACH), $15 to $30 (wire)Sub-cent on Layer 2s

This does not mean on-chain payments replace traditional rails everywhere. Card networks handle fraud protection, consumer credit, and regulatory compliance that raw programmability does not address. Payment processors add value through risk scoring, merchant onboarding, and dispute resolution. The comparison highlights where programmability fills gaps that scheduling alone cannot.

Convergence is already happening: Stripe launched stablecoin checkout with USDC support in 2025 via its Bridge acquisition. Circle released CCTP V2 Hooks in March 2025, enabling atomic post-transfer logic on destination chains. Traditional fintech and on-chain programmability are merging, not competing.

How Conditional Payments Work

Conditional payments release value only when a cryptographic or computational condition is met. The simplest and most battle-tested primitive is the Hash Time-Locked Contract (HTLC), which combines two constraints: a hashlock (the recipient must reveal a secret preimage matching a known hash) and a timelock (funds revert to the sender if the preimage is not revealed within a deadline).

HTLCs in Practice

Every payment routed through the Lightning Network uses an HTLC. When Alice pays Carol through an intermediary Bob, the payment is secured by a chain of hash locks: Carol reveals the preimage to Bob, who reveals it to Alice, and each hop settles atomically. If any link fails, the timelocks ensure funds return to the sender. This pattern processes millions of transactions monthly across the Lightning Network.

HTLCs are not limited to routing. A hodl invoice deliberately delays HTLC settlement, creating a trustless escrow state: the payment is locked but not yet claimed, and the recipient can settle, cancel, or let it expire. This enables marketplace escrow (hold payment until delivery confirmation), atomic cross-chain swaps, and oracle-gated releases.

Beyond HTLCs: PTLCs and Covenants

Point Time-Locked Contracts (PTLCs) replace hash preimages with Schnorr signature adaptor points, improving privacy by making each hop in a multi-hop payment look cryptographically distinct. Where HTLCs reuse the same hash across every hop (allowing correlation), PTLCs decorrelate payment paths.

Covenants take programmability further by constraining how a UTXO can be spent in future transactions. Proposed opcodes like OP_CHECKTEMPLATEVERIFY (CTV) and OP_VAULT would enable spending vaults, rate-limited withdrawals, and congestion control natively on Bitcoin L1. While covenants remain proposals, their potential for programmable custody and conditional spending is significant.

Automated Escrow: From Weeks to Seconds

Traditional escrow services charge 1% to 3% of the transaction value with minimums often exceeding $300, and settlement takes days to weeks. A title company holding funds for a real estate closing, an escrow agent managing a domain sale, or a marketplace holding payment for a freelancer: all involve trusted intermediaries, manual verification, and multi-day settlement.

Programmable escrow replaces the intermediary with code. A smart contract or HTLC-based escrow holds funds and defines release conditions. Three common patterns:

  • Time-locked release: funds become available after a specified duration unless disputed
  • Multi-party approval: release requires signatures from buyer, seller, or an arbiter (2-of-3)
  • Oracle-gated release: an external data feed (shipping tracker, API response, IoT sensor) triggers settlement

Milestone-Based Escrow for Marketplaces

Freelance platforms, construction contracts, and B2B procurement all use milestone-based payment structures. In a traditional setup, each milestone requires manual approval, payment initiation, and settlement delay. With programmable escrow, a contract can hold the total project value and release portions as milestones are verified: first prototype delivered, code review passed, final deliverable accepted.

The atomicity guarantee matters here. If a milestone payment is structured as a multi-step operation (release escrow, split between contractor and platform, update project status), the entire sequence either completes or reverts. No partial state where the platform takes its cut but the contractor does not get paid.

Streaming Payments: Continuous Value Transfer

Payment streaming replaces lump-sum transfers with continuous flows. A $5,000 biweekly salary becomes roughly $0.0019 per second, accruing in real time. The recipient can withdraw accrued funds at any point. Streaming protocols like Sablier (534,000+ streams created across 297,500+ users as of 2025) and Superfluid have demonstrated the model on Ethereum-based chains, though gas costs on L1 limit their practicality for small payments.

Use Cases for Streaming

Payroll is the most discussed application, but streaming unlocks several other patterns:

  • SaaS subscriptions: continuous payment replaces monthly billing cycles, with automatic cutoff when the stream balance depletes
  • Content monetization: Podcasting 2.0 apps already send keysend payments to creators every 60 seconds during playback via Lightning
  • DAO contributor payments: Gitcoin and other DAOs use streaming for grant disbursement, replacing lump-sum milestone payments
  • Rental and lease payments: continuous accrual replaces monthly invoicing and late-payment management

The economics depend on transaction costs. Per-minute streaming payroll generates roughly 525,600 payments per year per employee. At sub-cent transaction costs on Layer 2s, the total annual cost is approximately $5.25. On traditional ACH at $0.20 to $0.50 per transaction, daily payroll alone would cost over $50 per employee per year: making per-minute streaming economically impossible on legacy rails.

Streaming is not just about frequency: The real value is in improved cash flow management. Employees access earned wages immediately rather than waiting for pay cycles. Businesses avoid large periodic outflows. Both sides reduce dependence on credit to bridge timing gaps.

Who Benefits from Programmable Payments

Programmable money is not a solution looking for a problem. Specific business models have structural payment inefficiencies that conditionality, atomicity, and composability directly address.

Marketplaces and Gig Platforms

Two-sided marketplaces manage escrow between buyers and sellers, handle dispute resolution, and split payments (platform fee, seller payout, tax withholding). Today this requires payment orchestration layers, reconciliation systems, and days of settlement delay. Programmable escrow collapses this into a single atomic operation: buyer funds lock on order, release to seller on delivery confirmation, with the platform fee split executed in the same transaction.

SaaS and Subscription Businesses

Recurring billing systems handle failed charges, dunning emails, proration, and plan changes through complex application logic. Streaming payments eliminate most of this: the customer streams payment continuously, and service access is gated on stream status. No failed charges, no retry logic, no involuntary churn from expired cards.

Cross-Border B2B Payments

International B2B payments involve correspondent banking chains, FX conversion, and multi-day settlement. The current system loses 3% to 7% of transaction value to intermediary fees and forex spreads. Programmable stablecoin payment rails can encode conditions like "convert to local currency at the oracle rate and release upon customs clearance" in a single settlement operation.

Technical Approaches Compared

Programmable payments are implemented through several distinct technical architectures, each with different tradeoff profiles.

ApproachProgrammabilitySettlementCostTrust Model
Ethereum smart contractsTuring-complete (Solidity)12 seconds (L1), sub-second (L2)$0.50 to $5+ (L1), sub-cent (L2)Trustless (consensus)
Bitcoin Script + HTLCsLimited opcodes, conditional locks10 min (L1), instant (Lightning)$0.50 to $5 (L1), sub-cent (Lightning)Trustless (PoW + timelocks)
Payment channels (Lightning)HTLC/PTLC-based conditionsSub-secondSub-centTrustless (channel state)
Statechain-based (Spark)Conditional transfers, timelocksInstantSub-cent1-of-n operator honesty
Stablecoin scripts (CCTP V2)Post-transfer hooks, cross-chain8 to 20 seconds cross-chainVariable by chainIssuer + chain consensus

Smart contract platforms offer the most expressive programmability but introduce larger attack surfaces. Ethereum smart contract exploits have resulted in billions in losses since 2016. Bitcoin's more constrained scripting model limits expressiveness but reduces the blast radius of bugs. Payment channel networks like Lightning provide the best combination of speed and cost for conditional payments but require channel management and liquidity planning.

Programmable Stablecoin Payments

Stablecoins are the most natural vehicle for programmable money in commerce. Businesses price in dollars, pay suppliers in dollars, and report revenue in dollars. A programmable dollar that settles instantly, operates 24/7, and executes conditional logic removes the primary objection to crypto in business payments: volatility.

The stablecoin market reached roughly $320 billion in market capitalization by early 2026, with USDT at $187 billion and USDC at $77 billion. But market cap understates the activity: $33 trillion in stablecoin transactions settled in 2025, driven increasingly by programmable use cases rather than simple transfers.

Regulatory Clarity Accelerates Adoption

The GENIUS Act, signed into law on July 18, 2025, established the first comprehensive federal framework for payment stablecoins in the United States. It requires 100% reserve backing with cash or short-term Treasuries, monthly public reserve disclosures, and segregation of reserves from operational funds. Issuers must be subsidiaries of insured depository institutions, OCC-supervised nonbank entities, or state-chartered institutions under federally equivalent regimes.

In Europe, MiCA entered full enforcement for stablecoin provisions in mid-2024, with complete CASP registration deadlines in mid-2026. As of late 2025, 102 CASPs were registered and 30 stablecoin issuers were active in the EU. This regulatory clarity on both sides of the Atlantic gives businesses the legal foundation to build programmable payment flows on stablecoins rather than treating them as speculative instruments.

Programmable Payments on Spark

Spark is a Bitcoin Layer 2 built on statechains and FROST threshold signatures that enables instant transfers without on-chain transactions. Its architecture supports several programmable payment primitives natively, without requiring Turing-complete smart contracts.

Conditional Transfers via Lightning Integration

Spark integrates with the Lightning Network through Spark Service Providers (SSPs) that execute atomic swaps: either both legs of the transfer complete or neither does. This atomic guarantee enables conditional payment flows. A marketplace can accept a Lightning payment that locks on Spark, hold it conditionally using a hodl invoice pattern, and release to the seller only when delivery is confirmed. No custom smart contract required.

Time-Locked Payments and Escrow

Spark's leaf architecture uses relative timelocks to establish ownership hierarchy. Current owners hold the shortest timelocks, preventing previous owners from spending. This same mechanism can enforce time-based payment conditions: funds locked until a date, released in tranches on a schedule, or returned to the sender after a timeout period. These are not application-layer workarounds but protocol-level guarantees.

Stablecoin Programmability with USDB

USDB, a dollar-pegged stablecoin on Spark, enables programmable dollar payments with Bitcoin settlement. Transfers settle instantly with no gas fees. The combination of dollar stability, sub-cent transaction costs, and protocol-level conditional logic makes several use cases practical that are cost-prohibitive on other rails:

  • Streaming payroll in dollars at per-minute granularity
  • Marketplace escrow with automatic timeout and refund
  • Conditional B2B payments tied to delivery or milestone verification
  • Subscription payments that stream continuously rather than billing monthly

Because Spark users hold stablecoins in the same self-custodial wallet as Bitcoin, with the same keys, there is no separate custody infrastructure to manage. This is payments infrastructure, not DeFi complexity.

Real-World Applications Taking Shape

Programmable money is moving beyond proofs of concept. Several categories of applications are live or in active deployment.

Agentic Payments

AI agents that autonomously purchase data, compute, and services need payment infrastructure that operates without human approval for each transaction. In February 2026, Coinbase launched Agentic Wallets for autonomous AI spending. In March 2026, Circle released a nanopayments testnet enabling gas-free USDC transfers as small as $0.000001, targeting machine-to-machine micropayments. The IMF published a formal note in 2026 on how agentic AI will reshape payments infrastructure.

Institutional Programmable Settlement

JPMorgan's Kinexys platform (formerly JPM Coin) processes over $5 billion daily as of early 2026, with cumulative volume exceeding $3 trillion. The BIS Project Agora brings together seven central banks and 40+ financial institutions (including JPMorgan, Citi, HSBC, and Swift) to test a unified programmable ledger for cross-border payments. Citi projects that bank token transaction volumes could reach $100 trillion to $140 trillion by 2030.

Conditional Refunds and Dispute Resolution

Programmable escrow contracts enable automatic refunds based on predetermined conditions. A shipping delay beyond a threshold triggers a partial refund. A quality dispute escalates to an arbiter whose signature releases funds to either party. These flows replace the 45-to-120-day chargeback cycle with resolution encoded at the payment layer.

Challenges and Limitations

Programmable money introduces new risks alongside its benefits. Understanding the limitations is essential for builders choosing this infrastructure.

Smart Contract Risk

Code is not inherently safer than humans. Smart contract bugs, logic errors, and oracle manipulation have caused billions in losses across DeFi. More constrained environments like Bitcoin Script and Spark's statechain model reduce this surface area, but they also limit expressiveness. There is always a tradeoff between what payments can do and what can go wrong.

Regulatory Uncertainty Outside Major Markets

While the GENIUS Act and MiCA provide frameworks in the US and EU, most jurisdictions lack clear rules for programmable payment instruments. Businesses operating across multiple regulatory regimes face compliance complexity that pure technology does not solve. KYC/AML requirements vary by jurisdiction, and programmable payments must integrate these checks rather than bypass them.

The Oracle Problem

Conditional payments that depend on real-world data (delivery confirmation, price feeds, SLA metrics) need reliable oracles. On-chain logic can verify cryptographic proofs, but it cannot independently verify that a package arrived or that a server met uptime guarantees. Oracle reliability, manipulation resistance, and liveness are ongoing challenges that constrain which conditions can be trustlessly enforced.

Getting Started with Programmable Payments

For developers building payment applications, Spark provides programmable stablecoin infrastructure without the complexity of managing smart contracts or Lightning channel capacity. The Spark SDK documentation covers integration patterns for conditional transfers, time-locked payments, and Lightning interoperability.

For users looking to experience programmable dollar payments today, General Bread is a Spark-powered wallet that supports instant USDB transfers and Bitcoin payments. For a deeper look at how stablecoin payments work on Bitcoin infrastructure, see our research on USDB and dollar-denominated Bitcoin payments and stablecoin payment rails compared to traditional systems.

This article is for educational purposes only. It does not constitute financial or investment advice. Bitcoin and Layer 2 protocols involve technical and financial risk. Always do your own research and understand the tradeoffs before using any protocol.