Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aztec/accounts

Package Overview
Dependencies
Maintainers
6
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aztec/accounts - npm Package Compare versions

Comparing version 0.35.1 to 0.36.0

3

dest/defaults/account_contract.d.ts
import { type AccountContract, type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type CompleteAddress } from '@aztec/circuit-types';
import { type Fr } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';

@@ -15,4 +16,4 @@ import { type NodeInfo } from '@aztec/types/interfaces';

getContractArtifact(): ContractArtifact;
getInterface(address: CompleteAddress, nodeInfo: NodeInfo): AccountInterface;
getInterface(address: CompleteAddress, publicKeysHash: Fr, nodeInfo: NodeInfo): AccountInterface;
}
//# sourceMappingURL=account_contract.d.ts.map

@@ -13,6 +13,6 @@ import { DefaultAccountInterface } from '../defaults/account_interface.js';

}
getInterface(address, nodeInfo) {
return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, nodeInfo);
getInterface(address, publicKeysHash, nodeInfo) {
return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, publicKeysHash, nodeInfo);
}
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9jb250cmFjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZWZhdWx0cy9hY2NvdW50X2NvbnRyYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGtDQUFrQyxDQUFDO0FBRTNFOzs7R0FHRztBQUNILE1BQU0sT0FBZ0Isc0JBQXNCO0lBSTFDLFlBQW9CLFFBQTBCO1FBQTFCLGFBQVEsR0FBUixRQUFRLENBQWtCO0lBQUcsQ0FBQztJQUVsRCxtQkFBbUI7UUFDakIsT0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDO0lBQ3ZCLENBQUM7SUFFRCxZQUFZLENBQUMsT0FBd0IsRUFBRSxRQUFrQjtRQUN2RCxPQUFPLElBQUksdUJBQXVCLENBQUMsSUFBSSxDQUFDLHNCQUFzQixDQUFDLE9BQU8sQ0FBQyxFQUFFLE9BQU8sRUFBRSxRQUFRLENBQUMsQ0FBQztJQUM5RixDQUFDO0NBQ0YifQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9jb250cmFjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZWZhdWx0cy9hY2NvdW50X2NvbnRyYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1BLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLGtDQUFrQyxDQUFDO0FBRTNFOzs7R0FHRztBQUNILE1BQU0sT0FBZ0Isc0JBQXNCO0lBSTFDLFlBQW9CLFFBQTBCO1FBQTFCLGFBQVEsR0FBUixRQUFRLENBQWtCO0lBQUcsQ0FBQztJQUVsRCxtQkFBbUI7UUFDakIsT0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDO0lBQ3ZCLENBQUM7SUFFRCxZQUFZLENBQUMsT0FBd0IsRUFBRSxjQUFrQixFQUFFLFFBQWtCO1FBQzNFLE9BQU8sSUFBSSx1QkFBdUIsQ0FBQyxJQUFJLENBQUMsc0JBQXNCLENBQUMsT0FBTyxDQUFDLEVBQUUsT0FBTyxFQUFFLGNBQWMsRUFBRSxRQUFRLENBQUMsQ0FBQztJQUM5RyxDQUFDO0NBQ0YifQ==

