API to create new Verge Address
Is there a simple API using which we can create XVG public address and private key? Without the need to install and run verged on the server.
There's no simple option right now, but there's this:
https://github.com/vergecurrency/vWallet/blob/develop/src/crypto/Key.ts
I'm trying my best to figure out way to implement in Nodejs application. https://nodejs.org/api/crypto.html
But am not good at crypto related programming.
I'm developing a mobile app which uses Verge currency for its transaction. I've been thinking of developing it from over a year. Now I've started coding it. It would be awesome if I can generate public and private key for users within the application. Is there a npm package for node.js ?
// import that module as crypto (https://github.com/vergecurrency/vWallet/blob/develop/src/crypto/Key.ts)
const privateKeyBuffer = crypto.generateRandomSeed() // your private key :)
const pubKeyBuffer = crypto.getPublicKeyFromPrivateKey(privateKeyBuffer)
const pubKeyHash = crypto.getPublicKeyHash(pubKeyBuffer)
// pubKeyHashVersion (number): 0x1e
const address = crypto.createAddress(pubKeyHash, pubKeyHashVersion)
console.log(address) // logs a fully compatible address
Thanks a lot. Trying it now.
Also trying to validate user entered XVG address.