private PrivateKey ChildKeyDerive(byte[] keyPath) { byte[] childKey; byte[] childChainCode; byte nonce = 0; do { List <byte> bytes = new List <byte>(); bytes.AddRange(Bytes); bytes.AddRange(keyPath); bytes.AddRange(ChainCode); bytes.Add(nonce++); byte[] keyAndChainCode = HashProvider.Hash512(bytes.ToArray()); childKey = keyAndChainCode.Left(); childChainCode = keyAndChainCode.Right(); } while (!Secp256k1.SecretKeyVerify(childKey)); return(new PrivateKey(childKey, childChainCode)); }