When a receiver asks to be despatched cash, they specify the circumstances beneath which they need to have the ability to spend the funds in an output script. Later when the receiver needs to spend their funds, they should present an enter script that satisfies the output script of the output they’re spending. In transaction validation, the enter script is evaluated first, then the ensuing stack is used as the start line to guage the output script.
For instance with P2PKH, the enter script incorporates a signature and a public key, the output script incorporates OP_DUP OP_HASH160 pubkeyhash OP_EQUALVERIFY OP_CHECKSIG
.
In analysis the enter script pushes first the signature then the pubkey on the stack. The stack is then handed to the output script which:
- duplicates the pubkey
- replaces the primary of the 2 pubkey copies with a hash of the pubkey
- pushes the pubkeyhash to the stack
- Verifies that the pubkeyhash pushed from the output script and the pubkeyhash hashed from the pubkey within the enter are equal
- Checks that the remaining pubkey and signature quantity to a sound signature of the transaction.
There are a variety of standardized output script templates that cowl the most typical makes use of. A few of these cowl single-sig usecases, however there are additionally a number of commonplace output sorts for advanced scripts. Addresses are a handy shorthand to speak the receiver’s output scripts to the sender for traditional output script sorts.
Even earlier than P2SH was launched, a receiver might outline arbitrary circumstances by writing out the corresponding output script utilizing the opcodes outlined in Bitcoin Script. These naked scripts are unusual, since their arbitrary content material doesn’t lend itself to an deal with commonplace. The UX is horrible: as an alternative of an deal with with a checksum, the receiver and sender need to trade the precise script, and the sender must create a uncooked transaction manually specifying the output script. P2SH was launched to enhance the UX round defining your personal spending circumstances whereas permitting for an deal with commonplace.
The transaction you’re looking at incorporates such a naked script: as an alternative of following one of many commonplace output schemes, the receiver outlined their very own output script and glad it accordingly within the succeeding enter.
The output script specified within the output a601…0e0c:0
of the previous transaction is:
OP_DUP
OP_0
OP_LESSTHAN
OP_VERIFY
OP_ABS
OP_PUSHNUM_1
OP_PUSHNUM_16
OP_WITHIN
OP_TOALTSTACK
OP_PUSHBYTES_33 0378d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71
OP_CHECKSIGVERIFY
OP_FROMALTSTACK
The enter script within the first enter of 54fa…814f
is:
OP_PUSHBYTES_72
3045022100d92e4b61452d91a473a43cde4b469a472467c0ba0cbd5ebba0834e4f4762810402204802b76b7783db57ac1f61d2992799810e173e91055938750815b6d8a675902e01
OP_PUSHNUM_NEG1
The script primarily quantities to an obfuscated model of a P2PK output as could be seen by evaluating the script execution:
- The enter script pushes a signature onto the stack.
Present Stack (left is backside):SIG
- The quantity
-1
is pushed onto the stack
Stack:SIG -1
- The stack is handed to output script validation
- The quantity -1 is duplicated
Stack:SIG -1 -1
- A
0
is pushed onto the stack
Stack:SIG -1 -1 0
OP_LESSTHAN
consumes two objects (a, b) from the stack returns a1
to the stack as a result of a (-1
) is lower than b (0
).
Stack:SIG -1 1
OP_VERIFY
consumes the1
on high of the stack and succeeds
Stack:SIG -1
OP_ABS
replaces the highest stack merchandise with its absolute worth
Stack:SIG 1
- A
1
is pushed to the stack
Stack:SIG 1 1
- A
16
is pushed to the stack
Stack:SIG 1 1 16
OP_WITHIN
consumes three values (x min max) and returns a1
as a result of x is bigger than or equal to the minimal and smaller than the utmost
Stack:SIG 1
OP_TOALTSTACK
removes the highest factor from the stack and places it on the choice stack.
Stack:SIG
, Altstack:1
- A pubkey is pushed on the stack:
Stack:SIG PUBKEY
, Altstack:1
OP_CHECKSIGVERIFY
consumes the signature and pubkey and verifies that the signature is legitimate within the context of the transaction and pubkey.
Stack:
, Altstack:1
OP_FROMALTSTACK
removes the highest worth of the alt stack and locations it on the stack:
Stack:1
, Altstack:- The script succeeds as a result of it ends with a single truthy worth
1
on the stack.
These transactions could break some block explorers within the sense that some block explorers could solely have assist for traditional scripts and wouldn’t correctly show naked outputs. It appears to me that trendy block explorers now not undergo from that:
e.g. mempool.area reveals the output script within the previous transaction…
… and the spending transaction simply advantageous.
In case “breaking block explorers” was understood as a privateness profit, this transaction is just not extra non-public. In Bitcoin, transactions don’t spend funds from addresses: addresses merely specify the circumstances beneath which funds could be spent, however every enter should specify precisely which transaction output it’s spending.
The previous transaction a601…0e0c
created a single output a601…0e0c:0
with the talked about naked output script that might be spent by the proprietor of that script, and the primary enter of 54fa…814f explicitly spent that a601…0e0c:0
, to create one other transaction output 54fa…814f:0
that may be spent by the receiver accountable for the deal with 1GMaxweLLbo8mdXvnnC19Wt2wigiYUKgEB
.
I.e. each UTXO is uniquely identifiable and the transaction graph is public data. The absence of an deal with has no privateness profit.