Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update block rewards after token sale #40

Closed
domob1812 opened this issue Jun 24, 2018 · 5 comments
Closed

Update block rewards after token sale #40

domob1812 opened this issue Jun 24, 2018 · 5 comments
Assignees
Milestone

Comments

@domob1812
Copy link
Collaborator

Once the token sale is complete, we have to do a hard fork that updates the block rewards (currently set to 1 CHI) to higher values such that the final money supply is correct. At this point, we should also make the block rewards depend on the PoW algorithm (Neoscrypt 75%, SHA256D 25%) as per our mining design.

@domob1812
Copy link
Collaborator Author

Note that the algo-dependent block reward is a bit tricky. The straight-forward solution is to just assume we get one Neoscrypt and one SHA256D block per minute, and then compute the rewards for each algo based on the halving schedule (and still doing the halving at a predefined block height, like 4.2M).

But by doing so, the resulting coin supply may vary depending on how many blocks of each algo are mined exactly. For instance, if only Neoscrypt blocks would be mined, then it would be 50% too large; if only SHA256D blocks are mined, it would be 50% too small. This is likely not a big deal, though, as over a halving period of four years it is very likely that blocks would be evenly distributed between the algos, since the difficulties adjust independently. But it means we cannot guarantee the final money supply.

Alternatively, we could go away from halving at given block heights, and instead keep track (in the chain state) of the remaining coin supply available for PoW. Then, each block can "take out" from this supply as much reward as is appropriate for its algo; and when doing so would drop the supply below a 2^(-n) level, the block rewards are halved. This has the advantage of being flexible and also simple in that the desired PoW coin supply can just be specified and doesn't have to be defined indirectly through a fixed halving schedule. Something like this exists already in iXcoin.

@domob1812
Copy link
Collaborator Author

Another, perhaps simpler solution for making the block-reward algorithm-dependent while ensuring an exactly fixed supply: Instead of changing the actual reward per block for the two algorithms, we could change the spacing of blocks. For instance, Neoscrypt-blocks could be scheduled every 30 seconds, while SHA-256d blocks are scheduled only every 90 seconds. This means that - even if they have nominally the same reward - SHA-256d rewards will be 25% and Neoscrypt rewards 75% of the total supply. (It also means that blocks will be created every 22.5 seconds on average, but that is either not an issue we care about or we would just tweak the numbers a bit to get back to 30 seconds.)

@domob1812 domob1812 added this to the 1.1 milestone Oct 17, 2018
domob1812 added a commit that referenced this issue Oct 17, 2018
This implements a hard fork scheduled at certain heights (500 on regtest,
12000 on testnet and not yet active on mainnet) that allows non-zero
nonce values in the main block header (not the fake header).  This solves
#50.

Forks are added to Consensus::Params similar to how they are handled in
Huntercoin.  For now, there's only this one, but there will likely be
more in the future; for instance, to change the standalone mining
algorithm or when we implement ephemeral timestamps.

The created POST_ICO fork will contain more things in the future, namely
a change to the block reward and block interval as described in
#40.
@domob1812 domob1812 self-assigned this Oct 17, 2018
@domob1812
Copy link
Collaborator Author

Discussed this offline with @xaya, we'll go for tweaking the block interval to achieve the desired algo-dependent block reward. Implementing this is tracked in #67. After that is done and the final coin supply fixed, we can change the block reward for this issue.

domob1812 added a commit that referenced this issue Nov 4, 2018
This implements a hard fork scheduled at certain heights (500 on regtest,
12000 on testnet and not yet active on mainnet) that allows non-zero
nonce values in the main block header (not the fake header).  This solves
#50.

Forks are added to Consensus::Params similar to how they are handled in
Huntercoin.  For now, there's only this one, but there will likely be
more in the future; for instance, to change the standalone mining
algorithm or when we implement ephemeral timestamps.

