@aztec/stdlib 3.0.0-nightly.20251014 → 3.0.0-nightly.20251016
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.
- package/dest/abi/abi.d.ts +8 -8
- package/dest/abi/abi.js +1 -1
- package/dest/abi/function_call.d.ts +7 -2
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +6 -2
- package/dest/avm/avm.d.ts +54 -54
- package/dest/avm/avm_proving_request.d.ts +30 -30
- package/dest/contract/interfaces/contract_instance.d.ts +2 -2
- package/dest/interfaces/proving-job.d.ts +30 -30
- package/dest/kernel/private_circuit_public_inputs.d.ts +1 -1
- package/dest/kernel/private_to_public_accumulated_data.d.ts +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +1 -1
- package/dest/keys/derivation.d.ts +0 -2
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +1 -21
- package/dest/logs/directional_app_tagging_secret.d.ts +40 -0
- package/dest/logs/directional_app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/directional_app_tagging_secret.js +64 -0
- package/dest/logs/index.d.ts +2 -1
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +2 -1
- package/dest/logs/pre_tag.d.ts +34 -0
- package/dest/logs/pre_tag.d.ts.map +1 -0
- package/dest/logs/pre_tag.js +7 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +3 -0
- package/dest/tests/factories.d.ts +2 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +15 -9
- package/dest/tests/mocks.d.ts +3 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -2
- package/dest/tx/private_execution_result.d.ts +5 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +7 -3
- package/dest/tx/simulated_tx.d.ts +3 -3
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +10 -5
- package/package.json +8 -8
- package/src/abi/abi.ts +1 -1
- package/src/abi/function_call.ts +5 -1
- package/src/keys/derivation.ts +1 -26
- package/src/logs/directional_app_tagging_secret.ts +78 -0
- package/src/logs/index.ts +2 -1
- package/src/logs/pre_tag.ts +25 -0
- package/src/rollup/checkpoint_rollup_public_inputs.ts +4 -0
- package/src/tests/factories.ts +11 -4
- package/src/tests/mocks.ts +5 -0
- package/src/tx/private_execution_result.ts +6 -0
- package/src/versioning/versioning.ts +10 -5
- package/dest/logs/indexed_tagging_secret.d.ts +0 -28
- package/dest/logs/indexed_tagging_secret.d.ts.map +0 -1
- package/dest/logs/indexed_tagging_secret.js +0 -50
- package/src/logs/indexed_tagging_secret.ts +0 -48
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AztecAddress } from '../aztec-address/index.js';
|
|
3
|
-
export declare class IndexedTaggingSecret {
|
|
4
|
-
appTaggingSecret: Fr;
|
|
5
|
-
index: number;
|
|
6
|
-
constructor(appTaggingSecret: Fr, index: number);
|
|
7
|
-
toFields(): Fr[];
|
|
8
|
-
static fromFields(serialized: Fr[]): IndexedTaggingSecret;
|
|
9
|
-
/**
|
|
10
|
-
* Computes the tag based on the app tagging secret, recipient and index.
|
|
11
|
-
* @dev By including the recipient we achieve "directionality" of the tag (when sending a note in the other
|
|
12
|
-
* direction, the tag will be different).
|
|
13
|
-
* @param recipient The recipient of the note
|
|
14
|
-
* @returns The tag.
|
|
15
|
-
*/
|
|
16
|
-
computeTag(recipient: AztecAddress): Promise<Fr>;
|
|
17
|
-
/**
|
|
18
|
-
* Computes the siloed tag.
|
|
19
|
-
* @dev We do this second layer of siloing (one was already done as the tagging secret is app-siloed) because kernels
|
|
20
|
-
* do that to protect against contract impersonation attacks. This extra layer of siloing in kernels ensures that
|
|
21
|
-
* a malicious contract cannot emit a note with a tag corresponding to another contract.
|
|
22
|
-
* @param recipient The recipient of the note
|
|
23
|
-
* @param app The app address
|
|
24
|
-
* @returns The siloed tag.
|
|
25
|
-
*/
|
|
26
|
-
computeSiloedTag(recipient: AztecAddress, app: AztecAddress): Promise<Fr>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=indexed_tagging_secret.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"indexed_tagging_secret.d.ts","sourceRoot":"","sources":["../../src/logs/indexed_tagging_secret.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,qBAAa,oBAAoB;IAEtB,gBAAgB,EAAE,EAAE;IACpB,KAAK,EAAE,MAAM;gBADb,gBAAgB,EAAE,EAAE,EACpB,KAAK,EAAE,MAAM;IAOtB,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,EAAE;IAIlC;;;;;;OAMG;IACH,UAAU,CAAC,SAAS,EAAE,YAAY;IAIlC;;;;;;;;OAQG;IACG,gBAAgB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY;CAIlE"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { poseidon2Hash } from '@aztec/foundation/crypto';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
export class IndexedTaggingSecret {
|
|
4
|
-
appTaggingSecret;
|
|
5
|
-
index;
|
|
6
|
-
constructor(appTaggingSecret, index){
|
|
7
|
-
this.appTaggingSecret = appTaggingSecret;
|
|
8
|
-
this.index = index;
|
|
9
|
-
if (index < 0) {
|
|
10
|
-
throw new Error('IndexedTaggingSecret index out of bounds');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
toFields() {
|
|
14
|
-
return [
|
|
15
|
-
this.appTaggingSecret,
|
|
16
|
-
new Fr(this.index)
|
|
17
|
-
];
|
|
18
|
-
}
|
|
19
|
-
static fromFields(serialized) {
|
|
20
|
-
return new this(serialized[0], serialized[1].toNumber());
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Computes the tag based on the app tagging secret, recipient and index.
|
|
24
|
-
* @dev By including the recipient we achieve "directionality" of the tag (when sending a note in the other
|
|
25
|
-
* direction, the tag will be different).
|
|
26
|
-
* @param recipient The recipient of the note
|
|
27
|
-
* @returns The tag.
|
|
28
|
-
*/ computeTag(recipient) {
|
|
29
|
-
return poseidon2Hash([
|
|
30
|
-
this.appTaggingSecret,
|
|
31
|
-
recipient,
|
|
32
|
-
this.index
|
|
33
|
-
]);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Computes the siloed tag.
|
|
37
|
-
* @dev We do this second layer of siloing (one was already done as the tagging secret is app-siloed) because kernels
|
|
38
|
-
* do that to protect against contract impersonation attacks. This extra layer of siloing in kernels ensures that
|
|
39
|
-
* a malicious contract cannot emit a note with a tag corresponding to another contract.
|
|
40
|
-
* @param recipient The recipient of the note
|
|
41
|
-
* @param app The app address
|
|
42
|
-
* @returns The siloed tag.
|
|
43
|
-
*/ async computeSiloedTag(recipient, app) {
|
|
44
|
-
const tag = await this.computeTag(recipient);
|
|
45
|
-
return poseidon2Hash([
|
|
46
|
-
app,
|
|
47
|
-
tag
|
|
48
|
-
]);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { poseidon2Hash } from '@aztec/foundation/crypto';
|
|
2
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
|
|
4
|
-
import type { AztecAddress } from '../aztec-address/index.js';
|
|
5
|
-
|
|
6
|
-
export class IndexedTaggingSecret {
|
|
7
|
-
constructor(
|
|
8
|
-
public appTaggingSecret: Fr,
|
|
9
|
-
public index: number,
|
|
10
|
-
) {
|
|
11
|
-
if (index < 0) {
|
|
12
|
-
throw new Error('IndexedTaggingSecret index out of bounds');
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
toFields(): Fr[] {
|
|
17
|
-
return [this.appTaggingSecret, new Fr(this.index)];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static fromFields(serialized: Fr[]) {
|
|
21
|
-
return new this(serialized[0], serialized[1].toNumber());
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Computes the tag based on the app tagging secret, recipient and index.
|
|
26
|
-
* @dev By including the recipient we achieve "directionality" of the tag (when sending a note in the other
|
|
27
|
-
* direction, the tag will be different).
|
|
28
|
-
* @param recipient The recipient of the note
|
|
29
|
-
* @returns The tag.
|
|
30
|
-
*/
|
|
31
|
-
computeTag(recipient: AztecAddress) {
|
|
32
|
-
return poseidon2Hash([this.appTaggingSecret, recipient, this.index]);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Computes the siloed tag.
|
|
37
|
-
* @dev We do this second layer of siloing (one was already done as the tagging secret is app-siloed) because kernels
|
|
38
|
-
* do that to protect against contract impersonation attacks. This extra layer of siloing in kernels ensures that
|
|
39
|
-
* a malicious contract cannot emit a note with a tag corresponding to another contract.
|
|
40
|
-
* @param recipient The recipient of the note
|
|
41
|
-
* @param app The app address
|
|
42
|
-
* @returns The siloed tag.
|
|
43
|
-
*/
|
|
44
|
-
async computeSiloedTag(recipient: AztecAddress, app: AztecAddress) {
|
|
45
|
-
const tag = await this.computeTag(recipient);
|
|
46
|
-
return poseidon2Hash([app, tag]);
|
|
47
|
-
}
|
|
48
|
-
}
|