Key Management class. Enables the creation of a new Aleo Account, importation of an existing account from an existing private key or seed, and message signing and verification functionality. An Aleo Account is generated from a randomly generated seed (number) from which an account private key, view key, and a public account address are derived. The private key lies at the root of an Aleo account. It is a highly sensitive secret and should be protected as it allows for creation of Aleo Program executions and arbitrary value transfers. The View Key allows for decryption of a user's activity on the blockchain. The Address is the public address to which other users of Aleo can send Aleo credits and other records to. This class should only be used environments where the safety of the underlying key material can be assured.
Key Management class. Enables the creation of a new Aleo Account, importation of an existing account from an existing private key or seed, and message signing and verification functionality. An Aleo Account is generated from a randomly generated seed (number) from which an account private key, view key, and a public account address are derived. The private key lies at the root of an Aleo account. It is a highly sensitive secret and should be protected as it allows for creation of Aleo Program executions and arbitrary value transfers. The View Key allows for decryption of a user's activity on the blockchain. The Address is the public address to which other users of Aleo can send Aleo credits and other records to. This class should only be used environments where the safety of the underlying key material can be assured.
// Create a connection to the Aleo network and an account
-let connection = new NodeConnection("vm.aleo.org/api");
-let account = Account.fromCiphertext("ciphertext", "password");
+myRandomAccount.verify(hello_world, signature)
// Create a connection to the Aleo network and an account
+const connection = new AleoNetworkClient("https://api.explorer.provable.com/v1");
+const account = Account.fromCiphertext("ciphertext", "password");
// Get a record from the network
-let record = connection.getBlock(1234);
-let recordCipherText = record.transactions[0].execution.transitions[0].id;
+const record = connection.getBlock(1234);
+const recordCipherText = record.transactions[0].execution.transitions[0].id;
// Check if the account owns the record
if account.ownsRecord(recordCipherText) {
@@ -38,12 +38,12 @@
// Store the record in a local database
// Etc.
}
ownsRecordCiphertext(ciphertext) → {boolean}
Determines whether the account owns a ciphertext record
// Create a connection to the Aleo network and an account
-let connection = new NodeConnection("vm.aleo.org/api");
-let account = Account.fromCiphertext("ciphertext", "password");
+const connection = new AleoNetworkClient("https://api.explorer.provable.com/v1");
+const account = Account.fromCiphertext("ciphertext", "password");
// Get a record from the network
-let record = connection.getBlock(1234);
-let recordCipherText = record.transactions[0].execution.transitions[0].id;
+const record = connection.getBlock(1234);
+const recordCipherText = record.transactions[0].execution.transitions[0].id;
// Check if the account owns the record
if account.ownsRecord(recordCipherText) {
@@ -51,14 +51,14 @@
// Decrypt the record and check if it's spent
// Store the record in a local database
// Etc.
-}
sign(message) → {Signature}
Signs a message with the account's private key. Returns a Signature.