Skip to content

Consensus: enable COINBASE_FLAGS on PoS - #96

Open
naomi-mcrn wants to merge 1 commit into
xpc-wg:masterfrom
naomi-mcrn:pr_prep/consensus_enable_coinbase_flags_on_pos
Open

Consensus: enable COINBASE_FLAGS on PoS#96
naomi-mcrn wants to merge 1 commit into
xpc-wg:masterfrom
naomi-mcrn:pr_prep/consensus_enable_coinbase_flags_on_pos

Conversation

@naomi-mcrn

Copy link
Copy Markdown

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.

1 participant