4

This question already has an answer here:

I understand that the Private Key and Address pair is generated from the Seed + index number. Is there anywhere where I can find the mathematical formula beside decoding the wallet code ? Thank you.

marked as duplicate by mihi, Helmar, aboose, ben75, Zauz Dec 31 '17 at 12:29

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

You can find the entry point of generating a new address in e.g. the JS client library iota.lib.js found here on GitHub. For more details you have to look into the Signing class found here on GitHub.

The following code snippet is from the first linked class.

/**
*   Generates a new address
*
*   @method newAddress
*   @param      {string} seed
*   @param      {int} index
*   @param      {int} security      Security level of the private key
*   @param      {bool} checksum
*   @returns    {string} address     Transaction objects
**/
api.prototype._newAddress = function(seed, index, security, checksum) {

    var key = Signing.key(Converter.trits(seed), index, security);
    var digests = Signing.digests(key);
    var addressTrits = Signing.address(digests);
    var address = Converter.trytes(addressTrits)

    if (checksum) {
        address = Utils.addChecksum(address);
    }

    return address;
}
0

The private/public keypair is computed by an algorithm. The algorithm in the wallet's code is the formula. Don't expect to find something different than this algorithm.

Not the answer you're looking for? Browse other questions tagged or ask your own question.