refactor: remove bal-pusher-enhanced and update docs/env
- Remove src/bin/bal-pusher-enhanced.rs (synchronous pusher variant) - Remove bal-pusher.env and bal-pusher.sh from git tracking (now in .gitignore) - Update all documentation to remove references to bal-pusher-enhanced: * 01_project_overview.md * 02_glossary_and_bitcoin_domain.md * 03_architecture_and_data_flow.md * 04_modules_detail.md * 05_api_reference.md (remove rawblock ZMQ section, update references) * 08_security_audit.md (remove references to bal-pusher-enhanced in DoS and ZMQ sections) * 09_references_and_links.md - Build verified: cargo check passes for bal-pusher and bal-server binaries
This commit is contained in:
@@ -14,7 +14,7 @@ An **XPub** (Extended Public Key) is a master key that allows derivation of chil
|
||||
|
||||
## Locktime and nLockTime
|
||||
|
||||
A Bitcoin transaction can include a `nLockTime` field. If it is non-zero and below `500_000_000`, it is interpreted as a **block height** before which the transaction cannot be mined. If above, it is a **Unix timestamp**. The system evaluates whether the locktime has been met by comparing it against the blockchain's median time. See `src/bin/bal-pusher.rs` and `src/bin/bal-pusher-enhanced.rs` for the evaluation logic.
|
||||
A Bitcoin transaction can include a `nLockTime` field. If it is non-zero and below `500_000_000`, it is interpreted as a **block height** before which the transaction cannot be mined. If above, it is a **Unix timestamp**. The system evaluates whether the locktime has been met by comparing it against the blockchain's median time. See `src/bin/bal-pusher.rs` for the evaluation logic.
|
||||
|
||||
## P2WPKH (Pay to Witness Public Key Hash)
|
||||
|
||||
@@ -22,13 +22,13 @@ P2WPKH is a native SegWit output format that reduces transaction size and lowers
|
||||
|
||||
## Bitcoin Block Header (80 bytes)
|
||||
|
||||
A Bitcoin block header is a fixed 80-byte structure containing `version` (4 bytes), `previous block hash` (32 bytes), `merkle root` (32 bytes), `timestamp` (4 bytes), `bits` (4 bytes), and `nonce` (4 bytes). The `bal-pusher-enhanced` binary reads the raw 80-byte block from the `rawblock` ZMQ topic and extracts the timestamp from byte offset 68-72. This avoids the need for an RPC call to `getblockchaininfo`. See `src/bin/bal-pusher-enhanced.rs`.
|
||||
A Bitcoin block header is a fixed 80-byte structure containing `version` (4 bytes), `previous block hash` (32 bytes), `merkle root` (32 bytes), `timestamp` (4 bytes), `bits` (4 bytes), and `nonce` (4 bytes). The `bal-pusher` binary uses the `hashblock` ZMQ topic and calls `getblockchaininfo` to get the `mediantime`.
|
||||
|
||||
## ZMQ Publisher
|
||||
|
||||
Bitcoin Core can publish notifications over ZeroMQ. The project listens to two topics:
|
||||
- **`hashblock`**: Sends the 32-byte block hash when a new block is found. The `bal-pusher` uses this to trigger an update cycle.
|
||||
- **`rawblock`**: Sends the full raw block (including the 80-byte header). The `bal-pusher-enhanced` uses this to derive the timestamp without RPC.
|
||||
- **`rawblock`**: Sends the full raw block (including the 80-byte header). This is not used by the current `bal-pusher` implementation.
|
||||
|
||||
The ZMQ endpoint is per-network:
|
||||
- Bitcoin: `tcp://127.0.0.1:28332`
|
||||
@@ -41,7 +41,7 @@ The ZMQ endpoint is per-network:
|
||||
|
||||
The project communicates with a local Bitcoin Core node via the JSON-RPC interface. Key methods used are:
|
||||
- `sendrawtransaction`: To broadcast a pending transaction.
|
||||
- `getblockchaininfo`: To retrieve the current block height and `mediantime` (used to evaluate locktime). `Note:` `bal-pusher-enhanced` does not use this method to avoid RPC round-trips for median time.
|
||||
- `getblockchaininfo`: To retrieve the current block height and `mediantime` (used to evaluate locktime).
|
||||
- `getblock`: To retrieve block data in `bal-pusher` (for median time calculation).
|
||||
|
||||
Authentication is done via `bitcoincore-rpc` using either `UserPass` or `CookieFile` (the `cookie` file is stored in `~/.bitcoin/.cookie`). See `src/bin/bal-pusher.rs`.
|
||||
|
||||
Reference in New Issue
Block a user