Initializing communication keys
First of all, you should request access to the wallet account. It will trigger wallet's window for providing you with permission. Let’s do this:
const account = await wallet.requestAuthentication();
Now, we are ready for creation of our first communication key. Let's request Ylide Password ( Glossary) and create your key:
const ylidePassword = prompt(`Enter Ylide password for your first key:`);
if (!ylidePassword) {
return;
}
const key = await keystore.create(
'For your first key',
'evm', // blockchain group
'web3', // wallet name
account.address,
ylidePassword
);
Now, key is ready, encrypted and saved into the storage. To store it decrypted let’s do the following:
// Switch key storage mode to decrypted
await key.storeUnencrypted(ylidePassword);
// Save the key in the storage again
await keystore.save();
Key is ready and available for usage.
Last modified 6mo ago