-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
starting from scratch #71
Comments
package com.ripple.utils.cli;
import com.ripple.config.Config;
import com.ripple.core.coretypes.AccountID;
import com.ripple.crypto.ecdsa.IKeyPair;
import com.ripple.crypto.ecdsa.Seed;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.Arrays;
public class GenerateWallet {
static {
Config.initBouncy();
}
static SecureRandom random = new SecureRandom();
public static void main(String[] args) throws IOException {
Seed seed = new Seed(randomSeed());
// The keyPair
IKeyPair key = seed.keyPair();
// The AccountID
AccountID accountID = AccountID.fromKeyPair(key);
// Base58 encoded seed
String secret = seed.toString();
System.out.println("account-id/address: " + accountID);
System.out.println("secret/master-seed: " + secret);
assert Arrays.equals(seed.bytes(), Seed.fromBase58(secret).bytes());
}
private static byte[] randomSeed() {
byte[] seedBytes = new byte[16];
random.nextBytes(seedBytes);
return seedBytes;
}
} |
A wallet is created from 128 bits of seed entropy, by doing some elliptic curve math, ultimately ending up with a 256 bit scalar The 128 bit seed value is referred to as the |
Please create an example to start with scratch.
Means create wallet and a address for that wallet.
The text was updated successfully, but these errors were encountered: