Skip to content

Conversation

@jl2012
Copy link
Contributor

@jl2012 jl2012 commented May 31, 2018

We should use exactly the same code to determine the use of SIGHASH_SINGLE, in both validation and signing.

The existing signing code is safe because SIGHASH is restricted to 6 types. However, if further types are introduced (e.g. SIGHASH_NOINPUT) and we forget to make changes here, people might accidentally sign with SIGHASH_SINGLE when there is no corresponding output and lose money. So it's better to fix it when we still remember

@Empact
Copy link
Contributor

Empact commented Jun 1, 2018

How about giving 0x1f a name e.g. SIGHASH_MASK and use it in other places anywhere either value is used? The only other use I see is in IsDefinedHashtypeSignature.

@jl2012
Copy link
Contributor Author

jl2012 commented Jun 1, 2018

@Empact : 0x1f also used in SignatureHash

@Empact
Copy link
Contributor

Empact commented Jun 5, 2018

@jl2012 Sorry to be unclear, was referring to ~SIGHASH_ANYONECANPAY

@jl2012
Copy link
Contributor Author

jl2012 commented Jun 5, 2018

(& ~SIGHASH_ANYONECANPAY) has no consensus meaning. Not sure why it was used here in the first place

@Christewart
Copy link
Contributor

I would like to see it named SIGHASH_MASK and then placed as a constant some where as well.

utack 283b96b

@jl2012
Copy link
Contributor Author

jl2012 commented Jun 7, 2018

@Christewart added a commit to define SIGHASH_MASK. I'm fine with or without that.

@MarcoFalke does it need a Validation tag?

@jl2012 jl2012 changed the title Accurately determine the use of SIGHASH_SINGLE in signing Define SIGHASH_MASK in validation and determine the use of SIGHASH_SINGLE in signing Jun 7, 2018
@Christewart
Copy link
Contributor

Christewart commented Jun 7, 2018

re-utack b84c353 . Don't we have a Policy label?

@Empact
Copy link
Contributor

Empact commented Jun 7, 2018

@jl2012
Copy link
Contributor Author

jl2012 commented Jun 10, 2018

@Empact that one is correct. It makes only 6 types of SIGHASH standard: 1, 2, 3, 0x81, 0x82, 0x83

@DrahtBot
Copy link
Contributor

The last travis run for this pull request was 52 days ago and is thus outdated. To trigger a fresh travis build, this pull request should be closed and re-opened.

@DrahtBot DrahtBot closed this Jul 29, 2018
@DrahtBot DrahtBot reopened this Jul 29, 2018
@Empact
Copy link
Contributor

Empact commented Aug 30, 2018

utACK 283b96b

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 7, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15639 (bitcoin-wallet tool: Drop libbitcoin_server.a dependency by ryanofsky)
  • #15638 (Move-only: Pull wallet code out of libbitcoin_server by ryanofsky)
  • #13462 (Make SER_GETHASH implicit for CHashWriter and SerializeHash by Empact)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot
Copy link
Contributor

Needs rebase

@fanquake fanquake closed this Jul 29, 2019
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants