@@ -98,27 +98,41 @@ CREATE TABLE IF NOT EXISTS national_ids (
9898
9999-- ─────────────────────────────────────────────────────────────────────────────
100100-- National Finance IDs (source/national/NationalFinanceID.java)
101- -- Full person-aspect profile populated from the initial Telnet connection
101+ -- Full person-aspect profile populated from the initial Telnet connection.
102+ -- Columns mirror every field in NationalFinanceID.java exactly.
102103-- ─────────────────────────────────────────────────────────────────────────────
103104CREATE TABLE IF NOT EXISTS national_finance_ids (
104- id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
105- national_id BIGINT UNSIGNED NOT NULL,
106- remote_address VARCHAR(45) NOT NULL DEFAULT '',
105+ id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
106+ -- 8-digit public National ID (references national_ids.eight_digit_id)
107+ national_id BIGINT UNSIGNED NOT NULL,
108+ -- IPv4/IPv6 of the Telnet client that submitted this record
109+ remote_address VARCHAR(45) NOT NULL DEFAULT '',
110+ -- Estimated intelligence quotient
107111 iq SMALLINT UNSIGNED NOT NULL DEFAULT 0,
108- education_level VARCHAR(128) NOT NULL DEFAULT '',
109- social_skills TINYINT UNSIGNED NOT NULL DEFAULT 0, -- 0-100
110- equipment TEXT NULL,
111- trust_level TINYINT UNSIGNED NOT NULL DEFAULT 0, -- 0-100
112- parent_one VARCHAR(255) NOT NULL DEFAULT '',
113- parent_two VARCHAR(255) NOT NULL DEFAULT '',
114- suspects TEXT NULL, -- probable beliefs / societal settings
115- social_spotting TEXT NULL, -- perceived social placement
116- promissory_note DECIMAL(18,2) NOT NULL DEFAULT 0.00, -- projected profit value
117- created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
118- FOREIGN KEY fk_nfid_nat (national_id) REFERENCES national_ids(eight_digit_id) ON DELETE CASCADE,
119- INDEX idx_national_id (national_id),
120- INDEX idx_trust (trust_level),
121- INDEX idx_created (created_at)
112+ -- Highest formal education: none/high school/associates/bachelors/masters/phd/trade
113+ education_level VARCHAR(128) NOT NULL DEFAULT '',
114+ -- Social aptitude score 0-100
115+ social_skills TINYINT UNSIGNED NOT NULL DEFAULT 0,
116+ -- Comma-separated hardware/tools/resources (e.g. laptop,radio,vehicle)
117+ equipment TEXT NULL,
118+ -- Institutional trust score 0-100 (higher = more trusted by the national system)
119+ trust_level TINYINT UNSIGNED NOT NULL DEFAULT 0,
120+ -- Full name of first parent or legal guardian
121+ parent_one VARCHAR(255) NOT NULL DEFAULT '',
122+ -- Full name of second parent or legal guardian
123+ parent_two VARCHAR(255) NOT NULL DEFAULT '',
124+ -- Probable beliefs, ideological settings, and societal tendencies
125+ suspects TEXT NULL,
126+ -- Where society most likely places this person (perceived class/role/standing)
127+ social_spotting TEXT NULL,
128+ -- Promissory note value USD — projected future profit associated with this person
129+ promissory_note DECIMAL(18,2) NOT NULL DEFAULT 0.00,
130+ -- Record creation timestamp
131+ created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
132+ FOREIGN KEY fk_nfid_nat (national_id) REFERENCES national_ids(eight_digit_id) ON DELETE CASCADE,
133+ INDEX idx_nfid_national_id (national_id),
134+ INDEX idx_nfid_trust (trust_level),
135+ INDEX idx_nfid_created (created_at)
122136) ENGINE=InnoDB;
123137
124138-- ─────────────────────────────────────────────────────────────────────────────
@@ -192,6 +206,58 @@ CREATE TABLE IF NOT EXISTS fbi (
192206 INDEX idx_flagged (flagged_at)
193207) ENGINE=InnoDB;
194208
209+ -- ─────────────────────────────────────────────────────────────────────────────
210+ -- Bitcoin transactions (source/bitcoin/*)
211+ --
212+ -- Columns
213+ -- national_id 8-digit National ID of the person owning this record
214+ -- created_at when the transaction record was first created
215+ -- updated_at last modification timestamp
216+ -- source_ip IPv4/IPv6 of the originating party
217+ -- dest_ip IPv4/IPv6 of the destination party
218+ -- wallet_signature Bitcoin wallet signature / signed message (hex or base64)
219+ -- imagograph binary object up to 7 MB — e.g. a signed image proof
220+ -- final_signatory name or identifier of the final authorising signatory
221+ -- aes_key_source AES-256 key (32 bytes, stored as 64-char hex) for source party
222+ -- aes_key_dest AES-256 key for destination party
223+ -- aes_key_owner AES-256 key for the record owner (may equal source or dest)
224+ --
225+ -- Note: imagograph uses LONGBLOB (max 4 GB capacity); MySQL will accept up to
226+ -- max_allowed_packet bytes per row — set to 10M below to cover 7 MB objects.
227+ -- ─────────────────────────────────────────────────────────────────────────────
228+
229+ -- Allow rows up to 10 MB so the 7 MB imagograph column can be written
230+ SET GLOBAL max_allowed_packet = 10485760;
231+
232+ CREATE TABLE IF NOT EXISTS bitcoin_transactions (
233+ id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
234+ -- Person-level owner: 8-digit National ID
235+ national_id BIGINT UNSIGNED NOT NULL,
236+ -- Timestamps
237+ created_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
238+ updated_at DATETIME(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)
239+ ON UPDATE CURRENT_TIMESTAMP(6),
240+ -- Network addresses
241+ source_ip VARCHAR(45) NOT NULL DEFAULT '', -- originating party IPv4/IPv6
242+ dest_ip VARCHAR(45) NOT NULL DEFAULT '', -- destination party IPv4/IPv6
243+ -- Bitcoin wallet signature (hex/base64 encoded signed message, up to 8 KB)
244+ wallet_signature VARCHAR(8192) NOT NULL DEFAULT '',
245+ -- Binary image/proof object — up to 7 MB; stored as raw bytes (LONGBLOB)
246+ imagograph LONGBLOB NULL,
247+ -- Final authorising signatory name or identifier
248+ final_signatory VARCHAR(512) NOT NULL DEFAULT '',
249+ -- AES-256 keys stored as 64-character lowercase hex strings (32 raw bytes each)
250+ aes_key_source CHAR(64) NOT NULL DEFAULT '', -- key for the source party
251+ aes_key_dest CHAR(64) NOT NULL DEFAULT '', -- key for the destination party
252+ aes_key_owner CHAR(64) NOT NULL DEFAULT '', -- key for the record owner
253+ FOREIGN KEY fk_btc_nat (national_id) REFERENCES national_ids(eight_digit_id) ON DELETE CASCADE,
254+ INDEX idx_btc_national_id (national_id),
255+ INDEX idx_btc_source_ip (source_ip),
256+ INDEX idx_btc_dest_ip (dest_ip),
257+ INDEX idx_btc_created (created_at),
258+ INDEX idx_btc_signatory (final_signatory(64))
259+ ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
260+
195261SQL
196262
197263echo " [N21] All tables created successfully."
0 commit comments