Generate Addresses
The examples use an example seed b3d7092195c36d47133ff786d4b0a1ef2ee6a0052f6e87b6dc337935c70c531e
that is stored in an
environment variable called IOTA_SEED_SECRET
. This seed serves for training purposes only.
- Java
- Nodejs
- Python
- Rust
- Wasm
You can generate an IOTA address using the
GetAddressesBuilder
helper class and calling the GetAddressesBuilder::from(seed: &str)
function
and respective chaining calls that will return a list of tuples with the generated addresses. You can find more information
on the parameters in the Address/Key Space section.
The whole process is deterministic. This means the output is the same as long as the seed is the same:
loading...
Output example:
[
'atoi1qz6dr6dtl0856tf0pczz7gesrf7j8a4vr00q58ld2zx7ttlv3p96snpym9z',
'atoi1qpp7sz28a0ghvd6knwnljr7j2s04qquduuc5vlz94fwf94zznj2yv5ew2c4',
'atoi1qzje6zhg5vu456eg3z84ekcfn3laxqyczche5eeqhcdh3w9yr5sqvr4z4td',
'atoi1qqwhxjmcvmatpedeedapgx0vwyupfwx9k5n4w0lnc5l6vmz78aavwhs55v0',
'atoi1qzg63t9880jtfysvpq7rrynz0rqt3kd2fw8r4934ezraz9dpwvzxkw2dtmh'
]
IOTA addresses are represented by a checksumed base-32 string (Bech32). You can find a detailed explanation in the Chrysalis documentations, but here are parts relevant to this example:
- If an address starts with
atoi
then it means it is related todevnet
.iota
stands formainnet
. - Number
1
at the 5th position is just a separator. - The last 6 characters are reserved for a checksum.
Addresses can be also represented in a hex format using the
Client.bech32ToHex(bech32)
function.
If you want to quickly validate any IOTA address, you can use the
Client.isAddressValid()
function that returns a bool
value. You should
perform a sanity check on address before using it.
You can generate an IOTA address using the AddressGetter
helper
class and calling the Client.getAddresses()
function and respective chaining calls that will return a list of tuples with the generated addresses. You can find
more information on the parameters in the Address/Key Space section.
The whole process is deterministic. This means the output is the same as long as the seed is the same:
loading...
Output example:
[
'atoi1qz6dr6dtl0856tf0pczz7gesrf7j8a4vr00q58ld2zx7ttlv3p96snpym9z',
'atoi1qpp7sz28a0ghvd6knwnljr7j2s04qquduuc5vlz94fwf94zznj2yv5ew2c4',
'atoi1qzje6zhg5vu456eg3z84ekcfn3laxqyczche5eeqhcdh3w9yr5sqvr4z4td',
'atoi1qqwhxjmcvmatpedeedapgx0vwyupfwx9k5n4w0lnc5l6vmz78aavwhs55v0',
'atoi1qzg63t9880jtfysvpq7rrynz0rqt3kd2fw8r4934ezraz9dpwvzxkw2dtmh'
]
IOTA addresses are represented by a checksumed base-32 string (Bech32). You can find a detailed explanation in the Chrysalis documentations, but here are parts relevant to this example:
- If an address starts with
atoi
then it means it is related todevnet
.iota
stands formainnet
. - Number
1
at the 5th positvion is just a separator. - The last 6 characters are reserved for a checksum.
Addresses can be also represented in a hex format and iota.rs
provides some convenient functions to convert addresses:
Client.bech32ToHex(bech32)
and
Client.hexToBech32(hex, bech32_hrp (optional))
.
If you want to quickly validate any IOTA address, you can use the
Client.isAddressValid()
function that
returns a bool
value. You should perform a sanity check on address before using it.
You can generate an IOTA address using the
Client.get_addresses()
function that will return a list of tuples with the generated addresses. You can find more information on the
parameters in the Address/Key Space section.
The whole process is deterministic. This means the output is the same as long as the seed is the same:
loading...
Output example:
[('atoi1qp9427varyc05py79ajku89xarfgkj74tpel5egr9y7xu3wpfc4lkpx0l86', False),
('atoi1qzfvkkp398v7hhvu89fu88hxctf7snwc9sf3a3nd7msfv77jk7qk2ah07s3', True),
('atoi1qq4t98j5y8wxkaujue99mjwqcp6jvvmsd5lv0755sz7dtjdz3p2lydv76sy', False),
('atoi1qrhzhjxc4z8vpwjt3hafs5xpdng5katqe890p0h95mc0l273j8yzxn7r4hc', True),
('atoi1qputu0yvfvxd7g39wf4rc67e0f0dyhl6enxu9jxnsrjqmemh067tw7qelyc', False),
('atoi1qptg5w2x47qwjf3gpqt3h7d2ey5x7xf8v7qtt29gkxt4mjfjfc28sutvd8a', True),
('atoi1qprvelq9paakh72fgm6j2kf8kexadw3t5xljer9dpsep5c7wx5mjwdxch6z', False),
('atoi1qrwk37tz47ddng9kpxfflkpz5tplcq7ll56v4acam04307xk70l7uf6wg8j', True),
('atoi1qper3zr5xe9x0wqs35ytwh622870g44frkyygdhs0ds8yejle3xujhq7dx3', False),
('atoi1qq6lkr9hucfylqjaqphu0stvk8pcmsx98r7ukuq40asszwmqytlnc058thk', True),
('atoi1qzpn7se3ryhscmqg404pycxzvfpt8v4xn8aul0tqdh00xsncgnxu7na7zjj', False),
('atoi1qz4qqakty9qytw8fk9shelt9lwlvv83s5ggt3wjag9fkgcc74z78w4l86y5', True),
('atoi1qp20uddchglqry0l5qnjg5aln8d5rk2v5l45hwrxv9z0daxs7u6xcsh4077', False),
('atoi1qrlqm2u5txxxnjx22fxq0jfjzk6l4nwnue6ht5pepk65m2f4xmxqynmxu2m', True),
('atoi1qqydc70mpjdvl8l2wyseaseqwzhmedzzxrn4l9g2c8wdcsmhldz0ulwjxpz', False),
('atoi1qrkjennxyl2xcqem6x69ya65sasma33z0ux872k846lqft0s3qf7k6lqpft', True),
('atoi1qr4yuekp30ff7mnnnjwy9tdhynxmlmkpuxf70qurtwudp2zpf3jeyw4uh37', False),
('atoi1qp6m5sz5ayjtccfxapdk5lp4qkheyfg0emzntmulyxzftps730vcul8dmqr', True),
('atoi1qzrwhkzhu67fqltfffwljejawdcghedukpgu9x6tzevwlnq89gmfjtayhgz', False),
('atoi1qpehxcp24z947dgupjqc9ktkn5ylmdxqqnx83m7xlajnf8005756u4n7z77', True)]
- Each tuple contains
address
andbool
value indicating if the address is achange
address or not.True
means the address is a change address (internal). There are two independent sets of addresses (10 items per each). - This behavior is controlled by the
get_all
argument.get_all=False
(default) generates only public addresses.
IOTA addresses are represented by a checksumed base-32 string (Bech32). You can find a detailed explanation in the Chrysalis documentations, but here are parts relevant to this example:
- If an address starts with
atoi
then it means it is related todevnet
.iota
stands formainnet
. - Number
1
at the 5th position is just a separator. - The last 6 characters are reserved for a checksum.
Addresses can be also represented in a hex format and iota.rs
provides some convenient functions to convert addresses:
Client.bech32_to_hex()
and
Client.hex_to_bech32()
.
If you want to quickly validate any IOTA address, you can use the
Client.is_address_valid()
function that returns a
bool
value. You should perform a sanity check on address before using it.
You can generate IOTA addresses calling the
Client.get_addresses()
function and respective chaining calls that will return a list of tuples with the generated addresses. You can find
more information on the parameters in the Address/Key Space section.
The whole process is deterministic. This means the output is the same as long as the seed is the same:
loading...
Output example:
List of generated public addresses:
[
"atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"atoi1qpnrumvaex24dy0duulp4q07lpa00w20ze6jfd0xly422kdcjxzakzsz5kf",
"atoi1qz4sfmp605vnj6fxt0sf0cwclffw5hpxjqkf6fthyd74r9nmmu337m3lwl2",
...]
List of generated public addresses:
[
"atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"atoi1qpnrumvaex24dy0duulp4q07lpa00w20ze6jfd0xly422kdcjxzakzsz5kf",
"atoi1qz4sfmp605vnj6fxt0sf0cwclffw5hpxjqkf6fthyd74r9nmmu337m3lwl2",
...]
List of generated public and internal addresses:
[
("atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r", false),
("atoi1qprxpfvaz2peggq6f8k9cj8zfsxuw69e4nszjyv5kuf8yt70t2847shpjak", true),
("atoi1qpnrumvaex24dy0duulp4q07lpa00w20ze6jfd0xly422kdcjxzakzsz5kf", false),
...]
List of offline generated public addresses:
["atoi1qzt0nhsf38nh6rs4p6zs5knqp6psgha9wsv74uajqgjmwc75ugupx3y7x0r",
"atoi1qpnrumvaex24dy0duulp4q07lpa00w20ze6jfd0xly422kdcjxzakzsz5kf",
"atoi1qz4sfmp605vnj6fxt0sf0cwclffw5hpxjqkf6fthyd74r9nmmu337m3lwl2",
...]
IOTA addresses are represented by a checksumed base-32 string (Bech32). You can find a detailed explanation in the Chrysalis documentations, but here are parts relevant to this example:
- If an address starts with
atoi
then it means it is related todevnet
.iota
stands formainnet
. - Number
1
at the 5th position is just a separator. - The last 6 characters are reserved for a checksum.
Addresses can be also represented in a hex format and iota.rs
provides some convenient functions to convert addresses:
Client.bech32ToHex(bech32)
and Client.hex_to_bech32(hex, bech32_hrp (optional))
.
If you want to quickly validate any IOTA address, you can use the
Client.is_address_valid()
function that returns a bool
value. You should perform a sanity check on address before using it.
You can generate an IOTA address using the AddressGetter
helper
class and calling the Client.getAddresses()
function and respective chaining calls that will return a list of tuples with the generated addresses. You can find
more information on the parameters in the Address/Key Space section.
The whole process is deterministic. This means the output is the same as long as the seed is the same:
loading...
Output example:
[
'atoi1qz6dr6dtl0856tf0pczz7gesrf7j8a4vr00q58ld2zx7ttlv3p96snpym9z',
'atoi1qpp7sz28a0ghvd6knwnljr7j2s04qquduuc5vlz94fwf94zznj2yv5ew2c4',
'atoi1qzje6zhg5vu456eg3z84ekcfn3laxqyczche5eeqhcdh3w9yr5sqvr4z4td',
'atoi1qqwhxjmcvmatpedeedapgx0vwyupfwx9k5n4w0lnc5l6vmz78aavwhs55v0',
'atoi1qzg63t9880jtfysvpq7rrynz0rqt3kd2fw8r4934ezraz9dpwvzxkw2dtmh'
]
IOTA addresses are represented by a checksumed base-32 string (Bech32). You can find a detailed explanation in the Chrysalis documentations, but here are parts relevant to this example:
- If an address starts with
atoi
then it means it is related todevnet
.iota
stands formainnet
. - Number
1
at the 5th positvion is just a separator. - The last 6 characters are reserved for a checksum.
Addresses can be also represented in a hex format and iota.rs
provides some convenient functions to convert addresses:
Client.bech32ToHex(address)
and
Client.hexToBech32(address, bech32)
.
If you want to quickly validate any IOTA address, you can use the
Client.isAddressValid()
function that
returns a bool
value. You should perform a sanity check on address before using it.