Blackcoin More Pre-V3.2 Fee Double-Counting Bug & Mainnet Incident Report
Date: 2026-11-30
Affected Versions: Blackcoin More Core 22.x through v26.2.0 and v28.4.0 (pre-Protocol V3.2)
Fixed Versions: Blackcoin More v26.2.1 and v28.4.1
Status: RESOLVED — Proof-of-Stake Protocol V3.2 ACTIVE (nProtocolV3_2Time = 1796043600, 2026-11-30 13:00:00 UTC) as of mainnet block 6,131,097 (28612872c6c56b9d0cc5ffa428cd6e698f700c3af8e937bae26a56f281bdea68, 2026-11-30 13:00:32 UTC)
Audit Snapshot Height: 6,130,971 (verified via txindex + coinstatsindex on mainnet; post-activation verified through 6,131,190)
1. Executive Summary
A consensus accounting bug introduced during the Core 22.x rebase on 2022-10-29 (e843e0c1ea) caused Chainstate::ConnectBlock() to add every normal transaction's fee to nFees twice (2×). Because PoS block reward validation checked nActualStakeReward <= nFees + 1.5 BLK, a modified staker could include a private self-transaction paying an arbitrarily large fee F inside their own winning PoS block and claim 2F + 1.5 BLK in the coinstake—recovering their own fee F while minting an additional F BLK out of thin air.
Between 2026-11-21 (H=6119547) and 2026-11-29 (H=6129368), an attacker funded with 10,336.97351200 BLK from an exchange (88536d71... at H=6112129) exploited this bug 7 times on mainnet, minting +33,878.87271282 BLK in unbacked inflation. On an 8th attempt (H=6130396, fee = 8,664.89397412 BLK), the fee transaction reached the public mempool and was mined by the honest dev-fund staker (BKDvboD1...), which claimed only 1× fees (0 inflation) and subsequently burned the entire 9,077.61289112 BLK coinstake at H=6130921 (553db0d5...), bringing net supply inflation down to +24,801.25982170 BLK.
As of block 6,130,971, 35,554.62559170 BLK (virtually 100% of the attacker's initial capital + net inflated profit) remains unspent in 4 UTXOs on the attacker's addresses (BTkBpzBK... and BNEUbSDg...).
Proof-of-Stake Protocol V3.2 (1796043600, 2026-11-30 13:00:00 UTC) is now active on mainnet—it activated cleanly at block 6,131,097 (28612872c6c56b9d0cc5ffa428cd6e698f700c3af8e937bae26a56f281bdea68, nTime = 1796043632, 2026-11-30 13:00:32 UTC), permanently closing this bug for every block with block.GetBlockTime() > 1796043600.
2. Why This Was Possible in the First Place (Root Cause & Git Origin)
2.1 How the Bug Entered the Codebase (e843e0c1ea, 2022-10-29)
The bug was a classic upstream merge regression when rebasing Blackcoin More from Bitcoin Core 0.13 (2.13.x) onto Bitcoin Core 22.x:
-
In Blackcoin More 2.13 (Core 0.13, pre-merge parent
bb07fc5e59,src/main.cpp:2554-2560):
Core 0.13'sCheckInputs()did not returntxfeetoConnectBlock(). Blackcoin computednFeesonce insideConnectBlock():if (!tx.IsCoinBase()) { if (tx.IsCoinStake()) nActualStakeReward = tx.GetValueOut() - view.GetValueIn(tx); else nFees += view.GetValueIn(tx) - tx.GetValueOut(); }In Core 0.13 (
2.13.x), fees were counted once—there was no double-counting bug. -
In Bitcoin Core 22.x (upstream parent
6164618964):
Bitcoin Core had refactoredConnectBlock()so thatConsensus::CheckTxInputs(..., CAmount& txfee)computed and returnedtxfee, andConnectBlock()immediately addednFees += txfee;right afterCheckTxInputs(). -
In
e843e0c1ea("Update to Core 22.x", 2022-10-29,src/validation.cpp:1634-1680):
The merge kept Bitcoin Core 22'snFees += txfee;at line 1644 and also ported Blackcoin's legacy Core 0.13if (tx.IsCoinStake()) ... else nFees += view.GetValueIn(tx) - tx.GetValueOut();35 lines further down at line 1679:// First addition (from Bitcoin Core 22.x, line 1644): if (!Consensus::CheckTxInputs(tx, tx_state, view, pindex->nHeight, txfee, ...)) { ... } nFees += txfee; ... // Second addition (ported from Blackcoin 2.13 / Core 0.13, lines 1676-1679): if (tx.IsCoinStake()) nActualStakeReward = tx.GetValueOut() - view.GetValueIn(tx); else nFees += view.GetValueIn(tx) - tx.GetValueOut();Because
Consensus::CheckTxInputs()skips fee calculation whentx.IsCoinStake()(txfee == 0for the coinstake) and returnsnValueIn - value_outfor every normal transaction, every normal transaction's fee was added tonFeestwice inConnectBlock().
2.2 Why Consensus Allowed Unlimited Inflation
At the end of ConnectBlock() (src/validation.cpp:2727-2738 in 28.4.1, 2429-2440 in 26.2.1):
if (block.IsProofOfStake() && params.GetConsensus().IsProtocolV3(block.GetBlockTime())) {
const CAmount subsidy = GetBlockSubsidy(pindex->nHeight, params.GetConsensus(), true); // 1.5 BLK
const CAmount blockReward = nFees + subsidy; // nFees == 2 * actual_fees!
if (nActualStakeReward > blockReward) {
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-cs-amount");
}
}
Four design properties combined to make this directly exploitable:
- No maximum transaction fee in consensus or P2P mempool:
Consensus::CheckTxInputs()only enforcesnValueIn >= value_outandfee >= GetMinFee. Any unallocated input valueFis a valid fee (even9,558 BLKin a single tx). - No block-level conservation-of-money invariant prior to V3.2:
ConnectBlock()only validatednActualStakeReward <= nFees + 1.5 BLK, trusting the double-countednFeesvariable rather than checkingsum(all_outputs) <= sum(all_inputs) + 1.5 BLK. - Private block inclusion by a staker: A staker does not need to broadcast the huge-fee self-transaction to the public mempool. By building a modified staker that holds a self-tx with fee
Fprivately and only inserts it when that node finds a valid PoS kernel, the staker guarantees their own coinstake claims the reward—payingFin the self-tx and collecting2F + 1.5 BLKin the coinstake for a risk-free net profit of+F BLKper winning block (compounding exponentially with each win). - Why it went unnoticed for 4 years (2022–2026):
- Honest
BlockAssembler::CreateNewBlock()+CreateCoinStake()only accumulates fees once (1×), so unmodified stakers never claimed more than1.5 + 1 × fees. - Standard wallet RPCs enforce
DEFAULT_TRANSACTION_MAXFEE = 1 BLKandsendrawtransactionenforcesDEFAULT_MAX_RAW_TX_FEE_RATE = 0.1 BLK/kB, so normal block fees were tiny (~0.01 BLK) and no honest block ever exceeded1.5 + 1 × fees. - Historical
coinstatsindexconfirms zero inflation across all112,128blocks fromH=6,000,000throughH=6,112,128(delta total_unspendable = +0.00000001).
- Honest
3. Complete Mainnet Incident Timeline (H=6112129 → H=6130971)
Verified directly against mainnet via blackmore-cli (txindex + coinstatsindex). Across the entire window 6,112,128..6,130,971, only 8 blocks changed total_unspendable_amount: the 7 exploit blocks below (-33,878.87271282 unclaimed rewards = inflation) and the 1 dev-fund burn block (+9,077.61289112 OP_RETURN burn).
Phase 1: Exchange Funding & Staking UTXO Preparation (2026-11-15 – 2026-11-21)
| Height | Timestamp (UTC) | Transaction / Event | Flow & Details |
|---|---|---|---|
6112129 |
2026-11-15 18:45:20 (1794768320) |
88536d71efac22c04f540c88b2a8e5e03939e1fa72d9c4c9139d6a64a8660285 |
Consolidates 4 exchange inputs (6888.97 + 1.00 + 0.894778 + 3446.108734 = 10,336.97351200 BLK) → 10,334.97351200 BLK to BDZ22QiBcQXCKGRiEN9iFwgNEav8rTnZhB (fee 2.00 BLK, 0 inflation). |
6112140 |
2026-11-15 18:58:08 (1794769088) |
3888f10046833561537c62f62a79f1426735c231811d56e989de94f9c38fdeb8 |
Hop: 10,334.97351200 → 10,332.97351200 BLK to BSe1HMvArrf2dRZzSYkSdHf8tzf6BAfhgD (fee 2.00 BLK). |
6112184 |
2026-11-15 19:52:48 (1794772368) |
d7ad6b5306e928ad849a05d6491c993f95081ef240f6ab68c697773f8e73c474 |
Hop: 10,332.97351200 → 10,330.97351200 BLK to BHSvwdPe99Nz8ck8CbcZJQdk6vmiWv5e9r (fee 2.00 BLK). |
6113115 |
2026-11-16 13:14:08 (1794834848) |
becb053d..., 19ee4976..., 68920ddb..., 11c1a76e... |
Chained split of 10,330.97351200 BLK into four staking UTXOs on BTkBpzBKX2gafuBQjaMuj5tUigAmyBBDVw (3000, 3000, 3000, 1000 BLK) + 330.97261200 change (BHLUd1n...). |
6118945 |
2026-11-21 02:04:16 (1795226656) |
9d2f7d3946c386fb... (normal coinstake) |
Normal PoS stake on one 3,000 BLK UTXO (3000.00 → 3001.50969000, 0 inflation). |
6119446 |
2026-11-21 11:23:44 (1795260224) |
96e3143e29b9d5f1... |
Re-splits 4,000 BLK (3000 + 1000) into inputs ready for staking + fee-tx pairing. |
Phase 2: Seven Active Double-Fee Inflation Blocks (2026-11-21 – 2026-11-29)
Starting at H=6119547 (1 block after defaultAssumeValid = 6119546), the attacker compounded their balance across 7 winning PoS blocks. In every exploit block, the attacker's modified staker placed a huge-fee self-tx sending small change to BNEUbSDgDqe5pKZ8HTgdPsS675DpbMhD6g, claimed 2× the fee in the coinstake (to BTkBpzBKX2gafuBQjaMuj5tUigAmyBBDVw, or BK9nPwq2YoDn6r8ypExHvYomzHeQ9N7gG9 in block 6121851), and even included the standard 0.30 BLK dev-fund output (BKDvboD1...):
| # | Height | Timestamp (UTC) | Block Hash | Fee-Tx (change → BNEUbSDg...) |
Coinstake Tx | Stake In (BLK) | Coinstake Out (BLK) | Self-Tx Fee (BLK) | Net Inflated (BLK) |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 6119547 |
2026-11-21 13:20:00 (1795267200) |
c10aed48e1f4cb87... |
5924c82eb7b9f16e... (3000.00 → 1.00) |
c0e417017ca36a9a... |
1,500.60000000 |
7,500.10969000 |
2,999.00000000 |
+2,999.00000000 |
| 2 | 6121192 |
2026-11-22 20:01:04 (1795377664) |
bd32521bd672c025... |
1b7aafdfcbbcd2c2... (2500.40 → 556.21) |
3fa983fcad039f74... |
3,749.90969000 |
7,639.80733332 |
1,944.19397666 |
+1,944.19397666 |
| 3 | 6121851 |
2026-11-23 08:13:20 (1795421600) |
b44db565c5288a72... |
cecae72923aa5342... (3749.90 → 1203.80) |
86bf3cc346944327... |
1,499.60000000 |
6,593.30133588 |
2,546.09598444 |
+2,546.09598444 |
| 4 | 6123835 |
2026-11-24 21:04:48 (1795554288) |
80465ece35ea16ea... |
ab3f1beba4ca0149... (5911.73 → 295.68) |
8939fe7e44479f45... |
1,500.60969000 |
12,734.21835922 |
5,616.04965111 |
+5,616.04965111 |
| 5 | 6124583 |
2026-11-25 11:06:08 (1795604768) |
fad99495e0832121... |
7902aee553a6e6b5... (6888.68 → 1534.46) |
3396674bae078ed7... |
6,366.95000000 |
17,076.89872598 |
5,354.22064849 |
+5,354.22064849 |
| 6 | 6127636 |
2026-11-27 20:16:32 (1795810592) |
e37ea27bdb54f295... |
8c8a12e431ac8053... (6366.97 → 506.37) |
0df6d3c1dc8029cf... |
3,819.75733332 |
15,542.45603104 |
5,860.59450386 |
+5,860.59450386 |
| 7 | 6129368 |
2026-11-29 04:42:08 (1795927328) |
128e307319ed482a... |
a898f0ab704da8eb... (10579.13 → 1020.41) |
f7ce044ed5751566... |
7,771.08603104 |
26,890.03161756 |
9,558.71794826 |
+9,558.71794826 |
| Subtotal Inflated | +33,878.87271282 |
Phase 3: Attempt #8 Leaked & Dev-Fund Burn (2026-11-29 – 2026-11-30)
| Height | Timestamp (UTC) | Block Hash | Transaction | Details | Supply Effect |
|---|---|---|---|---|---|
6130396 |
2026-11-29 23:53:52 (1795996432) |
e5b1f83f9c585ff4... |
Fee-tx 5635567f803b9962... + Coinstake cfd6b70d94c87365... |
Attacker's 8th attempt (8,791.47922228 → 126.58524816 to BNEUbSDg..., fee = 8,664.89397412 BLK) reached the public mempool. The honest dev-fund staker (BKDvboD1CzZ5KycP1FRSXRoi7XXhHoQhS1, input 411.20968000 BLK) won the block and claimed exactly 1× fees (8,664.90366412 + 1.50 = 8,666.40366412), outputting 4,538.80 + 4,538.81334412 = 9,077.61334412 BLK. |
0.00000000 (attacker lost 8,664.89 BLK) |
6130921 |
2026-11-30 09:42:08 (1796031728) |
6e5de60fe44997c3... |
Burn tx 553db0d581743da9... |
Immediately after 500-block maturity (6130396 + 500 = 6130896), the dev-fund wallet owner burned the entire coinstake output (9,077.61289112 BLK) via OP_RETURN "Blackcoin More " (426c61636b636f696e204d6f726520). |
-9,077.61289112 |
Phase 4: Proof-of-Stake Protocol V3.2 Activation (2026-11-30 13:00:32 UTC)
| Height | Timestamp (UTC) | Block Hash | Event | Supply Effect |
|---|---|---|---|---|
6131096 |
2026-11-30 13:00:00 (1796043600) |
eb777df99b17f9a9... |
Final pre-V3.2 block (nTime == nProtocolV3_2Time). |
0.00000000 |
6131097 |
2026-11-30 13:00:32 (1796043632) |
28612872c6c56b9d... |
First Proof-of-Stake Protocol V3.2 block (nTime > 1796043600). Double-fee bug permanently closed on mainnet. |
0.00000000 |
4. Supply Accounting & Current Location of Attacker Funds (H=6130971)
Supply Reconciliation (H=6112128 → H=6130971, 18,843 blocks)
total_amountatH=6112128:64,545,102.32846056 BLK(total_unspendable:18,351,057.83648030)total_amountatH=6130971:64,598,168.08828226 BLK(total_unspendable:18,326,256.57665860)- Actual total supply change over
18,843blocks:+53,065.75982170 BLK - Expected normal PoS emission (
18,843 × 1.5 BLK, ~1.1%/year baseline):+28,264.50000000 BLK - Total gross exploit inflation (7 blocks, strictly above the normal
1.5 BLKsubsidy per block):+33,878.87271282 BLK - Less dev-fund
OP_RETURNburn (H=6130921):-9,077.61289112 BLK, which permanently removed from circulating supply:8,664.89397412 BLK— attacker's leaked fee from block61303961.50000000 BLK— block6130396's normal PoS block subsidy411.20968000 BLK— dev-fund's own staked principal0.00923700 BLK— net normal transaction fees (0.00969000collected in6130396minus0.00045300burn-tx fee in6130921)
- Net unbacked supply inflation above normal emission:
+24,801.25982170 BLK(53,065.75982170 - 28,264.50000000 = 33,878.87271282 - 9,077.61289112, ~0.038%of circulating supply)
Unspent Attacker UTXOs (as of H=6130971)
Virtually 100% of the attacker's capital (~10,331 seed + 33,879 inflated − 8,665 lost in 6130396 + normal PoS rewards ≈ 35,555 BLK) remains unspent on-chain and has not yet moved back to an exchange:
| Address | Outpoint (txid:vout) |
Created At Height | Amount (BLK) | Status |
|---|---|---|---|---|
BTkBpzBKX2gafuBQjaMuj5tUigAmyBBDVw |
3396674bae078ed72b4edbf99dad3508730d1be3516d20f122a52ea832b68469:2 |
6124583 |
8,538.30872598 |
UNSPENT |
BTkBpzBKX2gafuBQjaMuj5tUigAmyBBDVw |
f7ce044ed5751566695484375f52bee8b3863939a95477ddb89eba727de415e3:1 |
6129368 |
13,444.86000000 |
UNSPENT |
BTkBpzBKX2gafuBQjaMuj5tUigAmyBBDVw |
f7ce044ed5751566695484375f52bee8b3863939a95477ddb89eba727de415e3:2 |
6129368 |
13,444.87161756 |
UNSPENT |
BNEUbSDgDqe5pKZ8HTgdPsS675DpbMhD6g |
5635567f803b99625958110673f2a5178e21a09054ee3a838c774feb63364beb:0 |
6130396 |
126.58524816 |
UNSPENT |
| Total Directly Unspent | 35,554.62559170 |
5. Remediation: Proof-of-Stake Protocol V3.2 (Active at Block 6,131,097)
Both Blackcoin More 26.2.1 (src/validation.cpp:2374, 2444) and 28.4.1 (src/validation.cpp:2671, 2742, commits 87bf9236c8 / ddf6c16bfe and e5ef59148c) permanently closed this bug via two independent consensus checks now enforced on mainnet under IsProtocolV3_2(block.GetBlockTime()) (block.GetBlockTime() > 1796043600):
- Remove the duplicate fee addition:
if (tx.IsCoinStake()) { nActualStakeReward = tx.GetValueOut() - view.GetValueIn(tx); } else if (!params.GetConsensus().IsProtocolV3_2(block.GetBlockTime())) { // Legacy pre-V3.2 replay only ... nFees += extra_fee; } - Enforce a block-level conservation-of-money invariant (
bad-blk-inflation):if (params.GetConsensus().IsProtocolV3_2(block.GetBlockTime())) { const CAmount subsidy = GetBlockSubsidy(pindex->nHeight, params.GetConsensus(), block.IsProofOfStake()); if (total_block_out > total_block_in + arith_uint256(static_cast<uint64_t>(subsidy))) { return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-blk-inflation"); } }
Because Blackcoin's GetMedianTimePast() returns GetBlockTime() post-V2 (src/chain.h:312-316) and ContextualCheckBlockHeader() enforces block.GetBlockTime() > pindexPrev->GetMedianTimePast() (src/validation.cpp:4302), block timestamps are strictly monotonic—so block 6,131,097 (28612872c6c56b9d0cc5ffa428cd6e698f700c3af8e937bae26a56f281bdea68, nTime = 1796043632, immediately following the final pre-V3.2 block 6,131,096 at nTime = 1796043600) permanently locked mainnet into Protocol V3.2 with no MTP lag.