-
Notifications
You must be signed in to change notification settings - Fork 85
Create opdatasigverify.md #64
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,122 @@ | |||
# Enable oracle-based data import via OP_DATASIGVERIFY | |||
|
|||
Version 0.2, 2018-02-22 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Closing to migrate to https://github.com/bitcoincashorg/bitcoincash.org/ |
474191d
to
8ce6798
Compare
This PR contains the opdatasigverify.md from
https://github.com/BitcoinUnlimited/BitcoinUnlimited/blob/bucash1.3.0.0/doc/opdatasigverify.md