unboundsecurity / blockchain-crypto-mpc

Protecting cryptographic signing keys and seed secrets with Multi-Party Computation.
GNU General Public License v3.0
454 stars 167 forks source link

Enable generation of testnet xPub #23

Open lauhon opened 2 years ago

lauhon commented 2 years ago

Hi,

i know this project is not being maintained anymore, but I decided to open this anyway, maybe it will be usefull for someone in the future.

I noticed that MPCCrypto_serializePubBIP32 has all the necessary logic to create test net xPub keys. The regarding functions even have a parameter to control that. But the parameter has a default value and is never changed by calling methods. The exposed functions by the library (inside mpc_crypto.h) do not offer a way to pass that information. I just added the parameter bool main and passed it down to serialize_pub which accepted this parameter anyway.

(bool main representing wether the xPub is generated for mainnet or not)