Skip to content

Instantly share code, notes, and snippets.

@Hribek25
Last active September 24, 2019 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hribek25/e4db233bab239e19ab9c759bd89e94ff to your computer and use it in GitHub Desktop.
Save Hribek25/e4db233bab239e19ab9c759bd89e94ff to your computer and use it in GitHub Desktop.
Generating IOTA addresses from a seed (#2)
// The snippet is a part of the IOTA Developer Essentials project. You can reach it at https://hribek25.github.io/IOTA101/
// Complete description and story behind the snippet is available at: https://hribek25.github.io/IOTA101/Allchapters_javascript.ipynb.html#2508A6FF9241
// Requirement: A core module of IOTA Javascript Library (!npm install @iota/core)
var iotalib = require('@iota/core');
var MySeed = "WKQDUZTGFKSSLACUCHHLZRKZBHSDSCEBHKUPDLKFBQALEBKDMFRPUQGZRXAADPG9TSRTZGGBZOFRJCFMM";
//Please note, it is a sync function call
//Please also note that generating addresses can take quite long
//The given addresses are generated locally regardless the Tangle state
for (var i = 0; i < 3; i++ ) {
var address = iotalib.generateAddress (MySeed, i, 2, false); //seed, index, security, checksum
console.log(address);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment