aboutsummaryrefslogtreecommitdiff
path: root/src/chain.h
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2019-08-29 12:58:18 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2019-08-29 13:34:20 +0200
commit798a589aff64b83a0844688a661f4bd987c3340c (patch)
tree119eb7a50c726b702febbe97969fd57e78cb7b5a /src/chain.h
parentfc5b756bae26db5e88bd6ed15e2eb45b05e76bdd (diff)
wallet: extract PubKey from P2PK script with Solver
The function ExtractPubKey() checks if a given script matches the P2PK pattern (<PubKey> OP_CHECKSIG), extracts the PubKey and additionally checks if it is cryptographically valid (full validation with ECC library via .IsFullyValid()). Currently this is done manually in the following order: 1) check if first script OP is data push with valid PubKey length (first part of pattern match), extract PubKey 2) create CPubKey object with extracted PubKey 3) fully validate public key 4) check if last script OP is OP_CHECKSIG (second part of pattern match) Using Solver, the pattern matching and PubKey extraction can be done via a single step, leading to the following simplified order with shorter code: 1) check if given script matches P2PK pattern with Solver (also contains valid PubKey length check), extracts Pubkey 2) create CPubKey object with extracted Pubkey 3) fully validate public key
Diffstat (limited to 'src/chain.h')
0 files changed, 0 insertions, 0 deletions