diff --git a/bitcoin/chainparams.c b/bitcoin/chainparams.c index c3297c5e3..39e689fb9 100644 --- a/bitcoin/chainparams.c +++ b/bitcoin/chainparams.c @@ -12,6 +12,18 @@ #define BIP32_VER_SIGT_PUBLIC 0x043587CF #define BIP32_VER_SIGT_PRIVATE 0x04358394 +static u8 liquid_fee_asset[] = { + 0x01, 0x6d, 0x52, 0x1c, 0x38, 0xec, 0x1e, 0xa1, 0x57, 0x34, 0xae, + 0x22, 0xb7, 0xc4, 0x60, 0x64, 0x41, 0x28, 0x29, 0xc0, 0xd0, 0x57, + 0x9f, 0x0a, 0x71, 0x3d, 0x1c, 0x04, 0xed, 0xe9, 0x79, 0x02, 0x6f, +}; + +static u8 liquid_regtest_fee_asset[] = { + 0x01, 0x5c, 0xe7, 0xb9, 0x63, 0xd3, 0x7f, 0x8f, 0x2d, 0x51, 0xca, + 0xfb, 0xba, 0x92, 0x8a, 0xaa, 0x9e, 0x22, 0x0b, 0x8b, 0xbc, 0x66, + 0x05, 0x71, 0x49, 0x9c, 0x03, 0x62, 0x8a, 0x38, 0x51, 0xb8, 0xce, +}; + const struct chainparams networks[] = { {.network_name = "bitcoin", .bip173_name = "bc", @@ -39,6 +51,7 @@ const struct chainparams networks[] = { .p2pkh_version = 0, .p2sh_version = 5, .testnet = false, + .fee_asset_tag = NULL, .bip32_key_version = {.bip32_pubkey_version = BIP32_VER_MAIN_PUBLIC, .bip32_privkey_version = BIP32_VER_MAIN_PRIVATE}, .is_elements = false}, @@ -61,6 +74,7 @@ const struct chainparams networks[] = { .p2pkh_version = 111, .p2sh_version = 196, .testnet = true, + .fee_asset_tag = NULL, .bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC, .bip32_privkey_version = BIP32_VER_TEST_PRIVATE}, .is_elements = false}, @@ -100,6 +114,7 @@ const struct chainparams networks[] = { .p2pkh_version = 111, .p2sh_version = 196, .testnet = true, + .fee_asset_tag = NULL, .bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC, .bip32_privkey_version = BIP32_VER_TEST_PRIVATE}, .is_elements = false}, @@ -122,6 +137,7 @@ const struct chainparams networks[] = { .p2pkh_version = 48, .p2sh_version = 50, .testnet = false, + .fee_asset_tag = NULL, .bip32_key_version = {.bip32_pubkey_version = BIP32_VER_MAIN_PUBLIC, .bip32_privkey_version = BIP32_VER_MAIN_PRIVATE}, .is_elements = false}, @@ -144,11 +160,13 @@ const struct chainparams networks[] = { .p2pkh_version = 111, .p2sh_version = 58, .testnet = true, + .fee_asset_tag = NULL, .bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC, .bip32_privkey_version = BIP32_VER_TEST_PRIVATE}, .is_elements = false}, {.network_name = "liquid-regtest", .bip173_name = "ert", + .bip70_name = "liquid-regtest", .genesis_blockhash = {{{.u.u8 = {0x9f, 0x87, 0xeb, 0x58, 0x0b, 0x9e, 0x5f, 0x11, 0xdc, 0x21, 0x1e, 0x9f, 0xb6, 0x6a, 0xbb, 0x36, 0x99, 0x99, 0x90, 0x44, 0xf8, @@ -164,11 +182,13 @@ const struct chainparams networks[] = { .p2pkh_version = 91, .p2sh_version = 75, .testnet = true, + .fee_asset_tag = liquid_regtest_fee_asset, .bip32_key_version = {.bip32_pubkey_version = BIP32_VER_TEST_PUBLIC, .bip32_privkey_version = BIP32_VER_TEST_PRIVATE}, .is_elements = true}, {.network_name = "liquid", .bip173_name = "ex", + .bip70_name = "liquidv1", .genesis_blockhash = {{{.u.u8 = {0x14, 0x66, 0x27, 0x58, 0x36, 0x22, 0x0d, 0xb2, 0x94, 0x4c, 0xa0, 0x59, 0xa3, 0xa1, 0x0e, 0xf6, 0xfd, 0x2e, 0xa6, 0x84, 0xb0, @@ -184,6 +204,7 @@ const struct chainparams networks[] = { .p2pkh_version = 57, .p2sh_version = 39, .testnet = false, + .fee_asset_tag = liquid_fee_asset, .bip32_key_version = {.bip32_pubkey_version = BIP32_VER_MAIN_PUBLIC, .bip32_privkey_version = BIP32_VER_MAIN_PRIVATE}, .is_elements = true}, diff --git a/bitcoin/chainparams.h b/bitcoin/chainparams.h index a6a060520..2feca23a8 100644 --- a/bitcoin/chainparams.h +++ b/bitcoin/chainparams.h @@ -38,6 +38,7 @@ struct chainparams { /* Version codes for BIP32 extended keys in libwally-core*/ const struct bip32_key_version bip32_key_version; const bool is_elements; + const u8 *fee_asset_tag; }; /**