Add receipt-bound native kit delivery and Paper metadata verification

This commit is contained in:
unimatrixgit 2026-11-16 02:45:25 +01:00
commit 99b4c89ee9

View file

@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS dune_kit_deliveries (
id UUID PRIMARY KEY,
buyer_uuid UUID NOT NULL,
snapshot_json TEXT NOT NULL CHECK (octet_length(snapshot_json) <= 65536),
snapshot_hash CHAR(64) NOT NULL CHECK (snapshot_hash ~ '^[a-f0-9]{64}$'),
created_at BIGINT NOT NULL CHECK (created_at > 0),
delivered_at BIGINT NULL CHECK (delivered_at IS NULL OR delivered_at > 0)
);
CREATE INDEX IF NOT EXISTS dune_kit_deliveries_pending ON dune_kit_deliveries(buyer_uuid,created_at,id) WHERE delivered_at IS NULL;