Skip to content
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

Generate address? #82

Open
TommyYehCool opened this issue Jun 16, 2017 · 4 comments
Open

Generate address? #82

TommyYehCool opened this issue Jun 16, 2017 · 4 comments

Comments

@TommyYehCool
Copy link

I saw the page RippleAPI has generateAddress.

Has somebody know how to do it by ripple-lib-java ?

@sublimator
Copy link
Contributor

sublimator commented Jun 16, 2017 via email

@sublimator
Copy link
Contributor

sublimator commented Jun 16, 2017 via email

@TommyYehCool
Copy link
Author

Hi do you have example that I can reference?

@sublimator
Copy link
Contributor

public class GenerateAddress {
    public static void main(String[] args) {
        Config.initBouncy();
        SecureRandom random = new SecureRandom();
        byte[] seedBytes = new byte[16];
        random.nextBytes(seedBytes);
        Seed seed = new Seed(seedBytes);
        IKeyPair iKeyPair = seed.keyPair();
        byte[] pub160Hash = iKeyPair.pub160Hash();
        AccountID accountID = AccountID.fromBytes(pub160Hash);
        System.out.println("secret= " + seed +  ", address=" + accountID);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants