Skip to content

Commit b6d493f

Browse files
committed
contrib/signet/README.md: Update miner description
1 parent e665438 commit b6d493f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

contrib/signet/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,28 @@ accept one claim per day. See `--password` above.
2121
miner
2222
=====
2323

24-
To mine the first block in your custom chain, you can run:
24+
You will first need to pick a difficulty target. Since signet chains are primarily protected by a signature rather than proof of work, there is no need to spend as much energy as possible mining, however you may wish to choose to spend more time than the absolute minimum. The calibrate subcommand can be used to pick a target appropriate for your hardware, eg:
2525

2626
cd src/
27-
CLI="./bitcoin-cli -conf=mysignet.conf"
2827
MINER="../contrib/signet/miner"
2928
GRIND="./bitcoin-util grind"
30-
ADDR=$($CLI -signet getnewaddress)
31-
$MINER --cli="$CLI" generate --grind-cmd="$GRIND" --address="$ADDR" --set-block-time=-1
32-
33-
This will mine a block with the current timestamp. If you want to backdate the chain, you can give a different timestamp to --set-block-time.
34-
35-
You will then need to pick a difficulty target. Since signet chains are primarily protected by a signature rather than proof of work, there is no need to spend as much energy as possible mining, however you may wish to choose to spend more time than the absolute minimum. The calibrate subcommand can be used to pick a target, eg:
36-
3729
$MINER calibrate --grind-cmd="$GRIND"
3830
nbits=1e00f403 for 25s average mining time
3931

4032
It defaults to estimating an nbits value resulting in 25s average time to find a block, but the --seconds parameter can be used to pick a different target, or the --nbits parameter can be used to estimate how long it will take for a given difficulty.
4133

42-
Using the --ongoing parameter will then cause the signet miner to create blocks indefinitely. It will pick the time between blocks so that difficulty is adjusted to match the provided --nbits value.
34+
To mine the first block in your custom chain, you can run:
4335

44-
$MINER --cli="$CLI" generate --grind-cmd="$GRIND" --address="$ADDR" --nbits=1e00f403 --ongoing
36+
CLI="./bitcoin-cli -conf=mysignet.conf"
37+
ADDR=$($CLI -signet getnewaddress)
38+
NBITS=1e00f403
39+
$MINER --cli="$CLI" generate --grind-cmd="$GRIND" --address="$ADDR" --nbits=$NBITS
40+
41+
This will mine a single block with a backdated timestamp designed to allow 100 blocks to be mined as quickly as possible, so that it is possible to do transactions.
42+
43+
Adding the --ongoing parameter will then cause the signet miner to create blocks indefinitely. It will pick the time between blocks so that difficulty is adjusted to match the provided --nbits value.
44+
45+
$MINER --cli="$CLI" generate --grind-cmd="$GRIND" --address="$ADDR" --nbits=$NBITS --ongoing
4546

4647
Other options
4748
-------------
@@ -50,9 +51,11 @@ The --debug and --quiet options are available to control how noisy the signet mi
5051

5152
Instead of specifying --ongoing, you can specify --max-blocks=N to mine N blocks and stop.
5253

53-
Instead of using a single address, a ranged descriptor may be provided instead (via the --descriptor parameter), with the reward for the block at height H being sent to the H'th address generated from the descriptor.
54+
The --set-block-time option is available to manually move timestamps forward or backward (subject to the rules that blocktime must be greater than mediantime, and dates can't be more than two hours in the future). It can only be used when mining a single block (ie, not when using --ongoing or --max-blocks greater than 1).
55+
56+
Instead of using a single address, a ranged descriptor may be provided via the --descriptor parameter, with the reward for the block at height H being sent to the H'th address generated from the descriptor.
5457

55-
Instead of calculating a specific nbits value, --min-nbits can be specified instead, in which case the minimum signet difficulty will be targeted.
58+
Instead of calculating a specific nbits value, --min-nbits can be specified instead, in which case the minimum signet difficulty will be targeted. Signet's minimum difficulty corresponds to --nbits=1e0377ae.
5659

5760
By default, the signet miner mines blocks at fixed intervals with minimal variation. If you want blocks to appear more randomly, as they do in mainnet, specify the --poisson option.
5861

@@ -76,5 +79,5 @@ These steps can instead be done explicitly:
7679
$MINER --cli="$CLI" solvepsbt --grind-cmd="$GRIND" |
7780
$CLI -signet -stdin submitblock
7881

79-
This is intended to allow you to replace part of the pipeline for further experimentation, if desired.
82+
This is intended to allow you to replace part of the pipeline for further experimentation (eg, to sign the block with a hardware wallet).
8083

0 commit comments

Comments
 (0)