Skip to content

Commit

Permalink
add some more explanation on OP_PUSH_TX
Browse files Browse the repository at this point in the history
  • Loading branch information
xhliu committed Mar 22, 2020
1 parent f776e10 commit 286b74d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,13 @@ The following example shows usage of the standard contract ``P2PKH`` that corres
}
Contract "OP_PUSH_TX"
---------------------
Contract ``OP_PUSH_TX``
-----------------------
One grave misconception regarding bitcoin script is that its access is only limited to the data provided in the locking script and corresponding unlocking script.
Thus, its scope and capability are greatly underestimated.

sCrypt comes with a powerful contract called ``Tx`` that allows inspection of the **ENTIRE TRANSACTION** containing the contract itself, besides the locking script and unlocking script.
It can be regarded as a pseudo opcode ``OP_PUSH_TX`` that pushes the current transaction into the stack, which can be inspected at runtime.
More precisely, it enables inspection of the preimage used in signature verification defined in `BIP143`_.
The format of the preimage is as follows:

Expand Down

0 comments on commit 286b74d

Please sign in to comment.