Skip to content
This repository has been archived by the owner on Jun 3, 2018. It is now read-only.

Create opdatasigverify.md #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fyookball
Copy link

@@ -0,0 +1,122 @@
# Enable oracle-based data import via OP_DATASIGVERIFY

Version 0.2, 2018-02-22
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably need a copyright and original author section at this point since this was originally in another repository.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wonder if we could also modify this commit so that authorship is attributed to @gandrewstone.


## Reference Implementation

Please refer to [this github branch](https://github.com/gandrewstone/BitcoinUnlimited/tree/op_datasigverify) for a complete implementation. Implementation is in src/test/interpreter.cpp/h and unit tests are located at src/test/script_tests.cpp.
Copy link
Collaborator

Choose a reason for hiding this comment

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

OP_DATASIGVERIFY has been merged in BU dev branch (disabled state) on Apr 10th, 2018. Therefore I guess we could use that one as reference implementation. (BitcoinUnlimited/BitcoinUnlimited@03318e9)

@@ -0,0 +1,122 @@
# Enable oracle-based data import via OP_DATASIGVERIFY

Version 0.2, 2018-02-22
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wonder if we could also modify this commit so that authorship is attributed to @gandrewstone.


## Requirements on miners, full nodes, and clients

Miners, full nodes, and clients will implement the OP_DATASIGVERIFY opcode and activate it during the May 2018 hard fork.

Choose a reason for hiding this comment

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

May -> November

*OP_DATASIGVERIFY uses a new opcode number*

Opcode (decimal): 187
Opcode (hex): 0xbb

Choose a reason for hiding this comment

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

Correct me if I'm wrong, but I thought the next unused OP_NOPx should be used instead? OP_NOP4 = 0xb3

Choose a reason for hiding this comment

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

we can't use nop instructions because it is not a soft-forkable change... it manipulates the stack


If there are less then 3 items on the stack, the script fails. If the pubkeyhash field is not 20 bytes, the script fails. If the *'type and signature'* field is not 66 bytes, the script fails. If the last byte of the *'type and signature'* field is not DATASIG_COMPACT_ECDSA (1), the script fails.

The last byte of the *'type and signature'* (stack top - 1) field defines the signature type, and previous bytes are the actual signature. Note that this format is different from the OP_CHECKSIG format -- its SIGHASH flag byte has no relationship to this signature type byte.

Choose a reason for hiding this comment

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

Why switch the convention that OP_CHECKSIG uses?

Copy link
Contributor

Choose a reason for hiding this comment

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

Does that even make sense? The flag here wouldn't be with respect to which part of the transaction to sign.

Choose a reason for hiding this comment

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

the op_checksig sighashtype bits don't make any sense in the context of datasigverify we need to change the convention.

@schancel
Copy link
Contributor

Closing to migrate to https://github.com/bitcoincashorg/bitcoincash.org/

@schancel schancel force-pushed the master branch 5 times, most recently from 474191d to 8ce6798 Compare May 14, 2018 20:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants