Skip to content

Conversation

furszy and others added 5 commits June 17, 2020 23:43
coming from btc@627b9deff4e8e18fc6d001b6eb9818c13c648820
- [script/standard.o] IsStandard
- [main.o] IsStandardTx
- [main.o] AreInputsStandard

coming from btc@9238ecb41752e097443d0bc117df35ebd4ac932e
Previously unlike other transaction types the TX_SCRIPTHASH would not
clear vSolutionsRet, which means that unlike other transaction types if
it was called twice in a row you would get the result of the previous
invocation as well.
Previously this was an inline test where the specificity was probably judged
overly specific. As a class method it makes sense to maintain consistency.

And replace some magic values with their constant equivalents.

Excludes changes to the following functions we don't have:

- ExtractPubKey (bitcoin#6415)
- IsCompressedPubKey (bitcoin#8499)
The current code contains a rather complex script template matching engine,
which is only used for 3 particular script types (P2PK, P2PKH, multisig).
The first two of these are trivial to match for otherwise, and a specialized
matcher for multisig is both more compact and more efficient than a generic
one.

The goal is being more flexible, so that for example larger standard multisigs
inside SegWit outputs are more easy to implement.

As a side-effect, it also gets rid of the pseudo opcodes hack.

coming from btc@c814e2e7e81fd01fcb07f4a28435741bdc463801
@furszy furszy self-assigned this Jun 18, 2020
@furszy furszy changed the title Upstream scripts back ports [Step 1] [WIP] Upstream scripts back ports [Step 1] Jun 18, 2020
@furszy furszy force-pushed the 2020_btc_scripts_backports branch from 01d894b to c3abcf3 Compare June 18, 2020 05:15
@furszy furszy changed the title [WIP] Upstream scripts back ports [Step 1] Upstream scripts back ports [Step 1] Jun 18, 2020
@furszy furszy force-pushed the 2020_btc_scripts_backports branch from 71074f4 to 5d96c91 Compare June 19, 2020 01:43
@furszy furszy requested a review from random-zebra June 23, 2020 03:44
@random-zebra random-zebra added this to the 4.2.0 milestone Jun 23, 2020
Copy link

@random-zebra random-zebra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. ACK 5d96c91

@furszy furszy requested a review from Fuzzbawls June 27, 2020 04:04
Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 5d96c91

small nit that can be addressed later

#include "util.h"
#include "utilstrencodings.h"

#include <boost/foreach.hpp>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: un-necessary header include

@furszy furszy merged commit a5265a4 into PIVX-Project:master Jun 27, 2020
furszy added a commit that referenced this pull request Jul 31, 2020
…alleability vector

ccff44f Test LowS in standardness, removes nuisance malleability vector. (furszy)

Pull request description:

  On top of #1693 (only last commit matter for this PR).

  Lot of fruitful information can be found in bitcoin#6769 .

  > This adds SCRIPT_VERIFY_LOW_S to STANDARD_SCRIPT_VERIFY_FLAGS which
  > will make the node require the canonical 'low-s' encoding for
  > ECDSA signatures when relaying or mining.

  > Absent this kind of test ECDSA is not a strong signature as given
  > a valid signature {r, s} both that value and {r, -s mod n} are valid.
  > These two encodings have different hashes allowing third parties a
  > vector to change users txids. These attacks are avoided by picking
  > a particular form as canonical and rejecting the other form(s); in
  > the of the LOW_S rule, the smaller of the two possible S values is
  > used.

ACKs for top commit:
  random-zebra:
    utACK ccff44f
  Fuzzbawls:
    ACK ccff44f

Tree-SHA512: abcd28e9eab04719480f7f3d8fafcaa9aa46cb52278c42211becde6537066a67fc0be340b6f3b1457efc5543053097d77682cd3c3c09f5dd931d0762cd5e9229
@furszy furszy deleted the 2020_btc_scripts_backports branch November 29, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants