{"id":50500771,"url":"https://github.com/prof-faustus/triple-entry-bsv-sql","last_synced_at":"2026-06-07T16:00:54.454Z","repository":{"id":361818145,"uuid":"1255851205","full_name":"prof-faustus/triple-entry-bsv-sql","owner":"prof-faustus","description":"Tokenised commercial system on BSV: forked-PostgreSQL triple-entry ledger + tokenisation + EDI/logistics, regtest e2e. Research.","archived":false,"fork":false,"pushed_at":"2026-06-01T12:22:42.000Z","size":262,"stargazers_count":20,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-06T15:24:43.631Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prof-faustus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-01T08:23:37.000Z","updated_at":"2026-06-06T14:40:52.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/prof-faustus/triple-entry-bsv-sql","commit_stats":null,"previous_names":["prof-faustus/triple-entry-bsv-sql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/prof-faustus/triple-entry-bsv-sql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prof-faustus%2Ftriple-entry-bsv-sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prof-faustus%2Ftriple-entry-bsv-sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prof-faustus%2Ftriple-entry-bsv-sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prof-faustus%2Ftriple-entry-bsv-sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prof-faustus","download_url":"https://codeload.github.com/prof-faustus/triple-entry-bsv-sql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prof-faustus%2Ftriple-entry-bsv-sql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34027670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-07T02:00:07.652Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T11:02:57.204Z","updated_at":"2026-06-07T16:00:54.424Z","avatar_url":"https://github.com/prof-faustus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tokenised Commercial System on Bitcoin SV — Triple-Entry SQL\n\nMonorepo for the system specified in [`spec/TripleEntry_BSV_SQL_Build_Spec_v8.md`](spec/TripleEntry_BSV_SQL_Build_Spec_v8.md)\n(the **Spec** — the build contract). The kickoff brief that drives the phased build\nis [`spec/TripleEntry_BSV_SQL_ClaudeCode_Kickoff.md`](spec/TripleEntry_BSV_SQL_ClaudeCode_Kickoff.md).\n\nA fork of PostgreSQL 18 with native BSV embedded: ordinary SQL writes are mirrored,\nper-field and per-change, onto Bitcoin SV as an immutable, ECDH-HMAC-bound, hash-chained\n**third entry** (triple-entry accounting). On top sit four packages sharing one substrate:\na triple-entry ledger (A), tokenised EDI documents (B), multi-currency tokenised cash (C),\nand tokenised logistics/goods (D).\n\n## Non-negotiable constraints (build failures if violated)\n\n- **BSV only.** No BTC constructs: no SegWit, Taproot, witness, Lightning, RBF (`SYS-CON-001`).\n- **No P2SH** — consensus-prohibited on BSV. Native locking scripts only: P2PKH, bare\n  `OP_CHECKSIG`, bare `OP_CHECKMULTISIG` (`SYS-CON-002`).\n- **No `OP_RETURN` — at all.** All on-chain data rides as pushdata in **spendable** locking\n  scripts (`OP_FALSE OP_IF \u003cdata\u003e OP_ENDIF`, or `\u003cdata\u003e OP_DROP` before the auth opcodes)\n  (`SYS-CON-008`, `SYS-ENC-001`).\n- **ECDH-HMAC keystone** (`SYS-CON-003`, Section 5): every accounting change is bound to an\n  ECDH-keyed HMAC tag carried on-chain in a spendable script; entries form a hash chain\n  (`SYS-CON-004`); the DB is rebuildable from the chain alone.\n- **SQL-simple** (`SYS-CON-005`): the user runs ordinary SQL; on-chain mechanics are invisible.\n- **Node is Teranode** (`SYS-DECIDE-010`), via `teranode-quickstart` Docker; dev/test on regtest.\n\n## Repository layout (Spec Section 13, `SYS-REPO-001`)\n\n| Path | Purpose | Primary requirement IDs |\n|---|---|---|\n| `node-docker/` | Dockerised Teranode (regtest) + compose | `SYS-NODE-001..003`, `SYS-CON-006` |\n| `pg-fork/` | Forked PostgreSQL 18 + native BSV (C) | `SYS-PG-001..007` |\n| `pg-fork/capture/` | Committed-write interception (WAL/extension/in-core) | `SYS-PG-002/003`, `SYS-DECIDE-002` |\n| `pg-fork/bsv-native/` | Key derivation, ECDH-HMAC, tx build/broadcast, hash chain | `SYS-HMAC-001..011` |\n| `pg-fork/sql-surface/` | DDL extensions, catalog, `te_verify()`, `te_render_pdf()` | `SYS-PG-005/006`, `SYS-DOC-005` |\n| `crypto-core/` | Shared ECDH/HKDF/HMAC/commitment (C + TS/Go), KAT vectors | `SYS-HMAC-*`, `SYS-TEST-003` |\n| `tokenisation/` | Definable token primitive + cash/CBDC linkage + goods | `SYS-TOK-001..007`, `SYS-CASH-*`, `SYS-GOODS-001` |\n| `edi-dfa/` | Commercial-document DFAs (PO/invoice/payment/shipping) | `SYS-EDI-001..004` |\n| `edi-bridge/` | Optional X12/EDIFACT ↔ on-chain DFA translation (per partner) | `SYS-EDI-005/006`, `SYS-DECIDE-005` |\n| `doc-render/` | Deterministic PDF paper copies + BURI/QR embed | `SYS-DOC-001..005` |\n| `logistics/` | Consignment lifecycle + DHT goods records | `SYS-LOG-001..012` |\n| `sdk-ts/` | Client SDK (TypeScript) | `SYS-PG-005` |\n| `services-go/` | Indexer, relay, broadcaster glue to node | `SYS-NODE-002`, `SYS-HMAC-006` |\n| `spec/` | Spec + requirements + `VERIFY-LOG.md` + `DECISIONS.md` | `SYS-INTEG-*` |\n| `tests/` | regtest e2e, KAT, adversarial, cold-rebuild | `SYS-TEST-001..003` |\n\n## Phased delivery (Spec Section 13, `SYS-PHASE-001`)\n\nNo phase begins before the prior phase's exit criteria pass (`SYS-PHASE-002`).\n\n0. **Spec freeze + decisions** — skeleton, pin node/PG, resolve decisions \u0026 `[VERIFY]`.\n1. **Crypto core + KAT** — ECDH common-secret, HKDF, HMAC, commitment, encoder; cross-impl vectors green.\n2. **Node + hash-chain log** — Teranode regtest; hash-chained ECDH-HMAC TX stream; cold-rebuild toy stream.\n3. **PostgreSQL fork** — write interception + outbox + async/sync + `te_verify()` + cold-rebuild real schema.\n4. **Definable token** — cash (3 profiles) + goods + atomic swap + external-linkage adapter contract.\n5. **EDI DFA + bridge + logistics** — document DFAs, consignment lifecycle, X12/EDIFACT bridge.\n6. **Proofs / custody / overlay / computation** — SPV+BURI, threshold custody, overlay CKD, staked computation.\n7. **Hardening** — reorg, idempotency, confirmation gating, security review, testnet.\n\nSee [`spec/VERIFY-LOG.md`](spec/VERIFY-LOG.md) and [`spec/DECISIONS.md`](spec/DECISIONS.md) for the\nresolved/open verification gates and deployment decisions, and [`spec/STATUS.md`](spec/STATUS.md)\nfor current build status against each requirement ID.\n\n## Status\n\nPhase 0 in progress. See [`spec/STATUS.md`](spec/STATUS.md). **Prerequisites not yet present in this\nenvironment** (Docker, a C toolchain, a PostgreSQL build environment) and a **missing dependency**\n(`CTO_BSV_Build_Spec_v1.md`, the substrate this system builds on) are tracked there — these gate the\nnode bring-up and the C-side builds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprof-faustus%2Ftriple-entry-bsv-sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprof-faustus%2Ftriple-entry-bsv-sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprof-faustus%2Ftriple-entry-bsv-sql/lists"}