diff --git a/chaincfg/params.go b/chaincfg/params.go index 8c33ea893..f47d6da06 100644 --- a/chaincfg/params.go +++ b/chaincfg/params.go @@ -201,9 +201,11 @@ type Params struct { Bech32HRPSegwit string // Address encoding magics - PubKeyHashAddrID byte // First byte of a P2PKH address - ScriptHashAddrID byte // First byte of a P2SH address - PrivateKeyID byte // First byte of a WIF private key + PubKeyHashAddrID byte // First byte of a P2PKH address + ScriptHashAddrID byte // First byte of a P2SH address + PrivateKeyID byte // First byte of a WIF private key + WitnessPubKeyHashAddrID byte // First byte of a P2WPKH address + WitnessScriptHashAddrID byte // First byte of a P2WSH address // BIP32 hierarchical deterministic extended key magics HDPrivateKeyID [4]byte @@ -294,9 +296,11 @@ var MainNetParams = Params{ Bech32HRPSegwit: "bc", // always bc for main net // Address encoding magics - PubKeyHashAddrID: 0x00, // starts with 1 - ScriptHashAddrID: 0x05, // starts with 3 - PrivateKeyID: 0x80, // starts with 5 (uncompressed) or K (compressed) + PubKeyHashAddrID: 0x00, // starts with 1 + ScriptHashAddrID: 0x05, // starts with 3 + PrivateKeyID: 0x80, // starts with 5 (uncompressed) or K (compressed) + WitnessPubKeyHashAddrID: 0x06, // starts with p2 + WitnessScriptHashAddrID: 0x0A, // starts with 7Xh // BIP32 hierarchical deterministic extended key magics HDPrivateKeyID: [4]byte{0x04, 0x88, 0xad, 0xe4}, // starts with xprv @@ -449,9 +453,11 @@ var TestNet3Params = Params{ Bech32HRPSegwit: "tb", // always tb for test net // Address encoding magics - PubKeyHashAddrID: 0x6f, // starts with m or n - ScriptHashAddrID: 0xc4, // starts with 2 - PrivateKeyID: 0xef, // starts with 9 (uncompressed) or c (compressed) + PubKeyHashAddrID: 0x6f, // starts with m or n + ScriptHashAddrID: 0xc4, // starts with 2 + WitnessPubKeyHashAddrID: 0x03, // starts with QW + WitnessScriptHashAddrID: 0x28, // starts with T7n + PrivateKeyID: 0xef, // starts with 9 (uncompressed) or c (compressed) // BIP32 hierarchical deterministic extended key magics HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv @@ -522,9 +528,11 @@ var SimNetParams = Params{ Bech32HRPSegwit: "sb", // always sb for sim net // Address encoding magics - PubKeyHashAddrID: 0x3f, // starts with S - ScriptHashAddrID: 0x7b, // starts with s - PrivateKeyID: 0x64, // starts with 4 (uncompressed) or F (compressed) + PubKeyHashAddrID: 0x3f, // starts with S + ScriptHashAddrID: 0x7b, // starts with s + PrivateKeyID: 0x64, // starts with 4 (uncompressed) or F (compressed) + WitnessPubKeyHashAddrID: 0x19, // starts with Gg + WitnessScriptHashAddrID: 0x28, // starts with ? // BIP32 hierarchical deterministic extended key magics HDPrivateKeyID: [4]byte{0x04, 0x20, 0xb9, 0x00}, // starts with sprv