For security reasons I've created an IOTA address offline. Before I transfer into this address, how can I ensure this address is valid?
-
Why would you doubt that it is valid?– ZauzCommented Nov 29, 2017 at 21:09
-
@Zauz because I'm wanting to transfer money into the address. I don't want to risk having it end up somewhere which isn't in my control.– James DonnellyCommented Nov 29, 2017 at 21:13
-
1@Helmar the process to register an address with Tangle involves entering the address's seed into a web-connected wallet. I don't feel comfortable doing that for three reasons: 1. I don't know who may be looking over my shoulder, 2. I don't know who may be monitoring my network traffic, and 3. I don't know who may be monitoring the wallet's network traffic (assuming the seed gets broadcast in some way).– James DonnellyCommented Nov 29, 2017 at 21:15
-
1@Helmar but how then can I view my address's balance?– James DonnellyCommented Nov 29, 2017 at 21:26
3 Answers
It seems like what you want to avoid is the risk that your funds will "end up somewhere which isn't in my control."
In that case, you should use the IOTA API to double-check that your seed produces your address. This will ensure that you indeed have access to funds at that address. This can be done entirely offline, using the IOTA JavaScript API and the following code:
var IOTA = require('iota.lib.js');
var iota = new IOTA({
'provider': null
});
var seed = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
var index = 0;
var security = 2;
iota.api.getNewAddress(seed, {"index": index, "security": security, "checksum": true, "total": 1}, function(error, addr) {
if (error) {
console.log(error);
} else {
console.log("Address for seed " + seed + " at index " + index + " is: ");
console.log(addr[0]);
}
});
You can generate your address with the option checksum: true
. It will give you a 90 characters address where last 9 chars are the checksum.
Before attaching this address to the tangle you can use the function
Utils.isValidChecksum(<90 chars address>)
to check that your address is valid.
- send only a small amount of IOTA or even a zero value transaction of the address
- check if you see the transaction in your wallet
- send the rest of your IOTA
Although this would work, it shouldn't really be an issue, if you generated the address with a tool that works like the official IOTA light wallet or any of the official IOTA libraries from iotaledger because they don't make mistakes when generating addresses.
Furthermore, you may have noticed that some addresses are 90 trytes long (when IOTA addresses are really only 81 trytes long). This is because they have a 9-tryte checksum which is only in place so that human errors (when copying or transmitting) don't happen. Basically if you want to send a transaction to an address from the light wallet, it won't let you if the checksum doesn't match the address.
You might want to check, if your offline generated address has a length of 81 or 90. If it is only 81, generate it again. There is usually an option to generate it together with the checksum.