Why does the Testnet Wallet create receiving addresses in the form of script hash addresses (prefix 2) instead of "plain" m/n-prefixed addresses? Is there any security reason? And, which script does it hash? I was assuming, from BIP.16, a single-signature case:
scriptPubKey: OP_HASH160 [20-byte-hash of {[pubkey] OP_CHECKSIG} ] OP_EQUAL
But I was not able to obtain the same script hash (of course I know the private key). I tried the following steps:
$ echo [02b6d...public key...47f89] checksig > script
$ bx script-encode < script | bx sha256 | bx ripemd160
046f...fb3
$ echo hash160 [046f...fb3] equal > script2
$ bx script-encode < script2 | bx sha256 | bx ripemd160 | bx base58check-encode --version 196
2NxxxexxxxxL
(I had expected to get the same result built by the wallet, but they were different).
Please note that I know for sure both the private and public keys.