WIP: trade-bot: make sure the "trade" private key is valid for both Curve25519 and secp256k1

This commit is contained in:
catbref 2020-07-30 08:12:45 +01:00
parent 16581766c6
commit 6be67d0d92

View File

@ -254,9 +254,9 @@ public class TradeBot {
}
private static byte[] generateTradePrivateKey() {
byte[] seed = new byte[32];
RANDOM.nextBytes(seed);
return seed;
// The private key is used for both Curve25519 and secp256k1 so needs to be valid for both.
// Curve25519 accepts any seed, so generate a valid secp256k1 key and use that.
return new ECKey().getPrivKeyBytes();
}
private static byte[] deriveTradeNativePublicKey(byte[] privateKey) {