@aztec/blob-lib 0.0.0-test.1 → 0.0.1-commit.1142ef1
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/batched_blob.d.ts +26 -0
- package/dest/batched_blob.d.ts.map +1 -0
- package/dest/batched_blob.js +20 -0
- package/dest/blob.d.ts +55 -102
- package/dest/blob.d.ts.map +1 -1
- package/dest/blob.js +89 -188
- package/dest/blob_batching.d.ts +106 -0
- package/dest/blob_batching.d.ts.map +1 -0
- package/dest/blob_batching.js +225 -0
- package/dest/blob_utils.d.ts +40 -0
- package/dest/blob_utils.d.ts.map +1 -0
- package/dest/blob_utils.js +69 -0
- package/dest/circuit_types/blob_accumulator.d.ts +23 -0
- package/dest/circuit_types/blob_accumulator.d.ts.map +1 -0
- package/dest/circuit_types/blob_accumulator.js +62 -0
- package/dest/circuit_types/final_blob_accumulator.d.ts +23 -0
- package/dest/circuit_types/final_blob_accumulator.d.ts.map +1 -0
- package/dest/circuit_types/final_blob_accumulator.js +66 -0
- package/dest/circuit_types/final_blob_batching_challenges.d.ts +16 -0
- package/dest/circuit_types/final_blob_batching_challenges.d.ts.map +1 -0
- package/dest/circuit_types/final_blob_batching_challenges.js +26 -0
- package/dest/circuit_types/index.d.ts +4 -0
- package/dest/circuit_types/index.d.ts.map +1 -0
- package/dest/circuit_types/index.js +4 -0
- package/dest/encoding/block_blob_data.d.ts +22 -0
- package/dest/encoding/block_blob_data.d.ts.map +1 -0
- package/dest/encoding/block_blob_data.js +65 -0
- package/dest/encoding/block_end_marker.d.ts +11 -0
- package/dest/encoding/block_end_marker.d.ts.map +1 -0
- package/dest/encoding/block_end_marker.js +41 -0
- package/dest/encoding/block_end_state_field.d.ts +12 -0
- package/dest/encoding/block_end_state_field.d.ts.map +1 -0
- package/dest/encoding/block_end_state_field.js +39 -0
- package/dest/encoding/checkpoint_blob_data.d.ts +15 -0
- package/dest/encoding/checkpoint_blob_data.d.ts.map +1 -0
- package/dest/encoding/checkpoint_blob_data.js +67 -0
- package/dest/encoding/checkpoint_end_marker.d.ts +8 -0
- package/dest/encoding/checkpoint_end_marker.d.ts.map +1 -0
- package/dest/encoding/checkpoint_end_marker.js +28 -0
- package/dest/encoding/fixtures.d.ts +41 -0
- package/dest/encoding/fixtures.d.ts.map +1 -0
- package/dest/encoding/fixtures.js +140 -0
- package/dest/encoding/index.d.ts +10 -0
- package/dest/encoding/index.d.ts.map +1 -0
- package/dest/encoding/index.js +9 -0
- package/dest/encoding/tx_blob_data.d.ts +19 -0
- package/dest/encoding/tx_blob_data.d.ts.map +1 -0
- package/dest/encoding/tx_blob_data.js +79 -0
- package/dest/encoding/tx_start_marker.d.ts +16 -0
- package/dest/encoding/tx_start_marker.d.ts.map +1 -0
- package/dest/encoding/tx_start_marker.js +77 -0
- package/dest/errors.d.ts +1 -1
- package/dest/errors.d.ts.map +1 -1
- package/dest/hash.d.ts +43 -0
- package/dest/hash.d.ts.map +1 -0
- package/dest/hash.js +80 -0
- package/dest/index.d.ts +8 -4
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +7 -16
- package/dest/interface.d.ts +1 -3
- package/dest/interface.d.ts.map +1 -1
- package/dest/kzg_context.d.ts +8 -0
- package/dest/kzg_context.d.ts.map +1 -0
- package/dest/kzg_context.js +14 -0
- package/dest/sponge_blob.d.ts +14 -18
- package/dest/sponge_blob.d.ts.map +1 -1
- package/dest/sponge_blob.js +26 -30
- package/dest/testing.d.ts +13 -25
- package/dest/testing.d.ts.map +1 -1
- package/dest/testing.js +38 -53
- package/dest/types.d.ts +17 -0
- package/dest/types.d.ts.map +1 -0
- package/dest/types.js +4 -0
- package/package.json +20 -15
- package/src/batched_blob.ts +26 -0
- package/src/blob.ts +85 -223
- package/src/blob_batching.ts +300 -0
- package/src/blob_utils.ts +82 -0
- package/src/circuit_types/blob_accumulator.ts +96 -0
- package/src/circuit_types/final_blob_accumulator.ts +76 -0
- package/src/circuit_types/final_blob_batching_challenges.ts +30 -0
- package/src/circuit_types/index.ts +4 -0
- package/src/encoding/block_blob_data.ts +102 -0
- package/src/encoding/block_end_marker.ts +55 -0
- package/src/encoding/block_end_state_field.ts +59 -0
- package/src/encoding/checkpoint_blob_data.ts +95 -0
- package/src/encoding/checkpoint_end_marker.ts +40 -0
- package/src/encoding/fixtures.ts +210 -0
- package/src/encoding/index.ts +9 -0
- package/src/encoding/tx_blob_data.ts +116 -0
- package/src/encoding/tx_start_marker.ts +97 -0
- package/src/hash.ts +89 -0
- package/src/index.ts +7 -20
- package/src/interface.ts +0 -4
- package/src/kzg_context.ts +16 -0
- package/src/sponge_blob.ts +28 -31
- package/src/testing.ts +49 -50
- package/src/trusted_setup_bit_reversed.json +4100 -0
- package/src/types.ts +17 -0
- package/dest/blob_public_inputs.d.ts +0 -50
- package/dest/blob_public_inputs.d.ts.map +0 -1
- package/dest/blob_public_inputs.js +0 -146
- package/dest/encoding.d.ts +0 -66
- package/dest/encoding.d.ts.map +0 -1
- package/dest/encoding.js +0 -113
- package/src/blob_public_inputs.ts +0 -157
- package/src/encoding.ts +0 -138
package/dest/testing.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
1
|
import { Blob } from './blob.js';
|
|
3
|
-
import {
|
|
2
|
+
import { BlobAccumulator } from './circuit_types/blob_accumulator.js';
|
|
3
|
+
import { FinalBlobAccumulator } from './circuit_types/final_blob_accumulator.js';
|
|
4
|
+
import { FinalBlobBatchingChallenges } from './circuit_types/final_blob_batching_challenges.js';
|
|
4
5
|
import { SpongeBlob } from './sponge_blob.js';
|
|
6
|
+
export * from './encoding/fixtures.js';
|
|
5
7
|
/**
|
|
6
8
|
* Makes arbitrary poseidon sponge for blob inputs.
|
|
7
9
|
* Note: will not verify inside the circuit.
|
|
@@ -10,34 +12,20 @@ import { SpongeBlob } from './sponge_blob.js';
|
|
|
10
12
|
*/
|
|
11
13
|
export declare function makeSpongeBlob(seed?: number): SpongeBlob;
|
|
12
14
|
/**
|
|
13
|
-
* Makes arbitrary blob public
|
|
15
|
+
* Makes arbitrary blob public accumulator.
|
|
14
16
|
* Note: will not verify inside the circuit.
|
|
15
|
-
* @param seed - The seed to use for generating the blob
|
|
16
|
-
* @returns A blob
|
|
17
|
+
* @param seed - The seed to use for generating the blob accumulator.
|
|
18
|
+
* @returns A blob accumulator instance.
|
|
17
19
|
*/
|
|
18
|
-
export declare function
|
|
20
|
+
export declare function makeBlobAccumulator(seed?: number): BlobAccumulator;
|
|
21
|
+
export declare function makeFinalBlobAccumulator(seed?: number): FinalBlobAccumulator;
|
|
22
|
+
export declare function makeFinalBlobBatchingChallenges(seed?: number): FinalBlobBatchingChallenges;
|
|
19
23
|
/**
|
|
20
|
-
*
|
|
21
|
-
* Note: will not verify inside the circuit.
|
|
22
|
-
* @param seed - The seed to use for generating the blob inputs.
|
|
23
|
-
* @returns A block blob public inputs instance.
|
|
24
|
-
*/
|
|
25
|
-
export declare function makeBlockBlobPublicInputs(seed?: number): BlockBlobPublicInputs;
|
|
26
|
-
/**
|
|
27
|
-
* Make an encoded blob with the given length
|
|
28
|
-
*
|
|
29
|
-
* This will deserialise correctly in the archiver
|
|
30
|
-
* @param length
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
export declare function makeEncodedBlob(length: number): Promise<Blob>;
|
|
34
|
-
/**
|
|
35
|
-
* Make an unencoded blob with the given length
|
|
24
|
+
* Make a blob with random fields.
|
|
36
25
|
*
|
|
37
26
|
* This will fail deserialisation in the archiver
|
|
38
27
|
* @param length
|
|
39
28
|
* @returns
|
|
40
29
|
*/
|
|
41
|
-
export declare function
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=testing.d.ts.map
|
|
30
|
+
export declare function makeRandomBlob(length: number): Blob;
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdGluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3Rlc3RpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUEsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUNqQyxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFDdEUsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sMkNBQTJDLENBQUM7QUFDakYsT0FBTyxFQUFFLDJCQUEyQixFQUFFLE1BQU0sbURBQW1ELENBQUM7QUFDaEcsT0FBTyxFQUFtQixVQUFVLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUUvRCxjQUFjLHdCQUF3QixDQUFDO0FBRXZDOzs7OztHQUtHO0FBQ0gsd0JBQWdCLGNBQWMsQ0FBQyxJQUFJLFNBQUksR0FBRyxVQUFVLENBVW5EO0FBMEJEOzs7OztHQUtHO0FBQ0gsd0JBQWdCLG1CQUFtQixDQUFDLElBQUksU0FBSSxHQUFHLGVBQWUsQ0FTN0Q7QUFFRCx3QkFBZ0Isd0JBQXdCLENBQUMsSUFBSSxTQUFJLHdCQU9oRDtBQUVELHdCQUFnQiwrQkFBK0IsQ0FBQyxJQUFJLFNBQUksK0JBRXZEO0FBRUQ7Ozs7OztHQU1HO0FBQ0gsd0JBQWdCLGNBQWMsQ0FBQyxNQUFNLEVBQUUsTUFBTSxHQUFHLElBQUksQ0FFbkQifQ==
|
package/dest/testing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AAChG,OAAO,EAAmB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D,cAAc,wBAAwB,CAAC;AAEvC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,SAAI,GAAG,UAAU,CAUnD;AA0BD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,SAAI,GAAG,eAAe,CAS7D;AAED,wBAAgB,wBAAwB,CAAC,IAAI,SAAI,wBAOhD;AAED,wBAAgB,+BAA+B,CAAC,IAAI,SAAI,+BAEvD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEnD"}
|
package/dest/testing.js
CHANGED
|
@@ -1,81 +1,66 @@
|
|
|
1
|
-
import { BLOBS_PER_BLOCK } from '@aztec/constants';
|
|
2
1
|
import { makeTuple } from '@aztec/foundation/array';
|
|
3
|
-
import {
|
|
4
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { BLS12Fq, BLS12Fr, BLS12Point, BLSPointNotOnCurveError } from '@aztec/foundation/curves/bls12';
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
4
|
import { Blob } from './blob.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { BlobAccumulator } from './circuit_types/blob_accumulator.js';
|
|
6
|
+
import { FinalBlobAccumulator } from './circuit_types/final_blob_accumulator.js';
|
|
7
|
+
import { FinalBlobBatchingChallenges } from './circuit_types/final_blob_batching_challenges.js';
|
|
8
8
|
import { Poseidon2Sponge, SpongeBlob } from './sponge_blob.js';
|
|
9
|
+
export * from './encoding/fixtures.js';
|
|
9
10
|
/**
|
|
10
11
|
* Makes arbitrary poseidon sponge for blob inputs.
|
|
11
12
|
* Note: will not verify inside the circuit.
|
|
12
13
|
* @param seed - The seed to use for generating the sponge.
|
|
13
14
|
* @returns A sponge blob instance.
|
|
14
15
|
*/ export function makeSpongeBlob(seed = 1) {
|
|
15
|
-
return new SpongeBlob(new Poseidon2Sponge(makeTuple(3, (i)=>new Fr(i)), makeTuple(4, (i)=>new Fr(i)), 1, false), seed
|
|
16
|
+
return new SpongeBlob(new Poseidon2Sponge(makeTuple(3, (i)=>new Fr(i)), makeTuple(4, (i)=>new Fr(i)), 1, false), seed);
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
* Makes arbitrary
|
|
19
|
-
*
|
|
20
|
-
* @
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
* Makes an arbitrary but valid BLS12 point. The value is deterministic for a given seed.
|
|
20
|
+
* @param seed - The seed to use for generating the point.
|
|
21
|
+
* @returns A BLS12 point instance.
|
|
22
|
+
*/ function makeBLS12Point(seed = 1) {
|
|
23
|
+
let accum = 0;
|
|
24
|
+
while(true){
|
|
25
|
+
try {
|
|
26
|
+
const x = new BLS12Fq(seed + accum);
|
|
27
|
+
const y = BLS12Point.YFromX(x);
|
|
28
|
+
if (y) {
|
|
29
|
+
return new BLS12Point(x, y, false);
|
|
30
|
+
}
|
|
31
|
+
accum++;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
if (!(e instanceof BLSPointNotOnCurveError)) {
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
// The point is not on the curve - try again
|
|
37
|
+
}
|
|
38
|
+
}
|
|
24
39
|
}
|
|
25
40
|
/**
|
|
26
|
-
* Makes arbitrary
|
|
41
|
+
* Makes arbitrary blob public accumulator.
|
|
27
42
|
* Note: will not verify inside the circuit.
|
|
28
|
-
* @param seed - The seed to use for generating the blob
|
|
29
|
-
* @returns A
|
|
30
|
-
*/ export function
|
|
31
|
-
return new
|
|
43
|
+
* @param seed - The seed to use for generating the blob accumulator.
|
|
44
|
+
* @returns A blob accumulator instance.
|
|
45
|
+
*/ export function makeBlobAccumulator(seed = 1) {
|
|
46
|
+
return new BlobAccumulator(new Fr(seed), new Fr(seed + 0x10), new BLS12Fr(seed + 0x20), makeBLS12Point(seed + 0x30), new Fr(seed + 0x50), new BLS12Fr(seed + 0x60));
|
|
32
47
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const lengthBuf = Buffer.alloc(2);
|
|
36
|
-
lengthBuf.writeUInt16BE(length, 0);
|
|
37
|
-
return new Fr(Buffer.concat([
|
|
38
|
-
toBufferBE(TX_START_PREFIX, TX_START_PREFIX_BYTES_LENGTH),
|
|
39
|
-
Buffer.alloc(1),
|
|
40
|
-
lengthBuf,
|
|
41
|
-
Buffer.alloc(1),
|
|
42
|
-
Buffer.from([
|
|
43
|
-
1
|
|
44
|
-
]),
|
|
45
|
-
Buffer.alloc(1),
|
|
46
|
-
Buffer.alloc(1)
|
|
47
|
-
]));
|
|
48
|
+
export function makeFinalBlobAccumulator(seed = 1) {
|
|
49
|
+
return new FinalBlobAccumulator(new Fr(seed), new Fr(seed + 0x10), new BLS12Fr(seed + 0x20), makeBLS12Point(seed + 0x30));
|
|
48
50
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
* This will deserialise correctly in the archiver
|
|
53
|
-
* @param length
|
|
54
|
-
* @returns
|
|
55
|
-
*/ export function makeEncodedBlob(length) {
|
|
56
|
-
return Blob.fromFields([
|
|
57
|
-
encodeFirstField(length + 1),
|
|
58
|
-
...Array.from({
|
|
59
|
-
length: length
|
|
60
|
-
}, ()=>Fr.random())
|
|
61
|
-
]);
|
|
51
|
+
export function makeFinalBlobBatchingChallenges(seed = 1) {
|
|
52
|
+
return new FinalBlobBatchingChallenges(new Fr(seed), new BLS12Fr(seed + 0x10));
|
|
62
53
|
}
|
|
63
54
|
/**
|
|
64
|
-
* Make
|
|
55
|
+
* Make a blob with random fields.
|
|
65
56
|
*
|
|
66
57
|
* This will fail deserialisation in the archiver
|
|
67
58
|
* @param length
|
|
68
59
|
* @returns
|
|
69
|
-
*/ export function
|
|
60
|
+
*/ export function makeRandomBlob(length) {
|
|
70
61
|
return Blob.fromFields([
|
|
71
62
|
...Array.from({
|
|
72
63
|
length: length
|
|
73
64
|
}, ()=>Fr.random())
|
|
74
65
|
]);
|
|
75
66
|
}
|
|
76
|
-
export function makeEncodedBlobFields(fields) {
|
|
77
|
-
return Blob.fromFields([
|
|
78
|
-
encodeFirstField(fields.length + 1),
|
|
79
|
-
...fields
|
|
80
|
-
]);
|
|
81
|
-
}
|
package/dest/types.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './batched_blob.js';
|
|
2
|
+
export * from './circuit_types/index.js';
|
|
3
|
+
export * from './interface.js';
|
|
4
|
+
export * from './sponge_blob.js';
|
|
5
|
+
/**
|
|
6
|
+
* Type definition for the KZG instance returned by Blob.getViemKzgInstance().
|
|
7
|
+
* Contains the cryptographic functions needed for blob commitment and proof generation.
|
|
8
|
+
*/
|
|
9
|
+
export interface BlobKzgInstance {
|
|
10
|
+
/** Function to compute KZG commitment from blob data */
|
|
11
|
+
blobToKzgCommitment(blob: Uint8Array): Uint8Array;
|
|
12
|
+
/** Function to compute KZG proof for blob data */
|
|
13
|
+
computeBlobKzgProof(blob: Uint8Array, commitment: Uint8Array): Uint8Array;
|
|
14
|
+
/** Function to compute both blob data cells and their corresponding KZG proofs for EIP7594 */
|
|
15
|
+
computeCellsAndKzgProofs(blob: Uint8Array): [Uint8Array[], Uint8Array[]];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLGtCQUFrQixDQUFDO0FBRWpDOzs7R0FHRztBQUNILE1BQU0sV0FBVyxlQUFlO0lBQzlCLHdEQUF3RDtJQUN4RCxtQkFBbUIsQ0FBQyxJQUFJLEVBQUUsVUFBVSxHQUFHLFVBQVUsQ0FBQztJQUNsRCxrREFBa0Q7SUFDbEQsbUJBQW1CLENBQUMsSUFBSSxFQUFFLFVBQVUsRUFBRSxVQUFVLEVBQUUsVUFBVSxHQUFHLFVBQVUsQ0FBQztJQUMxRSw4RkFBOEY7SUFDOUYsd0JBQXdCLENBQUMsSUFBSSxFQUFFLFVBQVUsR0FBRyxDQUFDLFVBQVUsRUFBRSxFQUFFLFVBQVUsRUFBRSxDQUFDLENBQUM7Q0FDMUUifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CAAC;IAClD,kDAAkD;IAClD,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;IAC1E,8FAA8F;IAC9F,wBAAwB,CAAC,IAAI,EAAE,UAAU,GAAG,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;CAC1E"}
|
package/dest/types.js
ADDED
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/blob-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1-commit.1142ef1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
7
|
+
"./encoding": "./dest/encoding/index.js",
|
|
8
|
+
"./types": "./dest/types.js",
|
|
7
9
|
"./testing": "./dest/testing.js"
|
|
8
10
|
},
|
|
9
11
|
"typedocOptions": {
|
|
@@ -14,12 +16,10 @@
|
|
|
14
16
|
"tsconfig": "./tsconfig.json"
|
|
15
17
|
},
|
|
16
18
|
"scripts": {
|
|
17
|
-
"build": "yarn clean && tsc
|
|
18
|
-
"build:dev": "tsc
|
|
19
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
20
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
19
21
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
20
|
-
"
|
|
21
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
22
|
-
"start:dev": "tsc-watch -p tsconfig.json --onSuccess 'yarn start'",
|
|
22
|
+
"start:dev": "concurrently -k \"tsgo -b -w\" \"nodemon --watch dest --exec yarn start\"",
|
|
23
23
|
"start": "node ./dest/index.js",
|
|
24
24
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
25
25
|
},
|
|
@@ -27,19 +27,20 @@
|
|
|
27
27
|
"../package.common.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aztec/constants": "0.0.
|
|
31
|
-
"@aztec/foundation": "0.0.
|
|
32
|
-
"
|
|
30
|
+
"@aztec/constants": "0.0.1-commit.1142ef1",
|
|
31
|
+
"@aztec/foundation": "0.0.1-commit.1142ef1",
|
|
32
|
+
"@crate-crypto/node-eth-kzg": "^0.10.0",
|
|
33
33
|
"tslib": "^2.4.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@jest/globals": "^
|
|
37
|
-
"@types/jest": "^
|
|
38
|
-
"@types/node": "^
|
|
36
|
+
"@jest/globals": "^30.0.0",
|
|
37
|
+
"@types/jest": "^30.0.0",
|
|
38
|
+
"@types/node": "^22.15.17",
|
|
39
|
+
"@typescript/native-preview": "7.0.0-dev.20251126.1",
|
|
39
40
|
"get-port": "^7.1.0",
|
|
40
|
-
"jest": "^
|
|
41
|
+
"jest": "^30.0.0",
|
|
41
42
|
"ts-node": "^10.9.1",
|
|
42
|
-
"typescript": "^5.
|
|
43
|
+
"typescript": "^5.3.3"
|
|
43
44
|
},
|
|
44
45
|
"files": [
|
|
45
46
|
"dest",
|
|
@@ -78,9 +79,13 @@
|
|
|
78
79
|
"testTimeout": 120000,
|
|
79
80
|
"setupFiles": [
|
|
80
81
|
"../../foundation/src/jest/setup.mjs"
|
|
82
|
+
],
|
|
83
|
+
"testEnvironment": "../../foundation/src/jest/env.mjs",
|
|
84
|
+
"setupFilesAfterEnv": [
|
|
85
|
+
"../../foundation/src/jest/setupAfterEnv.mjs"
|
|
81
86
|
]
|
|
82
87
|
},
|
|
83
88
|
"engines": {
|
|
84
|
-
"node": ">=
|
|
89
|
+
"node": ">=20.10"
|
|
85
90
|
}
|
|
86
91
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BLS12Fr, BLS12Point } from '@aztec/foundation/curves/bls12';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
|
|
4
|
+
import { FinalBlobAccumulator } from './circuit_types/index.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A class to represent the result from accumulating blobs in an epoch using BatchedBlobAccumulator.
|
|
8
|
+
*/
|
|
9
|
+
export class BatchedBlob {
|
|
10
|
+
constructor(
|
|
11
|
+
/** Hash of Cs (to link to L1 blob hashes). */
|
|
12
|
+
public readonly blobCommitmentsHash: Fr,
|
|
13
|
+
/** Challenge point z such that p_i(z) = y_i. */
|
|
14
|
+
public readonly z: Fr,
|
|
15
|
+
/** Evaluation y, linear combination of all evaluations y_i = p_i(z) with gamma. */
|
|
16
|
+
public readonly y: BLS12Fr,
|
|
17
|
+
/** Commitment C, linear combination of all commitments C_i = [p_i] with gamma. */
|
|
18
|
+
public readonly commitment: BLS12Point,
|
|
19
|
+
/** KZG opening 'proof' Q (commitment to the quotient poly.), linear combination of all blob kzg 'proofs' Q_i with gamma. */
|
|
20
|
+
public readonly q: BLS12Point,
|
|
21
|
+
) {}
|
|
22
|
+
|
|
23
|
+
toFinalBlobAccumulator() {
|
|
24
|
+
return new FinalBlobAccumulator(this.blobCommitmentsHash, this.z, this.y, this.commitment);
|
|
25
|
+
}
|
|
26
|
+
}
|