pub fn new(
		network: BitcoinNetwork,
		master_key: ExtendedPrivKey,
		index: u32,
	) -> StacksResult<Self> {
		let private_key_p2pkh = derive_key(
			master_key,
			bitcoin_derivation_path(network, BitcoinAddressType::P2pkh, index)?,
		)
		.to_priv()
		.inner;

		let private_key_p2wpkh = derive_key(
			master_key,
			bitcoin_derivation_path(
				network,
				BitcoinAddressType::P2wpkh,
				index,
			)?,
		)
		.to_priv()
		.inner;

		let private_key_p2tr = derive_key(
			master_key,
			bitcoin_derivation_path(network, BitcoinAddressType::P2tr, index)?,
		)
		.to_priv()
		.inner;

		Ok(Self {
			network,
			private_key_p2pkh,
			private_key_p2wpkh,
			private_key_p2tr,
		})
	}
Creates Bitcoin credentials from the Bitcoin network and private key
stacks-core/src/wallet.rs