@@ -13,8 +13,10 @@ import { type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';

private address;
private publicKeysHash;
private entrypoint;
private chainId;
private version;
constructor(authWitnessProvider: AuthWitnessProvider, address: CompleteAddress, nodeInfo: Pick<NodeInfo, 'chainId' | 'protocolVersion'>);
constructor(authWitnessProvider: AuthWitnessProvider, address: CompleteAddress, publicKeysHash: Fr, nodeInfo: Pick<NodeInfo, 'chainId' | 'protocolVersion'>);
createTxExecutionRequest(execution: ExecutionRequestInit): Promise<TxExecutionRequest>;
createAuthWit(messageHash: Fr): Promise<AuthWitness>;
getPublicKeysHash(): Fr;
getCompleteAddress(): CompleteAddress;

@@ -21,0 +23,0 @@ getAddress(): AztecAddress;

@@ -8,5 +8,6 @@ import { Fr } from '@aztec/circuits.js';

export class DefaultAccountInterface {
constructor(authWitnessProvider, address, nodeInfo) {
constructor(authWitnessProvider, address, publicKeysHash, nodeInfo) {
this.authWitnessProvider = authWitnessProvider;
this.address = address;
this.publicKeysHash = publicKeysHash;
this.entrypoint = new DefaultAccountEntrypoint(address.address, authWitnessProvider, nodeInfo.chainId, nodeInfo.protocolVersion);

@@ -22,2 +23,5 @@ this.chainId = new Fr(nodeInfo.chainId);

}
getPublicKeysHash() {
return this.publicKeysHash;
}
getCompleteAddress() {

@@ -36,2 +40,2 @@ return this.address;

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudF9pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGVmYXVsdHMvYWNjb3VudF9pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsT0FBTyxFQUEyQyxFQUFFLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNqRixPQUFPLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUd0RTs7O0dBR0c7QUFDSCxNQUFNLE9BQU8sdUJBQXVCO0lBS2xDLFlBQ1UsbUJBQXdDLEVBQ3hDLE9BQXdCLEVBQ2hDLFFBQXVEO1FBRi9DLHdCQUFtQixHQUFuQixtQk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dELENBQUM7SUFFRCxpQkFBaUI7UUFDZixPQUFPLElBQUksQ0FBQyxjQUFjLENBQUM7SUFDN0IsQ0FBQztJQUVELGtCQUFrQjtRQUNoQixPQUFPLElBQUksQ0FBQyxPQUFPLENBQUM7SUFDdEIsQ0FBQztJQUVELFVBQVU7UUFDUixPQUFPLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxDQUFDO0lBQzlCLENBQUM7SUFFRCxVQUFVO1FBQ1IsT0FBTyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3RCLENBQUM7SUFFRCxVQUFVO1FBQ1IsT0FBTyxJQUFJLENBQUMsT0FBTyxDQUFDO0lBQ3RCLENBQUM7Q0FDRiJ9

@@ -10,4 +10,4 @@ /// <reference types="node" resolution-mode="require"/>

import { type AccountWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type PXE } from '@aztec/circuit-types';
import { type AztecAddress, type Fr } from '@aztec/circuits.js';
import { EcdsaAccountContract } from './account_contract.js';

@@ -19,7 +19,7 @@ export { EcdsaAccountContractArtifact } from './artifact.js';

* @param pxe - An PXE server instance.
* @param encryptionPrivateKey - Grumpkin key used for note encryption.
* @param secretKey - Secret key used to derive all the keystore keys.
* @param signingPrivateKey - Secp256k1 key used for signing transactions.
* @param salt - Deployment salt.
*/
export declare function getEcdsaAccount(pxe: PXE, encryptionPrivateKey: GrumpkinPrivateKey, signingPrivateKey: Buffer, salt?: Salt): AccountManager;
export declare function getEcdsaAccount(pxe: PXE, secretKey: Fr, signingPrivateKey: Buffer, salt?: Salt): AccountManager;
/**

@@ -26,0 +26,0 @@ * Gets a wallet for an already registered account using ECDSA signatures.

@@ -15,8 +15,8 @@ /**

* @param pxe - An PXE server instance.
* @param encryptionPrivateKey - Grumpkin key used for note encryption.
* @param secretKey - Secret key used to derive all the keystore keys.
* @param signingPrivateKey - Secp256k1 key used for signing transactions.
* @param salt - Deployment salt.
*/
export function getEcdsaAccount(pxe, encryptionPrivateKey, signingPrivateKey, salt) {
return new AccountManager(pxe, encryptionPrivateKey, new EcdsaAccountContract(signingPrivateKey), salt);
export function getEcdsaAccount(pxe, secretKey, signingPrivateKey, salt) {
return new AccountManager(pxe, secretKey, new EcdsaAccountContract(signingPrivateKey), salt);
}

@@ -33,2 +33,2 @@ /**

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZWNkc2EvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0dBS0c7QUFDSCxPQUFPLEVBQUUsY0FBYyxFQUFhLE1BQU0seUJBQXlCLENBQUM7QUFDcEUsT0FBTyxFQUFzQixTQUFTLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUl2RSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUU3RCxPQUFPLEVBQUUsNEJBQTRCLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDN0QsT0FBTyxFQUFFLG9CQUFvQixFQUFFLENBQUM7QUFFaEM7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLGVBQWUsQ0FDN0IsR0FBUSxFQUNSLG9CQUF3QyxFQUN4QyxpQkFBeUIsRUFDekIsSUFBVztJQUVYLE9BQU8sSUFBSSxjQUFjLENBQUMsR0FBRyxFQUFFLG9CQUFvQixFQUFFLElBQUksb0JBQW9CLENBQUMsaUJBQWlCLENBQUMsRUFBRSxJQUFJLENBQUMsQ0FBQztBQUMxRyxDQUFDO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxVQUFVLGNBQWMsQ0FBQyxHQUFRLEVBQUUsT0FBcUIsRUFBRSxpQkFBeUI7SUFDdkYsT0FBTyxTQUFTLENBQUMsR0FBRyxFQU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} from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type AztecAddress, type Fr } from '@aztec/circuits.js';
import { SchnorrAccountContract } from './account_contract.js';

@@ -18,7 +18,7 @@ export { SchnorrAccountContract };

* @param pxe - An PXE server instance.
* @param encryptionPrivateKey - Grumpkin key used for note encryption.
* @param secretKey - Secret key used to derive all the keystore keys.
* @param signingPrivateKey - Grumpkin key used for signing transactions.
* @param salt - Deployment salt.
*/
export declare function getSchnorrAccount(pxe: PXE, encryptionPrivateKey: GrumpkinPrivateKey, signingPrivateKey: GrumpkinPrivateKey, salt?: Salt): AccountManager;
export declare function getSchnorrAccount(pxe: PXE, secretKey: Fr, signingPrivateKey: GrumpkinPrivateKey, salt?: Salt): AccountManager;
/**

@@ -25,0 +25,0 @@ * Gets a wallet for an already registered account using Schnorr signatures.

@@ -15,8 +15,8 @@ /**

* @param pxe - An PXE server instance.
* @param encryptionPrivateKey - Grumpkin key used for note encryption.
* @param secretKey - Secret key used to derive all the keystore keys.
* @param signingPrivateKey - Grumpkin key used for signing transactions.
* @param salt - Deployment salt.
*/
export function getSchnorrAccount(pxe, encryptionPrivateKey, signingPrivateKey, salt) {
return new AccountManager(pxe, encryptionPrivateKey, new SchnorrAccountContract(signingPrivateKey), salt);
export function getSchnorrAccount(pxe, secretKey, signingPrivateKey, salt) {
return new AccountManager(pxe, secretKey, new SchnorrAccountContract(signingPrivateKey), salt);
}

@@ -33,2 +33,2 @@ /**

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2Nobm9yci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7R0FLRztBQUNILE9BQU8sRUFBRSxjQUFjLEVBQWEsTUFBTSx5QkFBeUIsQ0FBQztBQUNwRSxPQUFPLEVBQXNCLFNBQVMsRUFBRSxNQ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Bc0IsRUFBRSxDQUFDO0FBRWxDLE9BQU8sRUFBRSw4QkFBOEIsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUUvRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsaUJBQWlCLENBQy9CLEdBQVEsRUFDUixTQUFhLEVBQ2IsaUJBQXFDLEVBQ3JDLElBQVc7SUFFWCxPQUFPLElBQUksY0FBYyxDQUFDLEdBQUcsRUFBRSxTQUFTLEVBQUUsSUFBSSxzQkFBc0IsQ0FBQyxpQkFBaUIsQ0FBQyxFQUFFLElBQUksQ0FBQyxDQUFDO0FBQ2pHLENBQUM7QUFFRDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsZ0JBQWdCLENBQzlCLEdBQVEsRUFDUixPQUFxQixFQUNyQixpQkFBcUM7SUFFckMsT0FBTyxTQUFTLENBQUMsR0FBRyxFQUFFLE9BQU8sRUFBRSxJQUFJLHNCQUFzQixDQUFDLGlCQUFpQixDQUFDLENBQUMsQ0FBQztBQUNoRixDQUFDIn0=

@@ -10,3 +10,3 @@ /**

import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type AztecAddress, type Fr } from '@aztec/circuits.js';
import { SingleKeyAccountContract } from './account_contract.js';

@@ -18,6 +18,6 @@ export { SingleKeyAccountContract };

* @param pxe - An PXE server instance.
* @param encryptionAndSigningPrivateKey - Grumpkin key used for note encryption and signing transactions.
* @param salt - Deployment salt .
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
* @param salt - Deployment salt.
*/
export declare function getSingleKeyAccount(pxe: PXE, encryptionAndSigningPrivateKey: GrumpkinPrivateKey, salt?: Salt): AccountManager;
export declare function getSingleKeyAccount(pxe: PXE, secretKey: Fr, salt?: Salt): AccountManager;
/**

@@ -24,0 +24,0 @@ * Gets a wallet for an already registered account using Schnorr signatures with a single key for encryption and authentication.

@@ -9,2 +9,4 @@ /**

import { getWallet } from '@aztec/aztec.js/wallet';
import { GeneratorIndex } from '@aztec/circuits.js';
import { sha512ToGrumpkinScalar } from '@aztec/foundation/crypto';
import { SingleKeyAccountContract } from './account_contract.js';

@@ -16,7 +18,8 @@ export { SingleKeyAccountContract };

* @param pxe - An PXE server instance.
* @param encryptionAndSigningPrivateKey - Grumpkin key used for note encryption and signing transactions.
* @param salt - Deployment salt .
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
* @param salt - Deployment salt.
*/
export function getSingleKeyAccount(pxe, encryptionAndSigningPrivateKey, salt) {
return new AccountManager(pxe, encryptionAndSigningPrivateKey, new SingleKeyAccountContract(encryptionAndSigningPrivateKey), salt);
export function getSingleKeyAccount(pxe, secretKey, salt) {
const encryptionPrivateKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
return new AccountManager(pxe, secretKey, new SingleKeyAccountContract(encryptionPrivateKey), salt);
}

@@ -34,2 +37,2 @@ /**

export { getSingleKeyAccount as getUnsafeSchnorrAccount, getSingleKeyWallet as getUnsafeSchnorrWallet };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2luZ2xlX2tleS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7R0FLRztBQUNILE9BQU8sRUFBRSxjQUFjLEVBQWEsTUFBTSx5QkFBeUIsQ0FBQztBQUNwRSxPQUFPLEVBQXNCLFNBQVMsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBSXZFLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBRWpFLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxDQUFDO0FBRXBDLE9BQU8sRUFBRSx1Q0FBdUMsSUFBSSxnQ0FBZ0MsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUU1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F3QixFQUFFLENBQUM7QUFFcEMsT0FBTyxFQUFFLHVDQUF1QyxJQUFJLGdDQUFnQyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBRTVHOzs7OztHQUtHO0FBQ0gsTUFBTSxVQUFVLG1CQUFtQixDQUFDLEdBQVEsRUFBRSxTQUFhLEVBQUUsSUFBVztJQUN0RSxNQUFNLG9CQUFvQixHQUFHLHNCQUFzQixDQUFDLENBQUMsU0FBUyxFQUFFLGNBQWMsQ0FBQyxNQUFNLENBQUMsQ0FBQyxDQUFDO0lBQ3hGLE9BQU8sSUFBSSxjQUFjLENBQUMsR0FBRyxFQUFFLFNBQVMsRUFBRSxJQUFJLHdCQUF3QixDQUFDLG9CQUFvQixDQUFDLEVBQUUsSUFBSSxDQUFDLENBQUM7QUFDdEcsQ0FBQztBQUVEOzs7Ozs7R0FNRztBQUNILE1BQU0sVUFBVSxrQkFBa0IsQ0FDaEMsR0FBUSxFQUNSLE9BQXFCLEVBQ3JCLFVBQThCO0lBRTlCLE9BQU8sU0FBUyxDQUFDLEdBQUcsRUFBRSxPQUFPLEVBQUUsSUFBSSx3QkFBd0IsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO0FBQzNFLENBQUM7QUFFRCxPQUFPLEVBQUUsbUJBQW1CLElBQUksdUJBQXVCLEVBQUUsa0JBQWtCLElBQUksc0JBQXNCLEVBQUUsQ0FBQyJ9

@@ -1,4 +0,5 @@

import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';
import { Fr } from '@aztec/foundation/fields';
export declare const INITIAL_TEST_SECRET_KEYS: Fr[];
export declare const INITIAL_TEST_ENCRYPTION_KEYS: import("@aztec/aztec.js").Fq[];

@@ -12,3 +13,3 @@ export declare const INITIAL_TEST_SIGNING_KEYS: import("@aztec/aztec.js").Fq[];

*/
export declare function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithPrivateKey[]>;
export declare function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]>;
/**

@@ -19,3 +20,3 @@ * Queries a PXE for it's registered accounts and returns wallets for those accounts using keys in the initial test accounts.

*/
export declare function getDeployedTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithPrivateKey[]>;
export declare function getDeployedTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]>;
/**

@@ -28,4 +29,4 @@ * Deploys the initial set of schnorr signature accounts to the test environment

account: import("@aztec/aztec.js").AccountManager;
privateKey: import("@aztec/aztec.js").Fq;
secretKey: Fr;
}[]>;
//# sourceMappingURL=configuration.d.ts.map
import { generatePublicKey } from '@aztec/aztec.js';
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
import { GeneratorIndex } from '@aztec/circuits.js/constants';
import { sha512ToGrumpkinScalar } from '@aztec/foundation/crypto';
import { Fr } from '@aztec/foundation/fields';
import { getSchnorrAccount } from '../schnorr/index.js';
export const INITIAL_TEST_ENCRYPTION_KEYS = [
GrumpkinScalar.fromString('2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281'),
GrumpkinScalar.fromString('aebd1b4be76efa44f5ee655c20bf9ea60f7ae44b9a7fd1fd9f189c7a0b0cdae'),
GrumpkinScalar.fromString('0f6addf0da06c33293df974a565b03d1ab096090d907d98055a8b7f4954e120c'),
export const INITIAL_TEST_SECRET_KEYS = [
Fr.fromString('2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281'),
Fr.fromString('aebd1b4be76efa44f5ee655c20bf9ea60f7ae44b9a7fd1fd9f189c7a0b0cdae'),
Fr.fromString('0f6addf0da06c33293df974a565b03d1ab096090d907d98055a8b7f4954e120c'),
];
export const INITIAL_TEST_ENCRYPTION_KEYS = INITIAL_TEST_SECRET_KEYS.map(secretKey => sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]));
// TODO(#5837): come up with a standard signing key derivation scheme instead of using ivsk_m as signing keys here
export const INITIAL_TEST_SIGNING_KEYS = INITIAL_TEST_ENCRYPTION_KEYS;

@@ -17,3 +21,3 @@ export const INITIAL_TEST_ACCOUNT_SALTS = [Fr.ZERO, Fr.ZERO, Fr.ZERO];

export function getInitialTestAccountsWallets(pxe) {
return Promise.all(INITIAL_TEST_ENCRYPTION_KEYS.map((encryptionKey, i) => getSchnorrAccount(pxe, encryptionKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]).getWallet()));
return Promise.all(INITIAL_TEST_SECRET_KEYS.map((encryptionKey, i) => getSchnorrAccount(pxe, encryptionKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]).getWallet()));
}

@@ -27,6 +31,11 @@ /**

const registeredAccounts = await pxe.getRegisteredAccounts();
return Promise.all(INITIAL_TEST_ENCRYPTION_KEYS.filter(initialKey => {
const publicKey = generatePublicKey(initialKey);
return Promise.all(INITIAL_TEST_SECRET_KEYS.filter(initialSecretKey => {
const initialEncryptionKey = sha512ToGrumpkinScalar([initialSecretKey, GeneratorIndex.IVSK_M]);
const publicKey = generatePublicKey(initialEncryptionKey);
return registeredAccounts.find(registered => registered.publicKey.equals(publicKey)) != undefined;
}).map((encryptionKey, i) => getSchnorrAccount(pxe, encryptionKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]).getWallet()));
}).map(secretKey => {
const signingKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
// TODO(#5726): use actual salt here instead of hardcoding Fr.ZERO
return getSchnorrAccount(pxe, secretKey, signingKey, Fr.ZERO).getWallet();
}));
}

@@ -39,7 +48,7 @@ /**

export async function deployInitialTestAccounts(pxe) {
const accounts = INITIAL_TEST_ENCRYPTION_KEYS.map((privateKey, i) => {
const account = getSchnorrAccount(pxe, privateKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]);
const accounts = INITIAL_TEST_SECRET_KEYS.map((secretKey, i) => {
const account = getSchnorrAccount(pxe, secretKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]);
return {
account,
privateKey,
secretKey,
};

@@ -69,2 +78,2 @@ });

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2NvbmZpZ3VyYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFHcEQsT0FBTyxFQUFFLEVBQUUsRUFBRSxjQUFjLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUU5RCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUV4RCxNQUFNLENBQUMsTUFBTSw0QkFBNEIsR0FBRztJQUMxQyxjQUFjLENBQUMsVUFBVSxDQUFDLGtFQUFrRSxDQUFDO0lBQzdGLGNBQWMsQ0FBQyxVQUFVLENBQUMsaUVBQWlFLENBQUM7SUFDNUYsY0FBYyxDQUFDLFVBQVUsQ0FBQyxrRUFBa0UsQ0FBQztDQUM5RixDQUFDO0FBRUYsTUFBTSxDQUFDLE1BQU0seUJBQXlCLEdBQUcsNEJBQTRCLENBQUM7QUFFdEUsTUFBTSxDQUFDLE1BQU0sMEJBQTBCLEdBQUcsQ0FBQyxFQUFFLENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FBQyxJQUFJLEVBQUUsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDO0FBRXRFOzs7O0dBSUc7QUFDSCxNQUFNLFVBQVUsNkJBQTZCLENBQUMsR0FBUTtJQUNwRCxPQUFPLE9BQU8sQ0FBQyxHQUFHLENBQ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lBQzdCLENBQUMsQ0FBQyxDQUNILENBQUM7SUFDRixPQUFPLFFBQVEsQ0FBQztBQUNsQixDQUFDIn0=

@@ -1,2 +0,2 @@

import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';

@@ -8,3 +8,3 @@ /**

*/
export declare function createAccount(pxe: PXE): Promise<AccountWalletWithPrivateKey>;
export declare function createAccount(pxe: PXE): Promise<AccountWalletWithSecretKey>;
/**

@@ -16,3 +16,3 @@ * Creates a given number of random accounts using the Schnorr account wallet.

*/
export declare function createAccounts(pxe: PXE, numberOfAccounts?: number): Promise<AccountWalletWithPrivateKey[]>;
export declare function createAccounts(pxe: PXE, numberOfAccounts?: number): Promise<AccountWalletWithSecretKey[]>;
//# sourceMappingURL=create_account.d.ts.map

@@ -1,2 +0,3 @@

import { GrumpkinScalar } from '@aztec/circuits.js';
import { Fr, GeneratorIndex } from '@aztec/circuits.js';
import { sha512ToGrumpkinScalar } from '@aztec/foundation/crypto';
import { getSchnorrAccount } from '../schnorr/index.js';

@@ -9,3 +10,5 @@ /**

export function createAccount(pxe) {
return getSchnorrAccount(pxe, GrumpkinScalar.random(), GrumpkinScalar.random()).waitSetup();
const secretKey = Fr.random();
const signingKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
return getSchnorrAccount(pxe, secretKey, signingKey).waitSetup();
}

@@ -22,3 +25,5 @@ /**

for (let i = 0; i < numberOfAccounts; ++i) {
const account = getSchnorrAccount(pxe, GrumpkinScalar.random(), GrumpkinScalar.random());
const secretKey = Fr.random();
const signingKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
const account = getSchnorrAccount(pxe, secretKey, signingKey);
// Unfortunately the function below is not stateless and we call it here because it takes a long time to run and

@@ -40,2 +45,2 @@ // the results get stored within the account object. By calling it here we increase the probability of all the

}
//# sourceMappingURL=data:application/json;base64,eyJ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UFDLGVBQWUsRUFBRSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUN2QyxDQUFDLENBQUMsS0FBSyxDQUFDO1lBQ04sbUJBQW1CLEVBQUUsT0FBTyxDQUFDLElBQUk7WUFDakMscUJBQXFCLEVBQUUsSUFBSTtZQUMzQixvQkFBb0IsRUFBRSxJQUFJO1lBQzFCLGVBQWUsRUFBRSxJQUFJO1NBQ3RCLENBQUMsQ0FDSCxDQUFDO1FBQ0YsUUFBUSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUN6QixDQUFDO0lBRUQsdUNBQXVDO0lBQ3ZDLE1BQU0sR0FBRyxHQUFHLE1BQU0sT0FBTyxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUMsT0FBTyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQztJQUN6RSxNQUFNLE9BQU8sQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsRUFBRSxRQUFRLEVBQUUsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDN0QsT0FBTyxPQUFPLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQyxPQUFPLENBQUMsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ25FLENBQUMifQ==

@@ -5,3 +5,3 @@ {

"description": "Implementation of sample account contracts for Aztec Network",
"version": "0.35.1",
"version": "0.36.0",
"type": "module",

@@ -54,12 +54,20 @@ "exports": {

".ts"
],
"reporters": [
[
"default",
{
"summaryThreshold": 9999
}
]
]
},
"dependencies": {
"@aztec/aztec.js": "0.35.1",
"@aztec/circuit-types": "0.35.1",
"@aztec/circuits.js": "0.35.1",
"@aztec/entrypoints": "0.35.1",
"@aztec/ethereum": "0.35.1",
"@aztec/foundation": "0.35.1",
"@aztec/types": "0.35.1",
"@aztec/aztec.js": "0.36.0",
"@aztec/circuit-types": "0.36.0",
"@aztec/circuits.js": "0.36.0",
"@aztec/entrypoints": "0.36.0",
"@aztec/ethereum": "0.36.0",
"@aztec/foundation": "0.36.0",
"@aztec/types": "0.36.0",
"tslib": "^2.4.0"

@@ -66,0 +74,0 @@ },

import { type AccountContract, type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';
import { type CompleteAddress } from '@aztec/circuit-types';
import { type Fr } from '@aztec/circuits.js';
import { type ContractArtifact } from '@aztec/foundation/abi';

@@ -22,5 +23,5 @@ import { type NodeInfo } from '@aztec/types/interfaces';

getInterface(address: CompleteAddress, nodeInfo: NodeInfo): AccountInterface {
return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, nodeInfo);
getInterface(address: CompleteAddress, publicKeysHash: Fr, nodeInfo: NodeInfo): AccountInterface {
return new DefaultAccountInterface(this.getAuthWitnessProvider(address), address, publicKeysHash, nodeInfo);
}
}

@@ -20,2 +20,3 @@ import { type AccountInterface, type AuthWitnessProvider } from '@aztec/aztec.js/account';

private address: CompleteAddress,
private publicKeysHash: Fr,
nodeInfo: Pick<NodeInfo, 'chainId' | 'protocolVersion'>,

@@ -41,2 +42,6 @@ ) {

getPublicKeysHash(): Fr {
return this.publicKeysHash;
}
getCompleteAddress(): CompleteAddress {

@@ -43,0 +48,0 @@ return this.address;

@@ -9,4 +9,4 @@ /**

import { type AccountWallet, getWallet } from '@aztec/aztec.js/wallet';
import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type PXE } from '@aztec/circuit-types';
import { type AztecAddress, type Fr } from '@aztec/circuits.js';

@@ -21,13 +21,8 @@ import { EcdsaAccountContract } from './account_contract.js';

* @param pxe - An PXE server instance.
* @param encryptionPrivateKey - Grumpkin key used for note encryption.
* @param secretKey - Secret key used to derive all the keystore keys.
* @param signingPrivateKey - Secp256k1 key used for signing transactions.
* @param salt - Deployment salt.
*/
export function getEcdsaAccount(
pxe: PXE,
encryptionPrivateKey: GrumpkinPrivateKey,
signingPrivateKey: Buffer,
salt?: Salt,
): AccountManager {
return new AccountManager(pxe, encryptionPrivateKey, new EcdsaAccountContract(signingPrivateKey), salt);
export function getEcdsaAccount(pxe: PXE, secretKey: Fr, signingPrivateKey: Buffer, salt?: Salt): AccountManager {
return new AccountManager(pxe, secretKey, new EcdsaAccountContract(signingPrivateKey), salt);
}

@@ -34,0 +29,0 @@

@@ -10,3 +10,3 @@ /**

import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type AztecAddress, type Fr } from '@aztec/circuits.js';

@@ -22,3 +22,3 @@ import { SchnorrAccountContract } from './account_contract.js';

* @param pxe - An PXE server instance.
* @param encryptionPrivateKey - Grumpkin key used for note encryption.
* @param secretKey - Secret key used to derive all the keystore keys.
* @param signingPrivateKey - Grumpkin key used for signing transactions.

@@ -29,7 +29,7 @@ * @param salt - Deployment salt.

pxe: PXE,
encryptionPrivateKey: GrumpkinPrivateKey,
secretKey: Fr,
signingPrivateKey: GrumpkinPrivateKey,
salt?: Salt,
): AccountManager {
return new AccountManager(pxe, encryptionPrivateKey, new SchnorrAccountContract(signingPrivateKey), salt);
return new AccountManager(pxe, secretKey, new SchnorrAccountContract(signingPrivateKey), salt);
}

@@ -36,0 +36,0 @@

@@ -10,3 +10,4 @@ /**

import { type GrumpkinPrivateKey, type PXE } from '@aztec/circuit-types';
import { type AztecAddress } from '@aztec/circuits.js';
import { type AztecAddress, type Fr, GeneratorIndex } from '@aztec/circuits.js';
import { sha512ToGrumpkinScalar } from '@aztec/foundation/crypto';

@@ -22,16 +23,8 @@ import { SingleKeyAccountContract } from './account_contract.js';

* @param pxe - An PXE server instance.
* @param encryptionAndSigningPrivateKey - Grumpkin key used for note encryption and signing transactions.
* @param salt - Deployment salt .
* @param secretKey - Secret key used to derive all the keystore keys (in this case also used to get signing key).
* @param salt - Deployment salt.
*/
export function getSingleKeyAccount(
pxe: PXE,
encryptionAndSigningPrivateKey: GrumpkinPrivateKey,
salt?: Salt,
): AccountManager {
return new AccountManager(
pxe,
encryptionAndSigningPrivateKey,
new SingleKeyAccountContract(encryptionAndSigningPrivateKey),
salt,
);
export function getSingleKeyAccount(pxe: PXE, secretKey: Fr, salt?: Salt): AccountManager {
const encryptionPrivateKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
return new AccountManager(pxe, secretKey, new SingleKeyAccountContract(encryptionPrivateKey), salt);
}

@@ -38,0 +31,0 @@

import { generatePublicKey } from '@aztec/aztec.js';
import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
import { GeneratorIndex } from '@aztec/circuits.js/constants';
import { sha512ToGrumpkinScalar } from '@aztec/foundation/crypto';
import { Fr } from '@aztec/foundation/fields';
import { getSchnorrAccount } from '../schnorr/index.js';
export const INITIAL_TEST_ENCRYPTION_KEYS = [
GrumpkinScalar.fromString('2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281'),
GrumpkinScalar.fromString('aebd1b4be76efa44f5ee655c20bf9ea60f7ae44b9a7fd1fd9f189c7a0b0cdae'),
GrumpkinScalar.fromString('0f6addf0da06c33293df974a565b03d1ab096090d907d98055a8b7f4954e120c'),
export const INITIAL_TEST_SECRET_KEYS = [
Fr.fromString('2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281'),
Fr.fromString('aebd1b4be76efa44f5ee655c20bf9ea60f7ae44b9a7fd1fd9f189c7a0b0cdae'),
Fr.fromString('0f6addf0da06c33293df974a565b03d1ab096090d907d98055a8b7f4954e120c'),
];
export const INITIAL_TEST_ENCRYPTION_KEYS = INITIAL_TEST_SECRET_KEYS.map(secretKey =>
sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]),
);
// TODO(#5837): come up with a standard signing key derivation scheme instead of using ivsk_m as signing keys here
export const INITIAL_TEST_SIGNING_KEYS = INITIAL_TEST_ENCRYPTION_KEYS;

@@ -23,5 +29,5 @@

*/
export function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithPrivateKey[]> {
export function getInitialTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]> {
return Promise.all(
INITIAL_TEST_ENCRYPTION_KEYS.map((encryptionKey, i) =>
INITIAL_TEST_SECRET_KEYS.map((encryptionKey, i) =>
getSchnorrAccount(pxe, encryptionKey!, INITIAL_TEST_SIGNING_KEYS[i]!, INITIAL_TEST_ACCOUNT_SALTS[i]).getWallet(),

@@ -37,11 +43,14 @@ ),

*/
export async function getDeployedTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithPrivateKey[]> {
export async function getDeployedTestAccountsWallets(pxe: PXE): Promise<AccountWalletWithSecretKey[]> {
const registeredAccounts = await pxe.getRegisteredAccounts();
return Promise.all(
INITIAL_TEST_ENCRYPTION_KEYS.filter(initialKey => {
const publicKey = generatePublicKey(initialKey);
INITIAL_TEST_SECRET_KEYS.filter(initialSecretKey => {
const initialEncryptionKey = sha512ToGrumpkinScalar([initialSecretKey, GeneratorIndex.IVSK_M]);
const publicKey = generatePublicKey(initialEncryptionKey);
return registeredAccounts.find(registered => registered.publicKey.equals(publicKey)) != undefined;
}).map((encryptionKey, i) =>
getSchnorrAccount(pxe, encryptionKey!, INITIAL_TEST_SIGNING_KEYS[i]!, INITIAL_TEST_ACCOUNT_SALTS[i]).getWallet(),
),
}).map(secretKey => {
const signingKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
// TODO(#5726): use actual salt here instead of hardcoding Fr.ZERO
return getSchnorrAccount(pxe, secretKey, signingKey, Fr.ZERO).getWallet();
}),
);

@@ -56,7 +65,7 @@ }

export async function deployInitialTestAccounts(pxe: PXE) {
const accounts = INITIAL_TEST_ENCRYPTION_KEYS.map((privateKey, i) => {
const account = getSchnorrAccount(pxe, privateKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]);
const accounts = INITIAL_TEST_SECRET_KEYS.map((secretKey, i) => {
const account = getSchnorrAccount(pxe, secretKey, INITIAL_TEST_SIGNING_KEYS[i], INITIAL_TEST_ACCOUNT_SALTS[i]);
return {
account,
privateKey,
secretKey,
};

@@ -63,0 +72,0 @@ });

@@ -1,4 +0,5 @@

import { type AccountWalletWithPrivateKey } from '@aztec/aztec.js/wallet';
import { type AccountWalletWithSecretKey } from '@aztec/aztec.js/wallet';
import { type PXE } from '@aztec/circuit-types';
import { GrumpkinScalar } from '@aztec/circuits.js';
import { Fr, GeneratorIndex } from '@aztec/circuits.js';
import { sha512ToGrumpkinScalar } from '@aztec/foundation/crypto';

@@ -12,4 +13,6 @@ import { getSchnorrAccount } from '../schnorr/index.js';

*/
export function createAccount(pxe: PXE): Promise<AccountWalletWithPrivateKey> {
return getSchnorrAccount(pxe, GrumpkinScalar.random(), GrumpkinScalar.random()).waitSetup();
export function createAccount(pxe: PXE): Promise<AccountWalletWithSecretKey> {
const secretKey = Fr.random();
const signingKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
return getSchnorrAccount(pxe, secretKey, signingKey).waitSetup();
}

@@ -23,3 +26,3 @@

*/
export async function createAccounts(pxe: PXE, numberOfAccounts = 1): Promise<AccountWalletWithPrivateKey[]> {
export async function createAccounts(pxe: PXE, numberOfAccounts = 1): Promise<AccountWalletWithSecretKey[]> {
const accounts = [];

@@ -29,3 +32,5 @@

for (let i = 0; i < numberOfAccounts; ++i) {
const account = getSchnorrAccount(pxe, GrumpkinScalar.random(), GrumpkinScalar.random());
const secretKey = Fr.random();
const signingKey = sha512ToGrumpkinScalar([secretKey, GeneratorIndex.IVSK_M]);
const account = getSchnorrAccount(pxe, secretKey, signingKey);
// Unfortunately the function below is not stateless and we call it here because it takes a long time to run and

@@ -32,0 +37,0 @@ // the results get stored within the account object. By calling it here we increase the probability of all the

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc