PostgreSQL backend store implementation for the ruby BSV Wallet gem
Be the first to ask Simon Bettison something.
What do you think? ...
PostgreSQL adapter for the Ruby BRC-100 wallet.
Added
Schema — actions, outputs, inputs, spendable, baskets, labels, tags, certificates, tx_proofs, blocks, broadcasts
Store — full BRC-100 action lifecycle: create, sign, promote, abort, reap, list, query
ProofStore — merkle proof persistence with block normalization
UTXOPool — UTXO selection with sizing strategy and limp mode
BroadcastQueue — broadcast lifecycle management
Pushable/Fetchable — Broadcast and Action adopt entity-driven network interaction
Migrations — sequential schema migrations with constraint enforcement
Database trigger — prevents outbound outputs from entering the spendable set
Changed
blocks table — normalized from tx_proofs; stores block headers independently
tx_reqs removed — replaced by structural queries via Fetchable pattern
Earn XP for sharing
Sign in to get a personal referral link and earn XP every time someone visits through your link.
Bitcoin UI blocks for React.
BigBlocks.dev provides production‑ready libraries, authentication components, MCP servers, and VS Code tools for building Bitcoin applications.
WhoIAm
UI components of the SocialCert identity app
amountinator-react
React components for currency amounts + conversion
identity-react
React components for MetaNet identity resolution
No reviews yet — be the first.
require 'bsv-wallet-postgres'
# Connect to PostgreSQL
db = Sequel.connect('postgres://localhost/my_wallet')
BSV::Wallet::Postgres.connect(db)
# Compose the wallet
engine = BSV::Wallet::Engine.new(
store: BSV::Wallet::Postgres::Store.new,
utxo_pool: BSV::Wallet::Postgres::UTXOPool.new(store: store),
broadcast_queue: BSV::Wallet::Postgres::BroadcastQueue.new(arc_client: arc),
proof_store: BSV::Wallet::Postgres::ProofStore.new,
key_deriver: BSV::Wallet::KeyDeriver.new(private_key),
network: :mainnet
)
# Create a transaction (BRC-100 createAction)
result = engine.create_action(
description: 'payment to merchant',
outputs: [
{ satoshis: 5000, locking_script: recipient_script, basket: 'payments' }
],
labels: ['merchant']
)
# result[:txid] — 32-byte wire-order wtxid
# result[:tx] — Atomic BEEF binary (BRC-95)