Page MenuHomePhabricator

CHECKDATASIG(VERIFY): Update for single, raw SHA256 message hash
AbandonedPublic

Authored by schancel on Aug 14 2018, 17:06.

Details

Reviewers
deadalnix
jasonbcox
awemany
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Restricted Project
Summary

With the current implementation that this commit is based on,
CHECKDATASIG(VERIFY) takes the message bytes from the stack
and serializes them using the SER_HASH serialization option in the Bitcoin
object serialization protocol. It then hashes the result twice using
SHA256.

This creates a problem insofar as it makes the opcode a lot less flexible
than it needs to be. A lot of messages from other systems - or even Bitcoin
itself, such as signed transactions cannot be checked for having a valid
signature using CHECKDATASIG(VERIFY) any longer.

This changes the implementation of CHECKDATASIG(VERIFY) to take the
raw, single SHA256 hash of the message bytes on the stack instead.

See also the discussion on the github pull-request page regarding the
CHECKDATASIG(VERIFY) specification at:

https://github.com/bitcoincashorg/bitcoincash.org/pull/93

Test Plan

make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
checkdatasig-single-raw-hash (branched from checkdatasig-single-hash-infrastructure)
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3080
Build 4247: Bitcoin ABC Buildbot (legacy)
Build 4246: arc lint + arc unit

Event Timeline

Forgot to squash commits - didn't use phabricator for a long time.

Owners added a reviewer: Restricted Owners Package.Aug 14 2018, 17:12

Update formatting of comment after clang-format

Looks like we stepped on each other's toes here: D1653

schancel abandoned this revision.
schancel edited reviewers, added: awemany; removed: schancel.