I state that I'm still a beginner. I need some clarification. I am using the Testnet. This is the information regarding the address I used to receive funds from a Faucet
bitcoin-cli validateaddress 2N7MaihNErbNH8XTkuZWtJYPzMQAWMPVKHd
{
"isvalid": true,
"address": "2N7MaihNErbNH8XTkuZWtJYPzMQAWMPVKHd",
"scriptPubKey": "a9149ac58ff47e27214b158b38da04bc8cbf72def14387",
"isscript": true,
"iswitness": false
}
bitcoin-cli decodescript a9149ac58ff47e27214b158b38da04bc8cbf72def14387
{
"asm": "OP_HASH160 9ac58ff47e27214b158b38da04bc8cbf72def143 OP_EQUAL",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"2N7MaihNErbNH8XTkuZWtJYPzMQAWMPVKHd"
]
}
What do data mean? I interpret that my address will receive UTXO blocked by P2SH type scripts, correct? "iswitness": false means that this address cannot use UTXO segWit?
On this address I received the following output as input:
{
"value": 0.01944571,
"n": 1,
"scriptPubKey": {
"asm": "OP_HASH160 9ac58ff47e27214b158b38da04bc8cbf72def143 OP_EQUAL",
"hex": "a9149ac58ff47e27214b158b38da04bc8cbf72def14387",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"2N7MaihNErbNH8XTkuZWtJYPzMQAWMPVKHd"
]
}
The blocked UTXO is as follows:
"txid": "a61389ff9af670770182198a984a4c1785625c60795bd57645ecc78765b23679",
"vout": 1,
"address": "2N7MaihNErbNH8XTkuZWtJYPzMQAWMPVKHd",
"label": "",
"redeemScript": "0014778daf651b21684b572644b47d551fce0ff71c74",
"scriptPubKey": "a9149ac58ff47e27214b158b38da04bc8cbf72def14387",
"amount": 0.01944571,
"confirmations": 116,
"spendable": true,
"solvable": true,
"desc": "sh(wpkh([7de694b7/0'/0'/7']032c27921f2d15e7eca768c0e8a8b1aeb863328c74d6c194d41dde2888d4b0e75b))#6z7uwusp",
"Sh (wpkh ())" describes a P2SH-P2WPKH output and the public key with which it is associated.
The descriptor is telling us that the hash (sh) script incorporates wpkh (Witness - Public - Key - Hash) output. In simple words the RedeemScript should match the HASH of this public key, correct?
When I unlock and use this UTXO my input will generate a separate txinwitness field.
"scriptSig": {
"asm": "0014778daf651b21684b572644b47d551fce0ff71c74",
"hex": "160014778daf651b21684b572644b47d551fce0ff71c74"
},
"txinwitness": [
"3044022034a07f088dd88396cd378912a4ed6a156701b075f0facbbae810677048c390e602205df07e13bf4d56feece791a1b5e4d94bec9c93aae14bb87a1b4c6c54ae9bf2f701",
"032c27921f2d15e7eca768c0e8a8b1aeb863328c74d6c194d41dde2888d4b0e75b"
],
"sequence": 4294967295
I can't understand the link between my address information ("iswitness": false) and the ways in which I received / spent the UTXO.