So your question asks about inputs. The types witness_v0_keyhash
and witness_v1_taproot
are generally associated with outputs. However, inputs can also (sort of) be categorized by what is in the input script and/or the segregated witness.
First of all, witness_v0_keyhash
outputs are of the form:
OP_0
<20-byte hash>
Whereas, witness_v1_taproot
outputs are of the form:
OP_1
<32-byte hash>
But the inputs that redeem these outputs don't necessarily have to all be of the same format.
If we look at a recent witness_v0_keyhash
output, for example aa64f3a8e692e585a50d441d82f6ddc5cbc1ae33176fd645066a1de4734262e4 (output 0), we see an example of this output type. It is two fields: OP_0, followed by the 20-byte hash.
Now if we look at the input that redeemed this output, which is a27f50775ce85e02815fd9e30f9bcc242deabc1789797d24177ad757b67036f5 (input 0), we see that it is very simple. As a segregated witness transaction, it has an empty input script and nothing but a signature and a public key in the segregated witness. Almost all inputs that redeem witness_v0_keyhash outputs are of that same format. Some things to note are that it is the old-style elliptic curve signature and has a sighash byte appended to the end of it, making it a variable length signature. The public key is a 33-byte compressed public key.
Let's compare that to a recent witness_v1_taproot
output, for example 7aeb0447d99fb9755ad21846cef74a1b24bb6a75c56c85a39379c5097d230021 (output 0). It is also two fields: OP_1, followed by the 32-byte hash.
The input that redeems this output, which is 1eac74f5d124b9f5f2b606ca8f9a37dca3dddd890b66e19b6a761ec693f2467a (input 1), is even more simple. It too contains an empty input script, but the segregated witness is nothing but a 64-byte, uniform-length, signature.
But redeeming Taproot outputs can get more complicated if you start getting into script path spending. In the old days, there was P2PKH and P2SH
, key vs. script methods for redeeming outputs. The data was moved to a different part of the transaction when those output types became P2WPKH and P2WSH
. But with Taproot
, there is one output type that accommodates both key path and script path spending. So there are many different types of inputs that are possible. These are explained in BIP 340, BIP 341 and BIP 342.