Client Side Implementation
This explains how the password is used on the client
Creating and account
export async function setUpAccount(
password: string,
ethEncryptPublicKey: string,
) {
const note = newAccountSecrets();
const secrets = decodeAccountSecrets(note);
const commitment = toNoteHex(secrets.commitment);
//Password encrypt the note!
const passwdEncryptedNote = await aesEncryptData(note, password);
//Encrypt the note with a public key
const encryptedNote = await ethEncryptData(
ethEncryptPublicKey,
passwdEncryptedNote,
);
const packed = await packEncryptedMessage(encryptedNote);
return { encryptedNote: packed, commitment };Checkout page
Last updated