ChainSQL
In development

Bring stablecoin payments into your ERP workflows.

ChainSQL is building a PostgreSQL integration layer for connecting business records, controlled payments, and paid API requests—with Odoo as the first reference integration.

Working on an ERP integration? Request a pilot conversation →


How it works

A database extension that connects records to payment operations.

ChainSQL installs into PostgreSQL and is called with ordinary SQL. It records the intent—what should be paid or purchased, for which business record, under whose authority—and hands the network work to a separate execution service.

Connect records to payments

Associate an invoice or business operation with its payment request, status, and receipt.

Every request carries a reference back to the record that produced it, so the payment trail stays attached to the work instead of living in a separate system.

Give software controlled purchasing power

Let authorized workflows and agents request paid resources within defined budgets.

Limits and permissions are evaluated by the execution service against policy you configure—not by the request, and not by the model that proposed it.

Keep a verifiable history

Preserve document versions and integration outcomes, with optional blockchain commitments.

Documents stay in your own storage. Only the information you explicitly select is committed on-chain for verification.

How a request reaches the network

  1. The database command records a request

    A SQL call inside PostgreSQL checks the caller and enqueues an operation with a stable identifier. No key material is involved at this stage, and no network call is made.

  2. An external service performs the network operation

    The execution service holds signing authority, applies spending policy, submits the operation, and records the outcome it observes. It runs outside the database process.

  3. The result is linked back to the record

    The observed outcome is written against the original operation. The database transaction and the blockchain transaction have separate lifecycles, but they are not independent: a payment retry preserves and reuses the original authorization, and reconciliation confirms what the network actually did before anything is re-sent.


Planned reference integration

An Odoo accounts-payable workflow.

This is the demonstration we are building. It shows how an existing ERP flow could route a payment decision through ChainSQL while the accounting work stays in Odoo.

Illustrative workflow

  1. An invoice enters Odoo

    A vendor bill is recorded the way it is today. Nothing about the ERP entry point changes.

    vendor_bill · INV/2026/0142
  2. An agent reviews the invoice and supporting records

    Authorized data is gathered with SQL: prior bills from the same vendor, purchase orders, receipt confirmations, and any attachments already stored.

  3. It recommends payment timing and records its reason

    The recommendation and its stated rationale are stored against the operation, so a reviewer can see why a decision was proposed.

  4. Spending rules decide what happens next

    Amount, vendor history, budget, and duplicate signals are evaluated by policy outside the model. The outcome is either permission to execute or a request for human approval.

  5. ChainSQL queues the approved operation

    The approved operation is written into PostgreSQL as a pending request with an identifier used for tracking and reconciliation.

  6. The execution service sends test USDC on Arc

    Outside the database, the service signs and submits the transfer, then observes the result. This is the part designed to run on Arc testnet first.

  7. The result is linked back to the business record

    The observed outcome and its reference are written against the originating operation and shown to the ERP user.


Settlement and resource payments

Arc settles value. x402 buys resources.

Two different jobs, handled by two different mechanisms. ChainSQL integrates with each separately, and neither one depends on the other to work.

Settlement network

Arc: the settlement network

Arc is an EVM-compatible Layer-1 blockchain designed for stablecoin applications, where transaction fees are paid in USDC. For business payments that matters: the asset being moved and the cost of moving it are denominated in the same stable unit.

ChainSQL’s planned Arc integration is designed to execute approved stablecoin payments and associate the resulting transaction with the ERP record that requested it.

  • Initial integration targets Arc testnet.
  • Operations begin as prepared, policy-checked requests.
  • Network execution happens outside PostgreSQL.
Reference: Arc documentation
Paid resource access · v2

x402 v2: purchasing resources through HTTP

x402 is a payment protocol for APIs and other online resources. A compatible service can communicate its payment requirements; an authorized client can prepare a payment and obtain the resource through the protocol.

Example request

An ERP agent needs to confirm a new vendor. Mid-workflow it purchases a supplier verification report using x402, and later a logistics data lookup for the same order—each within the budget the workflow was granted.

The planned integration checks payment terms and available budget before a request is prepared, then records both the resource result and the payment outcome against the business operation. It could also work in the other direction, letting a business charge for access to explicitly authorized API resources.

x402 handles the resource-payment exchange, while a supported blockchain handles settlement. Ordinary invoice transfers do not automatically become x402 transactions—the two paths are separate by design.

References: x402 documentation and the official v1 → v2 guide, which this integration uses for v2 terminology.

Developers

Familiar SQL for the calls. Clear boundaries for everything else.

ChainSQL is called with ordinary SQL from the application you already run. The scaffold ships the extension, the worker, and an Odoo addon skeleton so the request-and-result cycle can be exercised end to end on your own machine.

scaffold/request_resource.sql sql
SELECT chainsql.request_resource(
  'supplier-verification',
  '{"vendor_id":42}',
  'vendor_check_00000042'
);

