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

Consensus: enable COINBASE_FLAGS on PoS #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

naomi-mcrn
Copy link

COINBASE_FLAGS is defined at validation.cpp L254.
Miner(minter) can set any data organization name that identify them. (example below)

const std::string miner_sig = "|ExamplePoSPool|";
const std::vector<unsigned char> miner_sig_sv(miner_sig.begin(), miner_sig.end());
CScript COINBASE_FLAGS = (CScript() << miner_sig_sv);

But currently it is not available on PoS phase.
Because it is added to coinbase at IncrementExtraNonce that not called on PoS.

This change enable COINBASE_FLAGS on PoS phase.
If miner didn't set data, nothing changes.
Otherwise, extra stuff is added to coinbase.

Block signature will NOT CORRUPT by this change because it is last part of coinbase scriptSig.
It was already verified on mainnet (e.g. https://insight.xpchain.io/tx/a96d635bf0ae90442ff566e7124d3a1adcf9771c72b39c83b069a926186c276c, created by my custom wallet).

If COINBASE_FLAGS is not empty, add it to coinbase to identify minter.
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

Successfully merging this pull request may close these issues.

None yet

1 participant