Skip to content

BIP 119: CHECKTEMPLATEVERIFY #875

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

Merged
merged 4 commits into from
Jan 24, 2020
Merged

BIP 119: CHECKTEMPLATEVERIFY #875

merged 4 commits into from
Jan 24, 2020

Conversation

JeremyRubin
Copy link
Contributor

I believe now is an appropriate time to apply for a BIP number/Draft Status for OP_CTV. A few elements will require updating before the BIP moves out of draft (e.g., the activation dates) but activation dates are a separate discussion from the technical considerations which are the focus of this BIP.

@JeremyRubin
Copy link
Contributor Author

BTW I looked into the travis error -- it seems that the linter is reading a code block and failing because a C++ lambda looks like a improperly formatted markdown link.

I am happy to add a revert-able patch as below:

bool filter(const CTxIn& c) {
    return c.scriptSig != CScript();
}
uint256 GetStandardTemplateHash(const CTransaction& tx, const uint256& outputs_hash, const uint256& sequences_hash,
                                    const uint32_t input_index) {
        bool skip_scriptSigs = std::find_if(tx.vin.begin(), tx.vin.end(), filter) == tx.vin.end();
        return skip_scriptSigs ? GetStandardTemplateHashEmptyScript(tx, outputs_hash, sequences_hash, input_index) :
            GetStandardTemplateHashWithScript(tx, outputs_hash, sequences_hash, GetScriptSigsSHA256(tx), input_index);
    }

so that you don't have to muck around with a broken linter/supressions, but I think it's better to fix the linter longer term.

@luke-jr
Copy link
Member

luke-jr commented Jan 19, 2020

@JeremyRubin This is missing a backwards compatibility section.

@kallewoof Can you look into a better fix for the linter issue?

@kallewoof
Copy link
Contributor

Looking.

@JeremyRubin
Copy link
Contributor Author

JeremyRubin commented Jan 21, 2020

@luke-jr it was unclear to me that a backwards compatibility section was needed for this BIP, referencing BIP-65 and BIP-112 as examples. Neither covers the OP_NOP reinterpretation as being an incompatibility.

Regardless, I can push a section noting that there are no Backwards Incompatibilities.

@JeremyRubin
Copy link
Contributor Author

  • BIP 65 -- CLTV/CSV.

@JeremyRubin
Copy link
Contributor Author

Added a backwards compatibility section; and rebased to pick up the linter fixes.

@luke-jr
Copy link
Member

luke-jr commented Jan 24, 2020

Use BIP 119

@luke-jr luke-jr changed the title Add BIP for CheckTemplateVerify BIP 119: Add BIP for CheckTemplateVerify Jan 24, 2020
@luke-jr luke-jr changed the title BIP 119: Add BIP for CheckTemplateVerify BIP 119: CHECKTEMPLATEVERIFY Jan 24, 2020
@JeremyRubin
Copy link
Contributor Author

Thanks Luke! I've set the number & fixed links.

@luke-jr luke-jr merged commit 0042dec into bitcoin:master Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants