diff --git a/zcash_client_backend/src/constants.rs b/zcash_client_backend/src/constants.rs index ee858a1..28f0b2c 100644 --- a/zcash_client_backend/src/constants.rs +++ b/zcash_client_backend/src/constants.rs @@ -2,6 +2,7 @@ pub mod mainnet; pub mod testnet; +pub mod regtest; pub const SPROUT_CONSENSUS_BRANCH_ID: u32 = 0; pub const OVERWINTER_CONSENSUS_BRANCH_ID: u32 = 0x5ba8_1b19; diff --git a/zcash_client_backend/src/constants/regtest.rs b/zcash_client_backend/src/constants/regtest.rs new file mode 100644 index 0000000..962101f --- /dev/null +++ b/zcash_client_backend/src/constants/regtest.rs @@ -0,0 +1,38 @@ +/// The testnet coin type for ZEC, as defined by [SLIP 44]. +/// +/// [SLIP 44]: https://github.com/satoshilabs/slips/blob/master/slip-0044.md +pub const COIN_TYPE: u32 = 1; + +/// The HRP for a Bech32-encoded testnet [`ExtendedSpendingKey`]. +/// +/// Defined in [ZIP 32]. +/// +/// [`ExtendedSpendingKey`]: zcash_primitives::zip32::ExtendedSpendingKey +/// [ZIP 32]: https://github.com/zcash/zips/blob/master/zip-0032.rst +pub const HRP_SAPLING_EXTENDED_SPENDING_KEY: &str = "secret-extended-key-regtest"; + +/// The HRP for a Bech32-encoded testnet [`ExtendedFullViewingKey`]. +/// +/// Defined in [ZIP 32]. +/// +/// [`ExtendedFullViewingKey`]: zcash_primitives::zip32::ExtendedFullViewingKey +/// [ZIP 32]: https://github.com/zcash/zips/blob/master/zip-0032.rst +pub const HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY: &str = "zxviewregtestsapling"; + +/// The HRP for a Bech32-encoded testnet [`PaymentAddress`]. +/// +/// Defined in section 5.6.4 of the [Zcash Protocol Specification]. +/// +/// [`PaymentAddress`]: sapling_crypto::primitives::PaymentAddress +/// [Zcash Protocol Specification]: https://github.com/zcash/zips/blob/master/protocol/protocol.pdf +pub const HRP_SAPLING_PAYMENT_ADDRESS: &str = "zregtestsapling"; + +/// The prefix for a Base58Check-encoded testnet [`TransparentAddress::PublicKey`]. +/// +/// [`TransparentAddress::PublicKey`]: zcash_primitives::legacy::TransparentAddress::PublicKey +pub const B58_PUBKEY_ADDRESS_PREFIX: [u8; 2] = [0x1d, 0x25]; + +/// The prefix for a Base58Check-encoded testnet [`TransparentAddress::Script`]. +/// +/// [`TransparentAddress::Script`]: zcash_primitives::legacy::TransparentAddress::Script +pub const B58_SCRIPT_ADDRESS_PREFIX: [u8; 2] = [0x1c, 0xba];