SELECT id, kind, state, result
FROM chainsql.operations;

Queue a request to an administrator-configured resource, then inspect its status. The scaffold’s mock worker simulates execution.

Local and illustrative

The scaffold runs on your own machine. The mock worker does not contact a network or spend funds—it exists so the request-and-result cycle can be developed before live execution is wired up.

Architecture

Where each step happens.

Signing and network execution sit outside PostgreSQL. The database records intent and results; it does not hold keys or talk to the network.

Odoo or another authorized application Issues SQL calls against the extension using the credentials it already has.
SQL command
PostgreSQL and the ChainSQL extension Validates the caller, queues the operation with a stable identifier, stores documents and their hashes, and records results when they return.
operation dispatched
Outside PostgreSQL · signing and network execution
External execution service Applies spending policy, prepares the payment, holds signing authority, and observes the outcome. Runs as its own process with its own permissions.
approved operation
Arc settlement and x402-compatible services Arc settles stablecoin transfers. x402-compatible endpoints deliver paid resources such as verification reports or data lookups.
observed outcome
Results returned to PostgreSQL The outcome and its reference are written back against the originating operation and become visible to the ERP user.
A payment retry reuses and preserves its original authorization, with the same operation identifier. Reconciliation confirms what the network actually did before anything is re-sent, so a repeat is never recorded as a new obligation.

Design principles

Deployment and data principles we are building to.

These are design intentions, not completed guarantees. Some are partly implemented in the scaffold.

Support for self-hosted deployment

Designed to run inside infrastructure you control, next to the database it extends, without a required hosted dependency.

Documents stay in your own storage

Invoices, bills of materials, and attachments live in your infrastructure. The starter supports storing document bytes locally alongside their hashes, so a document can be verified without leaving your systems.

Explicit on-chain selection

What gets committed is chosen deliberately, field by field. There is no default that publishes business data.

Spending policies enforced outside the model

Budgets, limits, and approvals are evaluated by policy code in the execution service. A model can propose an action; it cannot authorize one.

Operation identifiers and recovery logic

Every request carries a stable identifier, and a retry preserves the original authorization. Recovery logic reconciles a repeat against the first attempt instead of recording a second obligation.

Separate application, worker, and signing permissions

The ability to call the extension, the ability to run execution work, and the ability to sign are intended to be distinct roles held by different processes.


Status

One scaffold today, settlement next.

ChainSQL is an early-stage project. The first column is available now; the rest is what we are building.

Starter scaffold · available

What exists today

  • Local SQL command queue
  • Document hashing and local document storage
  • x402 v2 authorization preparation
  • Mock execution worker
  • Odoo addon scaffold
Next

Integration work in progress

  • Arc testnet execution
  • The Odoo accounts-payable demonstration
  • Policy checks wired into the request path
  • Result write-back shown in the ERP
Later

Future directions

  • Production deployment controls
  • Spending controls for production use
  • Additional database adapters
  • Further enterprise ERP connectors

Next step

Start with one workflow you already run.

Pilot conversations begin with a single flow—a vendor bill approval, a data lookup, an agent that needs a spending limit. We work through how it maps onto the extension, what the scaffold covers, and what it does not yet.

One email, straight to the maintainers. No signup, no account.

Worth including

  • Which ERP and database you run today
  • The workflow you would connect first
  • Who approves payments and how
  • Any limits or audit requirements you work to

FAQ

Straight answers.

What does ChainSQL add to an ERP?

It adds a connection between a business record and a payment or purchase operation. A bill, order, or workflow action gets a corresponding request with a status, an outcome, and a reference back to the record it came from—plus a place to record commitments for verification.

Your ERP keeps doing the accounting. ChainSQL handles the request, the network step, and the link between them.

Why is Odoo the first demonstration?

Odoo is widely used, self-hostable, and built on PostgreSQL—the database ChainSQL targets first. That makes it the shortest path to showing the idea end to end, with real invoices and real approval steps instead of a synthetic demo.

It is a reference integration, not the limit of the design. Additional ERP connectors are a future direction.

What information goes on-chain?

What you explicitly choose. Documents are stored locally, and the scaffold supports storing document bytes in your own storage alongside their hashes—so verification does not require publishing the document itself.

Anything written to a public network should be treated as public, so ChainSQL does not promise privacy for information you elect to publish.

How do Arc and x402 work together?

They solve different problems. x402 negotiates access to a paid resource over HTTP—the protocol layer for buying something. Arc is where stablecoin value settles—the settlement layer for moving it.

A single workflow can use both: purchase a data lookup through x402, and settle a vendor payment on Arc. Each is recorded against the relevant business operation.

What is available today?

The starter scaffold. It runs locally and simulates execution—no funds are spent and no live network is contacted.

Live Arc settlement and the complete Odoo payment workflow are still ahead. Request a pilot conversation if you would like to look at it against your own workflow.