Full stack Bitcoin software

Soft Forks

Configuring Bitcoin Server (bs): the command line, the configuration file, common setups, ports, services, performance, the store and the test chains.

1. Configured soft forks#

The consensus rules that bs enforces are set in [forks] (Settings Reference). Each soft fork can be turned on or off, on any network:

[forks]
bip16 = true
bip30 = true
bip34 = true
bip42 = true
bip65 = true
bip66 = true
bip68 = true
bip112 = true
bip113 = true
bip141 = true
bip143 = true
bip147 = true
bip341 = true
bip342 = true
bip54_timewarp = true
bip54_timespan = true
bip54_sigops = true
bip54_txsize = true
bip54_coinbase = true

A configured soft fork applies from its activation, as set in [bitcoin]. The store records the soft forks it was built under, in its envelope (Settings fixed at store creation). The other envelope settings govern the store for good, but its soft forks can be changed. When the configured soft forks differ from those of the store, bs changes the store to match, without a resync.

The forks that can be changed are the BIP soft forks above. The other [forks] settings, bip90 (a hard fork), difficult, retarget, signet and the network patches, stay as stored, and override the configuration as before.

2. Changing the soft forks of a store#

Edit [forks] and start bs. Each command that opens the store (a normal run, --information, --backup and so on) compares the soft forks first, and lists each change:

Soft fork [bip30] is configured but not stored, its rule applies to the store.
Soft fork [bip16] is stored but not configured, its rule no longer applies.
Existing snapshots will be deleted and interruption is not recoverable.
Press <enter> to change the soft forks of the store now.
Enter 'c' to stop without changing the store.

Enter changes the store, takes a snapshot, and continues. c stops with the store unchanged:

Store is unchanged, configure its soft forks to start without changes.

With -a (--accept), bs changes the store without prompting. A daemon or service has no console, so without -a it stops:

Soft fork changes require a console, or a start with --accept.

-t (--transform) makes the change, after the same prompt, then exits. It also applies a pending schema migration first (Store Migration). A restore (--restore) checks the restored store the same way, so a snapshot taken under other soft forks is brought to those configured.

The conditions are those of a migration (Before migrating):

3. What a change does#

The store is evaluated block by block from genesis under the configured soft forks, along the candidate chain and every stored branch. Each block whose rules change is then treated as follows:

Change Effect
Removed rule Nothing is revalidated. A block that was unconfirmable is reconsidered.
Added rule, header check Each header is checked again under the added rules (such as bip54_timewarp, bip54_timespan and the BIP34 style version minimums). A header that fails is marked unconfirmable, as is each header above it, and the candidate chain is popped below the first.
Added validation rule The block loses its validation state. The confirmed chain is popped below the lowest such block, and the blocks above are validated and confirmed again.
Popped confirmed chain The transaction pool is of the popped chain, so it is dropped and refills.
Bypassed block A block under the milestone or a checkpoint is not validated, so it is not popped or validated again.
bip341 removed The silent payment tables are dropped, since they are indexed under taproot.
bip341 added Blocks from node.silent_start_height are scanned again. Without silent payment indexing there is nothing to scan.
Genesis Never changed.

A witness rule (bip141, bip143, bip147, bip341 or bip342) cannot be added to a store created with node.require_witness = false, which does not hold witness data. The change is refused before the store is changed:

Database soft forks failed to change with error 'witness forks require witness'.

4. Timings#

The time is in proportion to the blocks that are validated again, since blocks under the milestone are not. These are indicative, measured on a 978,162 block mainnet store with milestone 950,000, on a development machine also running builds:

Change Time
Remove bip16 3 secs
Add bip16 7 secs, then about 85 secs validating the 28,162 blocks above the milestone
Add bip30, remove 11 rules 5 secs
Add the 11 rules 8 to 9 secs, then about 2 mins validating

5. Log lines#

Database soft forks are changing to those configured.
Database soft forks changed in {n} secs.
Snapshot is started.
Snapshot complete in {n} secs.

A failure is logged with its error:

Database soft forks failed to change with error '{message}'.

6. Signaling#

A miner signals the soft forks that it enforces, so the version of each block template follows the configured soft forks. There is no separate signaling setting.

Signaling is reported by getblocktemplate (version, rules and vbavailable) and the state of each deployment by getdeploymentinfo.

7. Compared with Bitcoin Core#

Bitcoin Core follows the same BIP9 model: it sets the bit of each deployment it implements while that deployment is started or locked in, on the same version base. The differences:

bs Bitcoin Core
Deployments Configured: each soft fork can be turned on or off, and is then enforced and signaled. Compiled in. csv and segwit are buried at fixed heights, and no other deployment is defined for mainnet.
Version override None. The version follows the configured soft forks. -blockversion, on regtest only.
Required rules in getblocktemplate Derived from what each active rule constrains: a rule of the coinbase or block solution must be declared. The version is returned as signaled. Set by name. The bit of a ! deployment the client does not declare is cleared from the version.
getdeploymentinfo csv, segwit and consensuscleanup are of type bip9, with their deployment state. csv and segwit are of type buried.

Copyright © 2011-2026 libbitcoin developers