The created POST_ICO fork will contain more things in the future, namely
a change to the block reward and block interval as described in
#40.
domob1812 added a commit that referenced this issue Nov 5, 2018
This implements a hard fork scheduled at certain heights (500 on regtest,
12000 on testnet and not yet active on mainnet) that allows non-zero
nonce values in the main block header (not the fake header).  This solves
#50.

Forks are added to Consensus::Params similar to how they are handled in
Huntercoin.  For now, there's only this one, but there will likely be
more in the future; for instance, to change the standalone mining
algorithm or when we implement ephemeral timestamps.

The created POST_ICO fork will contain more things in the future, namely
a change to the block reward and block interval as described in
#40.
domob1812 added a commit that referenced this issue Nov 6, 2018
This implements a hard fork scheduled at certain heights (500 on regtest,
1M on testnet and mainnet for now, will be changed) that allows non-zero
nonce values in the main block header (not the fake header).  This solves
#50.

Forks are added to Consensus::Params similar to how they are handled in
Huntercoin.  For now, there's only this one, but there will likely be
more in the future; for instance, to change the standalone mining
algorithm or when we implement ephemeral timestamps.

The created POST_ICO fork will contain more things in the future, namely
a change to the block reward and block interval as described in
#40.
@domob1812
Copy link
Collaborator Author

The fork branch now contains the main code to implement this. For now, the block reward is set to 10 CHI after the fork. This will be the value we use on testnet for testing the fork there. Once the final fork height for mainnet has been fixed, we can calculate the right value for mainnet and update it there.

@xaya: Please let me know at what height you think we should activate the fork on testnet, then we are ready to merge the code into master and run final tests on testnet.

domob1812 added a commit that referenced this issue Nov 6, 2018
356be12 Set POST_ICO fork for testnet. (Daniel Kraft)
5752067 Increase block reward with POST_ICO fork. (Daniel Kraft)
dd40da9 Make block target spacing fork-able. (Daniel Kraft)
d7f7e84 Allow non-zero nonce with POST_ICO fork. (Daniel Kraft)

Pull request description:

  This implements the planned "post ICO" hard fork.  For now, it is scheduled at height 500 on regtest, 11k on testnet and 1M on mainnet.  The mainnet height will be defined later after a (hopefully) successful activation on testnet.

  This changes three things:

  1. The nonce values of main block headers no longer need to be zero (#50).
  2. The block intervals are changed and made algorithm-dependent:  Neoscrypt targets 40s and SHA-256d two minutes after the fork (for an average that is still 30s per block).  See #67 for the discussion.
  3. The block rewards are increased to 10 CHI on testnet and mainnet after the fork.  For testnet, that is the (arbitrary) value we will use.  For mainnet, the value will be changed when the actual fork height becomes known, so that we can calculate the correct value.  This implements #40.

Tree-SHA512: 20b0cc0ea020cdcf46bbb2476bdfe0799b02faffcaf23f0b312d76d351e735ff17ac294a6ad1b6dd865e5134ff15fa5a53a1b2869990efdbb51caa847ba827fd
@domob1812
Copy link
Collaborator Author

Closing this now, as the main coding is done. Finalisation of the fork is being tracked in #70.

domob1812 pushed a commit that referenced this issue Dec 14, 2020
b5ef9be675 Merge #1: Merge changes from upstream
9e7f512430 Merge remote-tracking branch 'origin/master' into bitcoin-fork
1f85030246 Add support for ARM64 darwin (#43)
3bb959c982 Remove unnecessary reinterpret_cast (#42)
2e97ab26b1 Fix (unused) ReadUint64LE for BE machines (#41)
47b40d2209 Bump dependencies. (#40)
ba74185625 Move CI to Visual Studio 2019.
efa301a7e5 Allow different C/C++ standards when this is used as a subproject.
cc6d71465e CMake: Use configure_package_config_file()

git-subtree-dir: src/crc32c
git-subtree-split: b5ef9be6755a2e61e2988bb238f13d1c0ee1fa0a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant