@aztec/accounts 0.0.1-commit.b655e406 → 0.0.1-commit.b8a057fa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/README.md +1 -2
  2. package/artifacts/EcdsaKAccount.json +9971 -4275
  3. package/artifacts/EcdsaRAccount.json +9844 -4148
  4. package/artifacts/SchnorrAccount.json +10367 -4871
  5. package/artifacts/SchnorrInitializerlessAccount.json +8460 -0
  6. package/artifacts/SimulatedEcdsaAccount.json +10610 -0
  7. package/artifacts/SimulatedSchnorrAccount.d.json.ts +3 -0
  8. package/artifacts/SimulatedSchnorrAccount.json +10722 -0
  9. package/dest/defaults/account_contract.d.ts +9 -3
  10. package/dest/defaults/account_contract.d.ts.map +1 -1
  11. package/dest/defaults/account_contract.js +11 -3
  12. package/dest/defaults/index.d.ts +1 -2
  13. package/dest/defaults/index.d.ts.map +1 -1
  14. package/dest/defaults/index.js +1 -2
  15. package/dest/{stub/account_contract.d.ts → defaults/stub_account_contract.d.ts} +2 -2
  16. package/dest/defaults/stub_account_contract.d.ts.map +1 -0
  17. package/dest/ecdsa/ecdsa_k/account_contract.d.ts +2 -2
  18. package/dest/ecdsa/ecdsa_k/account_contract.d.ts.map +1 -1
  19. package/dest/ecdsa/ecdsa_k/account_contract.js +7 -3
  20. package/dest/ecdsa/ecdsa_k/index.d.ts +1 -1
  21. package/dest/ecdsa/ecdsa_k/index.d.ts.map +1 -1
  22. package/dest/ecdsa/ecdsa_k/lazy.d.ts +1 -1
  23. package/dest/ecdsa/ecdsa_k/lazy.d.ts.map +1 -1
  24. package/dest/ecdsa/ecdsa_k/lazy.js +1 -1
  25. package/dest/ecdsa/ecdsa_r/account_contract.d.ts +2 -2
  26. package/dest/ecdsa/ecdsa_r/account_contract.d.ts.map +1 -1
  27. package/dest/ecdsa/ecdsa_r/account_contract.js +7 -3
  28. package/dest/ecdsa/ecdsa_r/index.d.ts +1 -1
  29. package/dest/ecdsa/ecdsa_r/index.d.ts.map +1 -1
  30. package/dest/ecdsa/ecdsa_r/lazy.d.ts +1 -1
  31. package/dest/ecdsa/ecdsa_r/lazy.d.ts.map +1 -1
  32. package/dest/ecdsa/ecdsa_r/lazy.js +1 -1
  33. package/dest/ecdsa/index.d.ts +1 -1
  34. package/dest/ecdsa/lazy.d.ts +1 -1
  35. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts +2 -2
  36. package/dest/ecdsa/ssh_ecdsa_r/account_contract.d.ts.map +1 -1
  37. package/dest/ecdsa/ssh_ecdsa_r/account_contract.js +7 -3
  38. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts +1 -1
  39. package/dest/ecdsa/ssh_ecdsa_r/index.d.ts.map +1 -1
  40. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts +1 -1
  41. package/dest/ecdsa/ssh_ecdsa_r/lazy.d.ts.map +1 -1
  42. package/dest/ecdsa/stub/index.d.ts +11 -0
  43. package/dest/ecdsa/stub/index.d.ts.map +1 -0
  44. package/dest/ecdsa/stub/index.js +18 -0
  45. package/dest/ecdsa/stub/lazy.d.ts +14 -0
  46. package/dest/ecdsa/stub/lazy.d.ts.map +1 -0
  47. package/dest/ecdsa/stub/lazy.js +22 -0
  48. package/dest/schnorr/account_contract.d.ts +10 -5
  49. package/dest/schnorr/account_contract.d.ts.map +1 -1
  50. package/dest/schnorr/account_contract.js +7 -6
  51. package/dest/schnorr/index.d.ts +3 -22
  52. package/dest/schnorr/index.d.ts.map +1 -1
  53. package/dest/schnorr/index.js +2 -35
  54. package/dest/schnorr/initializerless/index.d.ts +25 -0
  55. package/dest/schnorr/initializerless/index.d.ts.map +1 -0
  56. package/dest/schnorr/initializerless/index.js +46 -0
  57. package/dest/schnorr/initializerless/lazy.d.ts +29 -0
  58. package/dest/schnorr/initializerless/lazy.d.ts.map +1 -0
  59. package/dest/schnorr/initializerless/lazy.js +54 -0
  60. package/dest/schnorr/lazy.d.ts +3 -26
  61. package/dest/schnorr/lazy.d.ts.map +1 -1
  62. package/dest/schnorr/lazy.js +2 -43
  63. package/dest/schnorr/private_immutable/index.d.ts +23 -0
  64. package/dest/schnorr/private_immutable/index.d.ts.map +1 -0
  65. package/dest/schnorr/private_immutable/index.js +35 -0
  66. package/dest/schnorr/private_immutable/lazy.d.ts +27 -0
  67. package/dest/schnorr/private_immutable/lazy.d.ts.map +1 -0
  68. package/dest/schnorr/private_immutable/lazy.js +43 -0
  69. package/dest/schnorr/stub/index.d.ts +11 -0
  70. package/dest/schnorr/stub/index.d.ts.map +1 -0
  71. package/dest/schnorr/stub/index.js +18 -0
  72. package/dest/schnorr/stub/lazy.d.ts +14 -0
  73. package/dest/schnorr/stub/lazy.d.ts.map +1 -0
  74. package/dest/schnorr/stub/lazy.js +22 -0
  75. package/dest/testing/configuration.d.ts +13 -4
  76. package/dest/testing/configuration.d.ts.map +1 -1
  77. package/dest/testing/configuration.js +1 -1
  78. package/dest/testing/index.d.ts +5 -5
  79. package/dest/testing/index.d.ts.map +1 -1
  80. package/dest/testing/index.js +12 -6
  81. package/dest/testing/lazy.d.ts +4 -4
  82. package/dest/testing/lazy.d.ts.map +1 -1
  83. package/dest/testing/lazy.js +12 -6
  84. package/dest/utils/index.d.ts +1 -1
  85. package/dest/utils/ssh_agent.d.ts +1 -1
  86. package/dest/utils/ssh_agent.d.ts.map +1 -1
  87. package/dest/utils/ssh_agent.js +2 -0
  88. package/package.json +14 -16
  89. package/src/defaults/account_contract.ts +18 -5
  90. package/src/defaults/index.ts +0 -1
  91. package/src/{stub/account_contract.ts → defaults/stub_account_contract.ts} +1 -1
  92. package/src/ecdsa/ecdsa_k/account_contract.ts +3 -3
  93. package/src/ecdsa/ecdsa_k/lazy.ts +1 -1
  94. package/src/ecdsa/ecdsa_r/account_contract.ts +3 -3
  95. package/src/ecdsa/ecdsa_r/lazy.ts +1 -1
  96. package/src/ecdsa/ssh_ecdsa_r/account_contract.ts +3 -3
  97. package/src/ecdsa/stub/index.ts +28 -0
  98. package/src/ecdsa/stub/lazy.ts +34 -0
  99. package/src/schnorr/account_contract.ts +21 -7
  100. package/src/schnorr/index.ts +2 -49
  101. package/src/schnorr/initializerless/index.ts +62 -0
  102. package/src/schnorr/initializerless/lazy.ts +70 -0
  103. package/src/schnorr/lazy.ts +2 -59
  104. package/src/schnorr/private_immutable/index.ts +50 -0
  105. package/src/schnorr/private_immutable/lazy.ts +60 -0
  106. package/src/schnorr/stub/index.ts +30 -0
  107. package/src/schnorr/stub/lazy.ts +34 -0
  108. package/src/testing/configuration.ts +11 -1
  109. package/src/testing/index.ts +22 -6
  110. package/src/testing/lazy.ts +21 -6
  111. package/src/utils/ssh_agent.ts +2 -0
  112. package/artifacts/SchnorrSingleKeyAccount.json +0 -4558
  113. package/artifacts/SimulatedAccount.json +0 -4494
  114. package/dest/defaults/account_interface.d.ts +0 -29
  115. package/dest/defaults/account_interface.d.ts.map +0 -1
  116. package/dest/defaults/account_interface.js +0 -36
  117. package/dest/single_key/account_contract.d.ts +0 -17
  118. package/dest/single_key/account_contract.d.ts.map +0 -1
  119. package/dest/single_key/account_contract.js +0 -42
  120. package/dest/single_key/index.d.ts +0 -20
  121. package/dest/single_key/index.d.ts.map +0 -1
  122. package/dest/single_key/index.js +0 -23
  123. package/dest/single_key/lazy.d.ts +0 -24
  124. package/dest/single_key/lazy.d.ts.map +0 -1
  125. package/dest/single_key/lazy.js +0 -31
  126. package/dest/stub/account_contract.d.ts.map +0 -1
  127. package/dest/stub/index.d.ts +0 -21
  128. package/dest/stub/index.d.ts.map +0 -1
  129. package/dest/stub/index.js +0 -29
  130. package/dest/stub/lazy.d.ts +0 -23
  131. package/dest/stub/lazy.d.ts.map +0 -1
  132. package/dest/stub/lazy.js +0 -35
  133. package/src/defaults/account_interface.ts +0 -64
  134. package/src/single_key/account_contract.ts +0 -46
  135. package/src/single_key/index.ts +0 -32
  136. package/src/single_key/lazy.ts +0 -40
  137. package/src/stub/index.ts +0 -41
  138. package/src/stub/lazy.ts +0 -49
  139. /package/artifacts/{SchnorrSingleKeyAccount.d.json.ts → SchnorrInitializerlessAccount.d.json.ts} +0 -0
  140. /package/artifacts/{SimulatedAccount.d.json.ts → SimulatedEcdsaAccount.d.json.ts} +0 -0
  141. /package/dest/{stub/account_contract.js → defaults/stub_account_contract.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schnorr/initializerless/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE,eAAO,MAAM,6CAA6C,kBAEzD,CAAC;AAEF;;;;GAIG;AACH,qBAAa,qCAAsC,SAAQ,0BAA0B;IACnF,YAAY,iBAAiB,EAAE,cAAc,EAE5C;IAEQ,gCAAgC,uBAExC;IAEc,iBAAiB,IAAI,OAAO,CAAC,EAAE,CAAC,CAG9C;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;;GAKG;AACH,wBAAsB,+CAA+C,CACnE,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption.
3
+ * This is the suggested account contract type for most use cases within Aztec.
4
+ *
5
+ * @packageDocumentation
6
+ */ import { getAccountContractAddress } from '@aztec/aztec.js/account';
7
+ import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
8
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
9
+ import { deriveSigningKey } from '@aztec/stdlib/keys';
10
+ import SchnorrInitializerlessAccountContractJson from '../../../artifacts/SchnorrInitializerlessAccount.json' with {
11
+ type: 'json'
12
+ };
13
+ import { SchnorrBaseAccountContract } from '../account_contract.js';
14
+ export const SchnorrInitializerlessAccountContractArtifact = loadContractArtifact(SchnorrInitializerlessAccountContractJson);
15
+ /**
16
+ * Account contract that authenticates transactions using Schnorr signatures
17
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
18
+ * Eagerly loads the contract artifact
19
+ */ export class SchnorrInitializerlessAccountContract extends SchnorrBaseAccountContract {
20
+ constructor(signingPrivateKey){
21
+ super(signingPrivateKey);
22
+ }
23
+ getInitializationFunctionAndArgs() {
24
+ return Promise.resolve(undefined);
25
+ }
26
+ async getImmutablesHash() {
27
+ const signingPublicKey = await this.getSigningPublicKey();
28
+ return poseidon2Hash([
29
+ signingPublicKey.x,
30
+ signingPublicKey.y
31
+ ]);
32
+ }
33
+ getContractArtifact() {
34
+ return Promise.resolve(SchnorrInitializerlessAccountContractArtifact);
35
+ }
36
+ }
37
+ /**
38
+ * Compute the address of a schnorr account contract.
39
+ * @param secret - A seed for deriving the signing key and public keys.
40
+ * @param salt - The contract address salt.
41
+ * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
42
+ */ export async function getSchnorrInitializerlessAccountContractAddress(secret, salt, signingPrivateKey) {
43
+ const signingKey = signingPrivateKey ?? deriveSigningKey(secret);
44
+ const accountContract = new SchnorrInitializerlessAccountContract(signingKey);
45
+ return await getAccountContractAddress(accountContract, secret, salt);
46
+ }
@@ -0,0 +1,29 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
3
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import { SchnorrBaseAccountContract } from '../account_contract.js';
6
+ /**
7
+ * Lazily loads the contract artifact
8
+ * @returns The contract artifact for the schnorr account contract
9
+ */
10
+ export declare function getSchnorrInitializerlessAccountContractArtifact(): Promise<ContractArtifact>;
11
+ /**
12
+ * Account contract that authenticates transactions using Schnorr signatures
13
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
14
+ * Lazily loads the contract artifact
15
+ */
16
+ export declare class SchnorrInitializerlessAccountContract extends SchnorrBaseAccountContract {
17
+ constructor(signingPrivateKey: GrumpkinScalar);
18
+ getInitializationFunctionAndArgs(): Promise<undefined>;
19
+ getImmutablesHash(): Promise<Fr>;
20
+ getContractArtifact(): Promise<ContractArtifact>;
21
+ }
22
+ /**
23
+ * Compute the address of a schnorr account contract.
24
+ * @param secret - A seed for deriving the signing key and public keys.
25
+ * @param salt - The contract address salt.
26
+ * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
27
+ */
28
+ export declare function getSchnorrInitializerlessAccountContractAddress(secret: Fr, salt: Fr, signingPrivateKey?: GrumpkinScalar): Promise<AztecAddress>;
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NjaG5vcnIvaW5pdGlhbGl6ZXJsZXNzL2xhenkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUUEsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRTFELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBR2hFLE9BQU8sRUFBRSwwQkFBMEIsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRXBFOzs7R0FHRztBQUNILHdCQUFzQixnREFBZ0QsOEJBUXJFO0FBRUQ7Ozs7R0FJRztBQUNILHFCQUFhLHFDQUFzQyxTQUFRLDBCQUEwQjtJQUNuRixZQUFZLGlCQUFpQixFQUFFLGNBQWMsRUFFNUM7SUFFUSxnQ0FBZ0MsdUJBRXhDO0lBRWMsaUJBQWlCLElBQUksT0FBTyxDQUFDLEVBQUUsQ0FBQyxDQUc5QztJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtDQUNGO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBc0IsK0NBQStDLENBQ25FLE1BQU0sRUFBRSxFQUFFLEVBQ1YsSUFBSSxFQUFFLEVBQUUsRUFDUixpQkFBaUIsQ0FBQyxFQUFFLGNBQWMsR0FDakMsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUl2QiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/schnorr/initializerless/lazy.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;GAGG;AACH,wBAAsB,gDAAgD,8BAQrE;AAED;;;;GAIG;AACH,qBAAa,qCAAsC,SAAQ,0BAA0B;IACnF,YAAY,iBAAiB,EAAE,cAAc,EAE5C;IAEQ,gCAAgC,uBAExC;IAEc,iBAAiB,IAAI,OAAO,CAAC,EAAE,CAAC,CAG9C;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;;GAKG;AACH,wBAAsB,+CAA+C,CACnE,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption.
3
+ * This is the suggested account contract type for most use cases within Aztec.
4
+ *
5
+ * @packageDocumentation
6
+ */ import { getAccountContractAddress } from '@aztec/aztec.js/account';
7
+ import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
8
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
9
+ import { deriveSigningKey } from '@aztec/stdlib/keys';
10
+ import { SchnorrBaseAccountContract } from '../account_contract.js';
11
+ /**
12
+ * Lazily loads the contract artifact
13
+ * @returns The contract artifact for the schnorr account contract
14
+ */ export async function getSchnorrInitializerlessAccountContractArtifact() {
15
+ // Cannot assert this import as it's incompatible with bundlers like vite
16
+ // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
17
+ // Even if now supported by all major browsers, the MIME type is replaced with
18
+ // "text/javascript"
19
+ // In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
20
+ const { default: schnorrAccountContractJson } = await import('../../../artifacts/SchnorrInitializerlessAccount.json');
21
+ return loadContractArtifact(schnorrAccountContractJson);
22
+ }
23
+ /**
24
+ * Account contract that authenticates transactions using Schnorr signatures
25
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
26
+ * Lazily loads the contract artifact
27
+ */ export class SchnorrInitializerlessAccountContract extends SchnorrBaseAccountContract {
28
+ constructor(signingPrivateKey){
29
+ super(signingPrivateKey);
30
+ }
31
+ getInitializationFunctionAndArgs() {
32
+ return Promise.resolve(undefined);
33
+ }
34
+ async getImmutablesHash() {
35
+ const signingPublicKey = await this.getSigningPublicKey();
36
+ return poseidon2Hash([
37
+ signingPublicKey.x,
38
+ signingPublicKey.y
39
+ ]);
40
+ }
41
+ getContractArtifact() {
42
+ return getSchnorrInitializerlessAccountContractArtifact();
43
+ }
44
+ }
45
+ /**
46
+ * Compute the address of a schnorr account contract.
47
+ * @param secret - A seed for deriving the signing key and public keys.
48
+ * @param salt - The contract address salt.
49
+ * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
50
+ */ export async function getSchnorrInitializerlessAccountContractAddress(secret, salt, signingPrivateKey) {
51
+ const signingKey = signingPrivateKey ?? deriveSigningKey(secret);
52
+ const accountContract = new SchnorrInitializerlessAccountContract(signingKey);
53
+ return await getAccountContractAddress(accountContract, secret, salt);
54
+ }
@@ -1,26 +1,3 @@
1
- import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
2
- import type { ContractArtifact } from '@aztec/stdlib/abi';
3
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
- import { SchnorrBaseAccountContract } from './account_contract.js';
5
- /**
6
- * Lazily loads the contract artifact
7
- * @returns The contract artifact for the schnorr account contract
8
- */
9
- export declare function getSchnorrAccountContractArtifact(): Promise<ContractArtifact>;
10
- /**
11
- * Account contract that authenticates transactions using Schnorr signatures
12
- * verified against a Grumpkin public key stored in an immutable encrypted note.
13
- * Lazily loads the contract artifact
14
- */
15
- export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
16
- constructor(signingPrivateKey: GrumpkinScalar);
17
- getContractArtifact(): Promise<ContractArtifact>;
18
- }
19
- /**
20
- * Compute the address of a schnorr account contract.
21
- * @param secret - A seed for deriving the signing key and public keys.
22
- * @param salt - The contract address salt.
23
- * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
24
- */
25
- export declare function getSchnorrAccountContractAddress(secret: Fr, salt: Fr, signingPrivateKey?: GrumpkinScalar): Promise<AztecAddress>;
26
- //# sourceMappingURL=lazy.d.ts.map
1
+ export * from './private_immutable/lazy.js';
2
+ export * from './initializerless/lazy.js';
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NjaG5vcnIvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsMkJBQTJCLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/schnorr/lazy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAEnE;;;GAGG;AACH,wBAAsB,iCAAiC,8BAQtD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,0BAA0B;gBACxD,iBAAiB,EAAE,cAAc;IAIpC,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAG1D;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/schnorr/lazy.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC"}
@@ -1,43 +1,2 @@
1
- /**
2
- * The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption.
3
- * This is the suggested account contract type for most use cases within Aztec.
4
- *
5
- * @packageDocumentation
6
- */ import { getAccountContractAddress } from '@aztec/aztec.js/account';
7
- import { loadContractArtifact } from '@aztec/stdlib/abi';
8
- import { deriveSigningKey } from '@aztec/stdlib/keys';
9
- import { SchnorrBaseAccountContract } from './account_contract.js';
10
- /**
11
- * Lazily loads the contract artifact
12
- * @returns The contract artifact for the schnorr account contract
13
- */ export async function getSchnorrAccountContractArtifact() {
14
- // Cannot assert this import as it's incompatible with bundlers like vite
15
- // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
16
- // Even if now supported by al major browsers, the MIME type is replaced with
17
- // "text/javascript"
18
- // In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
19
- const { default: schnorrAccountContractJson } = await import('../../artifacts/SchnorrAccount.json');
20
- return loadContractArtifact(schnorrAccountContractJson);
21
- }
22
- /**
23
- * Account contract that authenticates transactions using Schnorr signatures
24
- * verified against a Grumpkin public key stored in an immutable encrypted note.
25
- * Lazily loads the contract artifact
26
- */ export class SchnorrAccountContract extends SchnorrBaseAccountContract {
27
- constructor(signingPrivateKey){
28
- super(signingPrivateKey);
29
- }
30
- getContractArtifact() {
31
- return getSchnorrAccountContractArtifact();
32
- }
33
- }
34
- /**
35
- * Compute the address of a schnorr account contract.
36
- * @param secret - A seed for deriving the signing key and public keys.
37
- * @param salt - The contract address salt.
38
- * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
39
- */ export async function getSchnorrAccountContractAddress(secret, salt, signingPrivateKey) {
40
- const signingKey = signingPrivateKey ?? deriveSigningKey(secret);
41
- const accountContract = new SchnorrAccountContract(signingKey);
42
- return await getAccountContractAddress(accountContract, secret, salt);
43
- }
1
+ export * from './private_immutable/lazy.js';
2
+ export * from './initializerless/lazy.js';
@@ -0,0 +1,23 @@
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
4
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
5
+ import { SchnorrBaseAccountContract } from '../account_contract.js';
6
+ export declare const SchnorrAccountContractArtifact: ContractArtifact;
7
+ /**
8
+ * Account contract that authenticates transactions using Schnorr signatures
9
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
10
+ * Eagerly loads the contract artifact
11
+ */
12
+ export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
13
+ constructor(signingPrivateKey: GrumpkinScalar);
14
+ getContractArtifact(): Promise<ContractArtifact>;
15
+ }
16
+ /**
17
+ * Compute the address of a schnorr account contract.
18
+ * @param secret - A seed for deriving the signing key and public keys.
19
+ * @param salt - The contract address salt.
20
+ * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
21
+ */
22
+ export declare function getSchnorrAccountContractAddress(secret: Fr, salt: Fr, signingPrivateKey?: GrumpkinScalar): Promise<AztecAddress>;
23
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zY2hub3JyL3ByaXZhdGVfaW1tdXRhYmxlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzlELE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDbkUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQU0xRCxPQUFPLEVBQUUsMEJBQTBCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVwRSxlQUFPLE1BQU0sOEJBQThCLGtCQUEyRSxDQUFDO0FBRXZIOzs7O0dBSUc7QUFDSCxxQkFBYSxzQkFBdUIsU0FBUSwwQkFBMEI7SUFDcEUsWUFBWSxpQkFBaUIsRUFBRSxjQUFjLEVBRTVDO0lBRVEsbUJBQW1CLElBQUksT0FBTyxDQUFDLGdCQUFnQixDQUFDLENBRXhEO0NBQ0Y7QUFFRDs7Ozs7R0FLRztBQUNILHdCQUFzQixnQ0FBZ0MsQ0FDcEQsTUFBTSxFQUFFLEVBQUUsRUFDVixJQUFJLEVBQUUsRUFBRSxFQUNSLGlCQUFpQixDQUFDLEVBQUUsY0FBYyxHQUNqQyxPQUFPLENBQUMsWUFBWSxDQUFDLENBSXZCIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schnorr/private_immutable/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE,eAAO,MAAM,8BAA8B,kBAA2E,CAAC;AAEvH;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,0BAA0B;IACpE,YAAY,iBAAiB,EAAE,cAAc,EAE5C;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption.
3
+ * This is the suggested account contract type for most use cases within Aztec.
4
+ *
5
+ * @packageDocumentation
6
+ */ import { getAccountContractAddress } from '@aztec/aztec.js/account';
7
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
8
+ import { deriveSigningKey } from '@aztec/stdlib/keys';
9
+ import SchnorrAccountContractJson from '../../../artifacts/SchnorrAccount.json' with {
10
+ type: 'json'
11
+ };
12
+ import { SchnorrBaseAccountContract } from '../account_contract.js';
13
+ export const SchnorrAccountContractArtifact = loadContractArtifact(SchnorrAccountContractJson);
14
+ /**
15
+ * Account contract that authenticates transactions using Schnorr signatures
16
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
17
+ * Eagerly loads the contract artifact
18
+ */ export class SchnorrAccountContract extends SchnorrBaseAccountContract {
19
+ constructor(signingPrivateKey){
20
+ super(signingPrivateKey);
21
+ }
22
+ getContractArtifact() {
23
+ return Promise.resolve(SchnorrAccountContractArtifact);
24
+ }
25
+ }
26
+ /**
27
+ * Compute the address of a schnorr account contract.
28
+ * @param secret - A seed for deriving the signing key and public keys.
29
+ * @param salt - The contract address salt.
30
+ * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
31
+ */ export async function getSchnorrAccountContractAddress(secret, salt, signingPrivateKey) {
32
+ const signingKey = signingPrivateKey ?? deriveSigningKey(secret);
33
+ const accountContract = new SchnorrAccountContract(signingKey);
34
+ return await getAccountContractAddress(accountContract, secret, salt);
35
+ }
@@ -0,0 +1,27 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
3
+ import type { ContractArtifact } from '@aztec/stdlib/abi';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import { SchnorrBaseAccountContract } from '../account_contract.js';
6
+ /**
7
+ * Lazily loads the contract artifact
8
+ * @returns The contract artifact for the schnorr account contract
9
+ */
10
+ export declare function getSchnorrAccountContractArtifact(): Promise<ContractArtifact>;
11
+ /**
12
+ * Account contract that authenticates transactions using Schnorr signatures
13
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
14
+ * Lazily loads the contract artifact
15
+ */
16
+ export declare class SchnorrAccountContract extends SchnorrBaseAccountContract {
17
+ constructor(signingPrivateKey: GrumpkinScalar);
18
+ getContractArtifact(): Promise<ContractArtifact>;
19
+ }
20
+ /**
21
+ * Compute the address of a schnorr account contract.
22
+ * @param secret - A seed for deriving the signing key and public keys.
23
+ * @param salt - The contract address salt.
24
+ * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
25
+ */
26
+ export declare function getSchnorrAccountContractAddress(secret: Fr, salt: Fr, signingPrivateKey?: GrumpkinScalar): Promise<AztecAddress>;
27
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NjaG5vcnIvcHJpdmF0ZV9pbW11dGFibGUvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFMUQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFHaEUsT0FBTyxFQUFFLDBCQUEwQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFcEU7OztHQUdHO0FBQ0gsd0JBQXNCLGlDQUFpQyw4QkFRdEQ7QUFFRDs7OztHQUlHO0FBQ0gscUJBQWEsc0JBQXVCLFNBQVEsMEJBQTBCO0lBQ3BFLFlBQVksaUJBQWlCLEVBQUUsY0FBYyxFQUU1QztJQUVRLG1CQUFtQixJQUFJLE9BQU8sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUV4RDtDQUNGO0FBRUQ7Ozs7O0dBS0c7QUFDSCx3QkFBc0IsZ0NBQWdDLENBQ3BELE1BQU0sRUFBRSxFQUFFLEVBQ1YsSUFBSSxFQUFFLEVBQUUsRUFDUixpQkFBaUIsQ0FBQyxFQUFFLGNBQWMsR0FDakMsT0FBTyxDQUFDLFlBQVksQ0FBQyxDQUl2QiJ9
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/schnorr/private_immutable/lazy.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE;;;GAGG;AACH,wBAAsB,iCAAiC,8BAQtD;AAED;;;;GAIG;AACH,qBAAa,sBAAuB,SAAQ,0BAA0B;IACpE,YAAY,iBAAiB,EAAE,cAAc,EAE5C;IAEQ,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAExD;CACF;AAED;;;;;GAKG;AACH,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,EAAE,EACV,IAAI,EAAE,EAAE,EACR,iBAAiB,CAAC,EAAE,cAAc,GACjC,OAAO,CAAC,YAAY,CAAC,CAIvB"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * The `@aztec/accounts/schnorr` export provides an account contract implementation that uses Schnorr signatures with a Grumpkin key for authentication, and a separate Grumpkin key for encryption.
3
+ * This is the suggested account contract type for most use cases within Aztec.
4
+ *
5
+ * @packageDocumentation
6
+ */ import { getAccountContractAddress } from '@aztec/aztec.js/account';
7
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
8
+ import { deriveSigningKey } from '@aztec/stdlib/keys';
9
+ import { SchnorrBaseAccountContract } from '../account_contract.js';
10
+ /**
11
+ * Lazily loads the contract artifact
12
+ * @returns The contract artifact for the schnorr account contract
13
+ */ export async function getSchnorrAccountContractArtifact() {
14
+ // Cannot assert this import as it's incompatible with bundlers like vite
15
+ // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
16
+ // Even if now supported by all major browsers, the MIME type is replaced with
17
+ // "text/javascript"
18
+ // In the meantime, this lazy import is INCOMPATIBLE WITH NODEJS
19
+ const { default: schnorrAccountContractJson } = await import('../../../artifacts/SchnorrAccount.json');
20
+ return loadContractArtifact(schnorrAccountContractJson);
21
+ }
22
+ /**
23
+ * Account contract that authenticates transactions using Schnorr signatures
24
+ * verified against a Grumpkin public key stored in an immutable encrypted note.
25
+ * Lazily loads the contract artifact
26
+ */ export class SchnorrAccountContract extends SchnorrBaseAccountContract {
27
+ constructor(signingPrivateKey){
28
+ super(signingPrivateKey);
29
+ }
30
+ getContractArtifact() {
31
+ return getSchnorrAccountContractArtifact();
32
+ }
33
+ }
34
+ /**
35
+ * Compute the address of a schnorr account contract.
36
+ * @param secret - A seed for deriving the signing key and public keys.
37
+ * @param salt - The contract address salt.
38
+ * @param signingPrivateKey - A specific signing private key that's not derived from the secret.
39
+ */ export async function getSchnorrAccountContractAddress(secret, salt, signingPrivateKey) {
40
+ const signingKey = signingPrivateKey ?? deriveSigningKey(secret);
41
+ const accountContract = new SchnorrAccountContract(signingKey);
42
+ return await getAccountContractAddress(accountContract, secret, salt);
43
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { StubBaseAccountContract } from '../../defaults/stub_account_contract.js';
4
+ export declare const StubSchnorrAccountContractArtifact: import("@aztec/stdlib/abi").ContractArtifact;
5
+ /** Stub account contract for Schnorr accounts. Eagerly loads the contract artifact. */
6
+ export declare class StubSchnorrAccountContract extends StubBaseAccountContract {
7
+ getContractArtifact(): Promise<import("@aztec/stdlib/abi").ContractArtifact>;
8
+ }
9
+ /** Creates a Schnorr stub account that impersonates the one with the provided address. */
10
+ export declare function createStubSchnorrAccount(originalAddress: CompleteAddress): BaseAccount;
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zY2hub3JyL3N0dWIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQ3RELE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBTWpFLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLHlDQUF5QyxDQUFDO0FBRWxGLGVBQU8sTUFBTSxrQ0FBa0MsOENBRTlDLENBQUM7QUFFRix1RkFBdUY7QUFDdkYscUJBQWEsMEJBQTJCLFNBQVEsdUJBQXVCO0lBQzVELG1CQUFtQiwwREFFM0I7Q0FDRjtBQUVELDBGQUEwRjtBQUMxRix3QkFBZ0Isd0JBQXdCLENBQUMsZUFBZSxFQUFFLGVBQWUsZUFReEUifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/schnorr/stub/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAMjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,eAAO,MAAM,kCAAkC,8CAE9C,CAAC;AAEF,uFAAuF;AACvF,qBAAa,0BAA2B,SAAQ,uBAAuB;IAC5D,mBAAmB,0DAE3B;CACF;AAED,0FAA0F;AAC1F,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,eAAe,eAQxE"}
@@ -0,0 +1,18 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
3
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
4
+ import SimulatedSchnorrAccountJson from '../../../artifacts/SimulatedSchnorrAccount.json' with {
5
+ type: 'json'
6
+ };
7
+ import { StubBaseAccountContract } from '../../defaults/stub_account_contract.js';
8
+ export const StubSchnorrAccountContractArtifact = loadContractArtifact(SimulatedSchnorrAccountJson);
9
+ /** Stub account contract for Schnorr accounts. Eagerly loads the contract artifact. */ export class StubSchnorrAccountContract extends StubBaseAccountContract {
10
+ getContractArtifact() {
11
+ return Promise.resolve(StubSchnorrAccountContractArtifact);
12
+ }
13
+ }
14
+ /** Creates a Schnorr stub account that impersonates the one with the provided address. */ export function createStubSchnorrAccount(originalAddress) {
15
+ const accountContract = new StubSchnorrAccountContract();
16
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
17
+ return new BaseAccount(new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider), authWitnessProvider, originalAddress);
18
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import type { CompleteAddress } from '@aztec/aztec.js/addresses';
3
+ import { StubBaseAccountContract } from '../../defaults/stub_account_contract.js';
4
+ /**
5
+ * Lazily loads the Schnorr stub contract artifact (browser-compatible).
6
+ */
7
+ export declare function getStubSchnorrAccountContractArtifact(): Promise<import("@aztec/stdlib/abi").ContractArtifact>;
8
+ /** Stub account contract for Schnorr accounts. Lazily loads the contract artifact. */
9
+ export declare class StubSchnorrAccountContract extends StubBaseAccountContract {
10
+ getContractArtifact(): Promise<import("@aztec/stdlib/abi").ContractArtifact>;
11
+ }
12
+ /** Creates a Schnorr stub account that impersonates the one with the provided address. */
13
+ export declare function createStubSchnorrAccount(originalAddress: CompleteAddress): BaseAccount;
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3NjaG5vcnIvc3R1Yi9sYXp5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN0RCxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUlqRSxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUVsRjs7R0FFRztBQUNILHdCQUFzQixxQ0FBcUMsMERBSzFEO0FBRUQsc0ZBQXNGO0FBQ3RGLHFCQUFhLDBCQUEyQixTQUFRLHVCQUF1QjtJQUM1RCxtQkFBbUIsMERBRTNCO0NBQ0Y7QUFFRCwwRkFBMEY7QUFDMUYsd0JBQWdCLHdCQUF3QixDQUFDLGVBQWUsRUFBRSxlQUFlLGVBUXhFIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../../src/schnorr/stub/lazy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF;;GAEG;AACH,wBAAsB,qCAAqC,0DAK1D;AAED,sFAAsF;AACtF,qBAAa,0BAA2B,SAAQ,uBAAuB;IAC5D,mBAAmB,0DAE3B;CACF;AAED,0FAA0F;AAC1F,wBAAgB,wBAAwB,CAAC,eAAe,EAAE,eAAe,eAQxE"}
@@ -0,0 +1,22 @@
1
+ import { BaseAccount } from '@aztec/aztec.js/account';
2
+ import { DefaultAccountEntrypoint } from '@aztec/entrypoints/account';
3
+ import { loadContractArtifact } from '@aztec/stdlib/abi';
4
+ import { StubBaseAccountContract } from '../../defaults/stub_account_contract.js';
5
+ /**
6
+ * Lazily loads the Schnorr stub contract artifact (browser-compatible).
7
+ */ export async function getStubSchnorrAccountContractArtifact() {
8
+ // Cannot assert this import as it's incompatible with bundlers like vite
9
+ // https://github.com/vitejs/vite/issues/19095#issuecomment-2566074352
10
+ const { default: json } = await import('../../../artifacts/SimulatedSchnorrAccount.json');
11
+ return loadContractArtifact(json);
12
+ }
13
+ /** Stub account contract for Schnorr accounts. Lazily loads the contract artifact. */ export class StubSchnorrAccountContract extends StubBaseAccountContract {
14
+ getContractArtifact() {
15
+ return getStubSchnorrAccountContractArtifact();
16
+ }
17
+ }
18
+ /** Creates a Schnorr stub account that impersonates the one with the provided address. */ export function createStubSchnorrAccount(originalAddress) {
19
+ const accountContract = new StubSchnorrAccountContract();
20
+ const authWitnessProvider = accountContract.getAuthWitnessProvider(originalAddress);
21
+ return new BaseAccount(new DefaultAccountEntrypoint(originalAddress.address, authWitnessProvider), authWitnessProvider, originalAddress);
22
+ }
@@ -1,9 +1,14 @@
1
- import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
+ import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
2
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
4
  export declare const INITIAL_TEST_SECRET_KEYS: Fr[];
4
- export declare const INITIAL_TEST_ENCRYPTION_KEYS: import("@aztec/foundation/fields").Fq[];
5
- export declare const INITIAL_TEST_SIGNING_KEYS: import("@aztec/foundation/fields").Fq[];
5
+ export declare const INITIAL_TEST_ENCRYPTION_KEYS: import("@aztec/foundation/curves/bn254").Fq[];
6
+ export declare const INITIAL_TEST_SIGNING_KEYS: import("@aztec/foundation/curves/bn254").Fq[];
6
7
  export declare const INITIAL_TEST_ACCOUNT_SALTS: Fr[];
8
+ /**
9
+ * The schnorr account contract variant a test account uses.
10
+ */
11
+ export type InitialAccountType = 'schnorr' | 'schnorr_initializerless';
7
12
  /**
8
13
  * Data for generating an initial account.
9
14
  */
@@ -24,5 +29,9 @@ export interface InitialAccountData {
24
29
  * Address of the schnorr account contract.
25
30
  */
26
31
  address: AztecAddress;
32
+ /**
33
+ * Account contract variant.
34
+ */
35
+ type?: InitialAccountType;
27
36
  }
28
- //# sourceMappingURL=configuration.d.ts.map
37
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3RpbmcvY29uZmlndXJhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBR2hFLGVBQU8sTUFBTSx3QkFBd0IsTUFJcEMsQ0FBQztBQUVGLGVBQU8sTUFBTSw0QkFBNEIsK0NBRXhDLENBQUM7QUFFRixlQUFPLE1BQU0seUJBQXlCLCtDQUErQixDQUFDO0FBRXRFLGVBQU8sTUFBTSwwQkFBMEIsTUFBOEIsQ0FBQztBQUV0RTs7R0FFRztBQUNILE1BQU0sTUFBTSxrQkFBa0IsR0FBRyxTQUFTLEdBQUcseUJBQXlCLENBQUM7QUFFdkU7O0dBRUc7QUFDSCxNQUFNLFdBQVcsa0JBQWtCO0lBQ2pDOztPQUVHO0lBQ0gsTUFBTSxFQUFFLEVBQUUsQ0FBQztJQUNYOztPQUVHO0lBQ0gsVUFBVSxFQUFFLGNBQWMsQ0FBQztJQUMzQjs7T0FFRztJQUNILElBQUksRUFBRSxFQUFFLENBQUM7SUFDVDs7T0FFRztJQUNILE9BQU8sRUFBRSxZQUFZLENBQUM7SUFDdEI7O09BRUc7SUFDSCxJQUFJLENBQUMsRUFBRSxrQkFBa0IsQ0FBQztDQUMzQiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/testing/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,eAAO,MAAM,wBAAwB,MAIpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yCAExC,CAAC;AAEF,eAAO,MAAM,yBAAyB,yCAA+B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,MAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,EAAE,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,EAAE,CAAC;IACT;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;CACvB"}
1
+ {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../src/testing/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGhE,eAAO,MAAM,wBAAwB,MAIpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,+CAExC,CAAC;AAEF,eAAO,MAAM,yBAAyB,+CAA+B,CAAC;AAEtE,eAAO,MAAM,0BAA0B,MAA8B,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,yBAAyB,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,EAAE,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,cAAc,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,EAAE,CAAC;IACT;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B"}
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { deriveMasterIncomingViewingSecretKey } from '@aztec/stdlib/keys';
3
3
  export const INITIAL_TEST_SECRET_KEYS = [
4
4
  Fr.fromHexString('2153536ff6628eee01cf4024889ff977a18d9fa61d0e414422f7681cf085c281'),
@@ -1,11 +1,11 @@
1
- import { type InitialAccountData } from './configuration.js';
2
- export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS, type InitialAccountData, } from './configuration.js';
1
+ import { type InitialAccountData, type InitialAccountType } from './configuration.js';
2
+ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS, type InitialAccountData, type InitialAccountType, } from './configuration.js';
3
3
  /**
4
4
  * Gets the basic information for initial test accounts.
5
5
  */
6
6
  export declare function getInitialTestAccountsData(): Promise<InitialAccountData[]>;
7
7
  /**
8
- * Generate a fixed amount of random schnorr account contract instance.
8
+ * Generate a fixed amount of random schnorr account contract instances of the given type
9
9
  */
10
- export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<Promise<InitialAccountData[]>>;
11
- //# sourceMappingURL=index.d.ts.map
10
+ export declare function generateSchnorrAccounts(numberOfAccounts: number, type?: InitialAccountType): Promise<InitialAccountData[]>;
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0aW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVdBLE9BQU8sRUFLTCxLQUFLLGtCQUFrQixFQUN2QixLQUFLLGtCQUFrQixFQUN4QixNQUFNLG9CQUFvQixDQUFDO0FBRTVCLE9BQU8sRUFDTCwwQkFBMEIsRUFDMUIsNEJBQTRCLEVBQzVCLHdCQUF3QixFQUN4Qix5QkFBeUIsRUFDekIsS0FBSyxrQkFBa0IsRUFDdkIsS0FBSyxrQkFBa0IsR0FDeEIsTUFBTSxvQkFBb0IsQ0FBQztBQVM1Qjs7R0FFRztBQUNILHdCQUFnQiwwQkFBMEIsSUFBSSxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWMxRTtBQUVEOztHQUVHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUMzQyxnQkFBZ0IsRUFBRSxNQUFNLEVBQ3hCLElBQUksR0FBRSxrQkFBOEMsR0FDbkQsT0FBTyxDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0FjL0IifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAa1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAa9G"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAKL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAS5B;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAc1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,gBAAgB,EAAE,MAAM,EACxB,IAAI,GAAE,kBAA8C,GACnD,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAc/B"}
@@ -1,12 +1,16 @@
1
1
  /**
2
- * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a Sandbox environment.
2
+ * The `@aztec/accounts/testing` export provides utility methods for testing, in particular in a local network environment.
3
3
  *
4
4
  * @packageDocumentation
5
5
  */ import { Fr } from '@aztec/aztec.js/fields';
6
6
  import { deriveSigningKey } from '@aztec/stdlib/keys';
7
- import { getSchnorrAccountContractAddress } from '../schnorr/index.js';
7
+ import { getSchnorrInitializerlessAccountContractAddress } from '../schnorr/initializerless/index.js';
8
+ import { getSchnorrAccountContractAddress } from '../schnorr/private_immutable/index.js';
8
9
  import { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
9
10
  export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_SECRET_KEYS, INITIAL_TEST_SIGNING_KEYS } from './configuration.js';
11
+ /** Derives the account contract address for the given type */ function getTestAccountAddress(type, secret, salt, signingKey) {
12
+ return type === 'schnorr' ? getSchnorrAccountContractAddress(secret, salt, signingKey) : getSchnorrInitializerlessAccountContractAddress(secret, salt, signingKey);
13
+ }
10
14
  /**
11
15
  * Gets the basic information for initial test accounts.
12
16
  */ export function getInitialTestAccountsData() {
@@ -14,12 +18,13 @@ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_
14
18
  secret,
15
19
  signingKey: INITIAL_TEST_ENCRYPTION_KEYS[i],
16
20
  salt: INITIAL_TEST_ACCOUNT_SALTS[i],
17
- address: await getSchnorrAccountContractAddress(secret, INITIAL_TEST_ACCOUNT_SALTS[i], INITIAL_TEST_SIGNING_KEYS[i])
21
+ type: 'schnorr_initializerless',
22
+ address: await getSchnorrInitializerlessAccountContractAddress(secret, INITIAL_TEST_ACCOUNT_SALTS[i], INITIAL_TEST_SIGNING_KEYS[i])
18
23
  })));
19
24
  }
20
25
  /**
21
- * Generate a fixed amount of random schnorr account contract instance.
22
- */ export async function generateSchnorrAccounts(numberOfAccounts) {
26
+ * Generate a fixed amount of random schnorr account contract instances of the given type
27
+ */ export async function generateSchnorrAccounts(numberOfAccounts, type = 'schnorr_initializerless') {
23
28
  const secrets = Array.from({
24
29
  length: numberOfAccounts
25
30
  }, ()=>Fr.random());
@@ -29,7 +34,8 @@ export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_ENCRYPTION_KEYS, INITIAL_TEST_
29
34
  secret,
30
35
  signingKey: deriveSigningKey(secret),
31
36
  salt,
32
- address: await getSchnorrAccountContractAddress(secret, salt)
37
+ type,
38
+ address: await getTestAccountAddress(type, secret, salt)
33
39
  };
34
40
  }));
35
41
  }
@@ -1,11 +1,11 @@
1
- import { type InitialAccountData } from './configuration.js';
1
+ import { type InitialAccountData, type InitialAccountType } from './configuration.js';
2
2
  export { INITIAL_TEST_ACCOUNT_SALTS, INITIAL_TEST_SECRET_KEYS } from './configuration.js';
3
3
  /**
4
4
  * Gets the basic information for initial test accounts.
5
5
  */
6
6
  export declare function getInitialTestAccountsData(): Promise<InitialAccountData[]>;
7
7
  /**
8
- * Generate a fixed amount of random schnorr account contract instance.
8
+ * Generate a fixed amount of random schnorr account contract instances of the given type
9
9
  */
10
- export declare function generateSchnorrAccounts(numberOfAccounts: number): Promise<InitialAccountData[]>;
11
- //# sourceMappingURL=lazy.d.ts.map
10
+ export declare function generateSchnorrAccounts(numberOfAccounts: number, type?: InitialAccountType): Promise<InitialAccountData[]>;
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3RpbmcvbGF6eS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXQSxPQUFPLEVBS0wsS0FBSyxrQkFBa0IsRUFDdkIsS0FBSyxrQkFBa0IsRUFDeEIsTUFBTSxvQkFBb0IsQ0FBQztBQUU1QixPQUFPLEVBQUUsMEJBQTBCLEVBQUUsd0JBQXdCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQVMxRjs7R0FFRztBQUNILHdCQUFnQiwwQkFBMEIsSUFBSSxPQUFPLENBQUMsa0JBQWtCLEVBQUUsQ0FBQyxDQWMxRTtBQUVEOztHQUVHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUMzQyxnQkFBZ0IsRUFBRSxNQUFNLEVBQ3hCLElBQUksR0FBRSxrQkFBOEMsR0FDbkQsT0FBTyxDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0FjL0IifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/testing/lazy.ts"],"names":[],"mappings":"AASA,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE1F;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAa1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAarG"}
1
+ {"version":3,"file":"lazy.d.ts","sourceRoot":"","sources":["../../src/testing/lazy.ts"],"names":[],"mappings":"AAWA,OAAO,EAKL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAS1F;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAc1E;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,gBAAgB,EAAE,MAAM,EACxB,IAAI,GAAE,kBAA8C,GACnD,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAc/B"}