Generating IOTA addresses from a seed (#2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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_csharp.ipynb.html#2508A6FF9241 | |
// Requirement: Tangle.Net library (!nuget install Tangle.Net) | |
// Requirement: Newtonsoft Json library (!nuget install Newtonsoft.Json) | |
#r "Tangle.Net.dll" | |
#r "Newtonsoft.Json.dll" | |
using Tangle.Net.Cryptography; | |
using Tangle.Net.Entity; | |
using Newtonsoft.Json; | |
var seed = new Seed("WKQDUZTGFKSSLACUCHHLZRKZBHSDSCEBHKUPDLKFBQALEBKDMFRPUQGZRXAADPG9TSRTZGGBZOFRJCFMM"); | |
var addressGenerator = new AddressGenerator(); | |
// Please also see GetAdrress function for a single individual address | |
var addresses = addressGenerator.GetAddresses(seed, | |
SecurityLevel.Medium //security level 2 | |
,0 // from index | |
,3 // count | |
); | |
// The Address instance is very detailed and provides so many fields - so showing only address in Trytes for better clarity | |
Console.WriteLine(JsonConvert.SerializeObject(from i in addresses select i.ToTrytes(), Formatting.Indented)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment