gitmyhub

triple-entry-bsv-sql

Go ★ 21 updated 18d ago

Tokenised commercial system on BSV: forked-PostgreSQL triple-entry ledger + tokenisation + EDI/logistics, regtest e2e. Research.

A research project that modifies PostgreSQL so every database change is also recorded on the Bitcoin SV blockchain, creating a tamper-proof triple-entry accounting trail without changing how you write SQL.

GoPostgreSQLBitcoin SVDockerCsetup: hardcomplexity 5/5

Traditional accounting records each financial transaction twice: once as a debit and once as a credit. Triple-entry accounting adds a third record that lives outside either party's control, making it harder to tamper with. This project builds a system where that third record is written onto the Bitcoin SV blockchain, creating a permanent, independently verifiable trail for every change made to the database.

The core idea is a modified version of PostgreSQL, the popular open-source database. When you run ordinary SQL commands against this modified version, everything that gets committed to the database is also automatically mirrored onto Bitcoin SV as a blockchain transaction. The connection between the database record and the blockchain entry is secured with cryptographic signatures, and each entry chains to the previous one, so you cannot quietly alter history. From the user's perspective, you just write SQL; the blockchain mechanics happen invisibly in the background.

Built on top of this foundation are four modules. One handles a general triple-entry ledger for accounting. A second manages tokenized versions of commercial documents such as purchase orders, invoices, and shipping notices. A third handles tokenized cash, including support for digital currency formats. A fourth tracks physical goods through their logistics lifecycle. All four share the same PostgreSQL-blockchain substrate.

The project is described as research and is currently in its earliest phase. As of the README, the build environment prerequisites, including Docker and a C compiler toolchain, are not yet in place, and the project depends on a separate specification document that is still missing. The phased build plan covers seven stages, from cryptographic core setup through hardening and testnet deployment, and no phase is permitted to begin until the previous one passes its verification checks.

This is a technical research project with a detailed specification. It is not a finished product and is not ready for general use.

Where it fits