@aztec/blob-lib 3.0.0-nightly.20251026 → 3.0.0-nightly.20251031

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 (61) hide show
  1. package/dest/blob.d.ts +47 -89
  2. package/dest/blob.d.ts.map +1 -1
  3. package/dest/blob.js +62 -160
  4. package/dest/blob_batching.d.ts +14 -46
  5. package/dest/blob_batching.d.ts.map +1 -1
  6. package/dest/blob_batching.js +80 -100
  7. package/dest/blob_utils.d.ts +30 -0
  8. package/dest/blob_utils.d.ts.map +1 -0
  9. package/dest/blob_utils.js +60 -0
  10. package/dest/circuit_types/blob_accumulator.d.ts +21 -0
  11. package/dest/circuit_types/blob_accumulator.d.ts.map +1 -0
  12. package/dest/circuit_types/blob_accumulator.js +58 -0
  13. package/dest/circuit_types/final_blob_accumulator.d.ts +22 -0
  14. package/dest/circuit_types/final_blob_accumulator.d.ts.map +1 -0
  15. package/dest/circuit_types/final_blob_accumulator.js +63 -0
  16. package/dest/circuit_types/final_blob_batching_challenges.d.ts +15 -0
  17. package/dest/circuit_types/final_blob_batching_challenges.d.ts.map +1 -0
  18. package/dest/circuit_types/final_blob_batching_challenges.js +25 -0
  19. package/dest/circuit_types/index.d.ts +4 -0
  20. package/dest/circuit_types/index.d.ts.map +1 -0
  21. package/dest/circuit_types/index.js +4 -0
  22. package/dest/deserialize.d.ts +7 -41
  23. package/dest/deserialize.d.ts.map +1 -1
  24. package/dest/deserialize.js +25 -73
  25. package/dest/encoding.d.ts +5 -0
  26. package/dest/encoding.d.ts.map +1 -1
  27. package/dest/encoding.js +35 -0
  28. package/dest/hash.d.ts +35 -0
  29. package/dest/hash.d.ts.map +1 -0
  30. package/dest/hash.js +69 -0
  31. package/dest/index.d.ts +4 -2
  32. package/dest/index.d.ts.map +1 -1
  33. package/dest/index.js +4 -2
  34. package/dest/sponge_blob.d.ts +13 -9
  35. package/dest/sponge_blob.d.ts.map +1 -1
  36. package/dest/sponge_blob.js +28 -17
  37. package/dest/testing.d.ts +7 -2
  38. package/dest/testing.d.ts.map +1 -1
  39. package/dest/testing.js +47 -14
  40. package/dest/types.d.ts +2 -0
  41. package/dest/types.d.ts.map +1 -1
  42. package/dest/types.js +2 -0
  43. package/package.json +4 -4
  44. package/src/blob.ts +67 -180
  45. package/src/blob_batching.ts +109 -119
  46. package/src/blob_utils.ts +71 -0
  47. package/src/circuit_types/blob_accumulator.ts +84 -0
  48. package/src/circuit_types/final_blob_accumulator.ts +75 -0
  49. package/src/circuit_types/final_blob_batching_challenges.ts +29 -0
  50. package/src/circuit_types/index.ts +4 -0
  51. package/src/deserialize.ts +24 -79
  52. package/src/encoding.ts +45 -0
  53. package/src/hash.ts +77 -0
  54. package/src/index.ts +4 -2
  55. package/src/sponge_blob.ts +24 -14
  56. package/src/testing.ts +53 -16
  57. package/src/types.ts +2 -2
  58. package/dest/blob_batching_public_inputs.d.ts +0 -57
  59. package/dest/blob_batching_public_inputs.d.ts.map +0 -1
  60. package/dest/blob_batching_public_inputs.js +0 -144
  61. package/src/blob_batching_public_inputs.ts +0 -211
@@ -1,48 +1,14 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
2
  /**
3
- * Deserializes a blob buffer into an array of field elements.
3
+ * Deserializes a buffer into an array of field elements.
4
4
  *
5
- * Blobs are converted into BN254 fields to perform a poseidon2 hash on them (fieldHash).
6
- * This method is sparse, meaning it does not include trailing zeros at the end of the blob.
5
+ * This function returns the fields that were actually added in a checkpoint. The number of fields is specified by the
6
+ * first field.
7
7
  *
8
- * However, we cannot simply trim the zero's from the end of the blob, as some logs may include zero's
9
- * within them.
10
- * If we end on a set of zeros, such as the log below:
11
- * length 7: [ a, b, c, d, e, 0, 0]
12
- *
13
- * we will end up with the incorrect hash if we trim the zeros from the end.
14
- *
15
- * Each transactions logs contains a TX start prefix, which includes a string followed
16
- * by the length ( in field elements ) of the transaction's log.
17
- *
18
- * This function finds the end of the last transaction's logs, and returns the array up to this point.
19
- *
20
- * We search for a series of Tx Prefixes progressing the cursor in the field reader until we hit
21
- * a field that is not a Tx Prefix, this indicates that we have reached the end of the last transaction's logs.
22
- *
23
- * +------------------+------------------+------------------+------------------+
24
- * | TX1 Start Prefix | TX1 Log Fields | TX2 Start Prefix | Padded zeros |
25
- * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
26
- * +------------------+------------------+------------------+------------------+
27
- * ^
28
- * |
29
- * Function reads until here --------------------------------
30
- *
31
- * @param blob - The blob buffer to deserialize.
8
+ * @param buf - The buffer to deserialize.
9
+ * @param checkEncoding - Whether to check if the encoding is correct. If false, it will still check the checkpoint
10
+ * prefix and throw if there's not enough fields.
32
11
  * @returns An array of field elements.
33
12
  */
34
- export declare function deserializeEncodedBlobToFields(blob: Uint8Array): Fr[];
35
- /**
36
- * Extract the fields from a blob buffer, but do not take into account encoding
37
- * that will include trailing zeros.
38
- *
39
- * +------------------+------------------+------------------+------------------+
40
- * | | | | Padded zeros |
41
- * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
42
- * +------------------+------------------+------------------+------------------+
43
- * ^
44
- * |
45
- * Function reads until here ----------------------
46
- */
47
- export declare function extractBlobFieldsFromBuffer(blob: Uint8Array): Fr[];
13
+ export declare function deserializeEncodedBlobToFields(buf: Uint8Array, checkEncoding?: boolean): Fr[];
48
14
  //# sourceMappingURL=deserialize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../src/deserialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAK9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,CA6BrE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,UAAU,GAAG,EAAE,EAAE,CAYlE"}
1
+ {"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../src/deserialize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAM9C;;;;;;;;;;GAUG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,UAAU,EAAE,aAAa,UAAQ,GAAG,EAAE,EAAE,CAoB3F"}
@@ -1,81 +1,33 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
- import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
3
- import { getNumBlobFieldsFromTxStartMarker, isBlockEndMarker } from './encoding.js';
2
+ import { BufferReader } from '@aztec/foundation/serialize';
3
+ import { checkBlobFieldsEncoding } from './encoding.js';
4
+ import { BlobDeserializationError } from './errors.js';
4
5
  /**
5
- * Deserializes a blob buffer into an array of field elements.
6
+ * Deserializes a buffer into an array of field elements.
6
7
  *
7
- * Blobs are converted into BN254 fields to perform a poseidon2 hash on them (fieldHash).
8
- * This method is sparse, meaning it does not include trailing zeros at the end of the blob.
8
+ * This function returns the fields that were actually added in a checkpoint. The number of fields is specified by the
9
+ * first field.
9
10
  *
10
- * However, we cannot simply trim the zero's from the end of the blob, as some logs may include zero's
11
- * within them.
12
- * If we end on a set of zeros, such as the log below:
13
- * length 7: [ a, b, c, d, e, 0, 0]
14
- *
15
- * we will end up with the incorrect hash if we trim the zeros from the end.
16
- *
17
- * Each transactions logs contains a TX start prefix, which includes a string followed
18
- * by the length ( in field elements ) of the transaction's log.
19
- *
20
- * This function finds the end of the last transaction's logs, and returns the array up to this point.
21
- *
22
- * We search for a series of Tx Prefixes progressing the cursor in the field reader until we hit
23
- * a field that is not a Tx Prefix, this indicates that we have reached the end of the last transaction's logs.
24
- *
25
- * +------------------+------------------+------------------+------------------+
26
- * | TX1 Start Prefix | TX1 Log Fields | TX2 Start Prefix | Padded zeros |
27
- * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
28
- * +------------------+------------------+------------------+------------------+
29
- * ^
30
- * |
31
- * Function reads until here --------------------------------
32
- *
33
- * @param blob - The blob buffer to deserialize.
11
+ * @param buf - The buffer to deserialize.
12
+ * @param checkEncoding - Whether to check if the encoding is correct. If false, it will still check the checkpoint
13
+ * prefix and throw if there's not enough fields.
34
14
  * @returns An array of field elements.
35
- */ export function deserializeEncodedBlobToFields(blob) {
36
- // Convert blob buffer to array of field elements
37
- const reader = BufferReader.asReader(blob);
38
- const array = reader.readArray(blob.length >> 5, Fr); // >> 5 = / 32 (bytes per field)
39
- const fieldReader = FieldReader.asReader(array);
40
- // Read fields until we hit zeros at the end
41
- while(!fieldReader.isFinished()){
42
- const currentField = fieldReader.peekField();
43
- // Stop when we hit a zero field
44
- if (!currentField || currentField.isZero()) {
45
- break;
46
- }
47
- // This comes before `getLengthFromFirstField` because an empty block doesn't have fields for the tx effect.
48
- if (isBlockEndMarker(currentField)) {
49
- // Include the block end marker in the result
50
- fieldReader.skip(1);
51
- break;
52
- }
53
- // Skip the remaining fields in this transaction
54
- const len = getNumBlobFieldsFromTxStartMarker(currentField);
55
- fieldReader.skip(len);
15
+ */ export function deserializeEncodedBlobToFields(buf, checkEncoding = false) {
16
+ const reader = BufferReader.asReader(buf);
17
+ const firstField = reader.readObject(Fr);
18
+ // Use toBigInt instead of toNumber so that we can catch it and throw a more descriptive error below if the first
19
+ // field is larger than a javascript integer.
20
+ const numFields = firstField.toBigInt();
21
+ const totalFieldsInBuffer = BigInt(buf.length / Fr.SIZE_IN_BYTES);
22
+ if (numFields > totalFieldsInBuffer) {
23
+ throw new BlobDeserializationError(`Failed to deserialize blob fields, this blob was likely not created by us`);
56
24
  }
57
- // Return array up to last non-zero field
58
- return array.slice(0, fieldReader.cursor);
59
- }
60
- /**
61
- * Extract the fields from a blob buffer, but do not take into account encoding
62
- * that will include trailing zeros.
63
- *
64
- * +------------------+------------------+------------------+------------------+
65
- * | | | | Padded zeros |
66
- * | [3 a,b,c] | [3, a, b, c] | [5 d,e,f,0,0] | [0, 0, 0, .., 0] |
67
- * +------------------+------------------+------------------+------------------+
68
- * ^
69
- * |
70
- * Function reads until here ----------------------
71
- */ export function extractBlobFieldsFromBuffer(blob) {
72
- const reader = BufferReader.asReader(blob);
73
- const array = reader.readArray(blob.length >> 5, Fr);
74
- // Find the index of the last non-zero field
75
- let lastNonZeroIndex = array.length - 1;
76
- while(lastNonZeroIndex >= 0 && array[lastNonZeroIndex].isZero()){
77
- lastNonZeroIndex--;
25
+ const numFieldsWithoutPrefix = Number(numFields) - 1;
26
+ const blobFields = [
27
+ firstField
28
+ ].concat(reader.readArray(numFieldsWithoutPrefix, Fr));
29
+ if (checkEncoding && !checkBlobFieldsEncoding(blobFields)) {
30
+ throw new BlobDeserializationError(`Incorrect encoding of blob fields, this blob was likely not created by us`);
78
31
  }
79
- // Return the trimmed array
80
- return array.slice(0, lastNonZeroIndex + 1);
32
+ return blobFields;
81
33
  }
@@ -18,4 +18,9 @@ export declare function isValidTxStartMarker(txStartMarker: TxStartMarker): bool
18
18
  export declare function createBlockEndMarker(numTxs: number): Fr;
19
19
  export declare function getNumTxsFromBlockEndMarker(field: Fr): number;
20
20
  export declare function isBlockEndMarker(field: Fr): boolean;
21
+ /**
22
+ * Check that the fields are emitted from the circuits and conform to the encoding.
23
+ * @param blobFields - The concatenated fields from all blobs of an L1 block.
24
+ */
25
+ export declare function checkBlobFieldsEncoding(blobFields: Fr[]): boolean;
21
26
  //# sourceMappingURL=encoding.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAY9C,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAA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,CAAC,KAAK,EAAE,EAAE,UAE1D;AAED,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,aAAa,WAEhE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,MAGlD;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,EAAE,UAEpD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,EAAE,WAIzC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,EAAE,EAAE,WAsCvD"}
package/dest/encoding.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { BLOCK_END_PREFIX, TX_START_PREFIX } from '@aztec/constants';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
+ import { FieldReader } from '@aztec/foundation/serialize';
3
4
  const NUM_BLOB_FIELDS_BIT_SIZE = 32n;
4
5
  const REVERT_CODE_BIT_SIZE = 8n;
5
6
  const NUM_NOTE_HASH_BIT_SIZE = 16n;
@@ -86,3 +87,37 @@ export function isBlockEndMarker(field) {
86
87
  const numTxs = value & 0xffffn;
87
88
  return value - numTxs === BLOCK_END_PREFIX * 256n * 256n;
88
89
  }
90
+ /**
91
+ * Check that the fields are emitted from the circuits and conform to the encoding.
92
+ * @param blobFields - The concatenated fields from all blobs of an L1 block.
93
+ */ export function checkBlobFieldsEncoding(blobFields) {
94
+ const reader = FieldReader.asReader(blobFields);
95
+ const checkpointPrefix = reader.readField();
96
+ if (checkpointPrefix.toBigInt() !== BigInt(blobFields.length)) {
97
+ return false;
98
+ }
99
+ const numFieldsInCheckpoint = checkpointPrefix.toNumber();
100
+ let seenNumTxs = 0;
101
+ while(reader.cursor < numFieldsInCheckpoint){
102
+ const currentField = reader.readField();
103
+ if (isBlockEndMarker(currentField)) {
104
+ // Found a block end marker. Confirm that the number of txs in this block is correct.
105
+ const numTxs = getNumTxsFromBlockEndMarker(currentField);
106
+ if (numTxs !== seenNumTxs) {
107
+ return false;
108
+ }
109
+ seenNumTxs = 0;
110
+ continue;
111
+ }
112
+ // If the field is not a block end marker, it must be a tx start marker.
113
+ const txStartMarker = decodeTxStartMarker(currentField);
114
+ if (!isValidTxStartMarker(txStartMarker)) {
115
+ return false;
116
+ }
117
+ seenNumTxs += 1;
118
+ // Skip the remaining fields in this tx. -1 because we already read the tx start marker.
119
+ reader.skip(txStartMarker.numBlobFields - 1);
120
+ // TODO: Check the encoding of the tx if we want to be more strict.
121
+ }
122
+ return true;
123
+ }
package/dest/hash.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ import { BLS12Fr, Fr } from '@aztec/foundation/fields';
2
+ /**
3
+ * Returns ethereum's versioned blob hash, following kzg_to_versioned_hash: https://eips.ethereum.org/EIPS/eip-4844#helpers
4
+ */
5
+ export declare function computeEthVersionedBlobHash(commitment: Buffer): Buffer;
6
+ export declare function computeBlobsHash(evmVersionedBlobHashes: Buffer[]): Fr;
7
+ /**
8
+ * The hash of the fields added throughout the checkpoint. The exact number of fields is specified by the checkpoint
9
+ * prefix (the first field). It's verified in the circuit against the fields absorbed into the sponge blob.
10
+ * This hash is used in generating the challenge z for all blobs in the same checkpoint.
11
+ */
12
+ export declare function computeBlobFieldsHash(fields: Fr[]): Promise<Fr>;
13
+ export declare function computeBlobCommitment(data: Uint8Array): Buffer;
14
+ /**
15
+ * Get the commitment fields of the blob, to compute the challenge z.
16
+ *
17
+ * The 48-byte commitment is encoded into two field elements:
18
+ * +-------------------+------------------------+
19
+ * | 31 bytes | 17 bytes |
20
+ * +-------------------+------------------------+
21
+ * | Field Element 1 | Field Element 2 |
22
+ * | [0][bytes 0-30] | [0...0][bytes 31-47] |
23
+ * +-------------------+------------------------+
24
+ *
25
+ * @param commitment - The commitment to convert to fields. Computed from `computeBlobCommitment`.
26
+ * @returns The fields representing the commitment buffer.
27
+ */
28
+ export declare function commitmentToFields(commitment: Buffer): [Fr, Fr];
29
+ export declare function computeChallengeZ(blobFieldsHash: Fr, commitment: Buffer): Promise<Fr>;
30
+ /**
31
+ * Hash each u128 limb of the noir bignum struct representing the BLS field, to mimic the hash accumulation in the
32
+ * rollup circuits.
33
+ */
34
+ export declare function hashNoirBigNumLimbs(field: BLS12Fr): Promise<Fr>;
35
+ //# sourceMappingURL=hash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../src/hash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAMvD;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAItE;AAOD,wBAAgB,gBAAgB,CAAC,sBAAsB,EAAE,MAAM,EAAE,GAAG,EAAE,CAErE;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAErE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAM/D;AAED,wBAAsB,iBAAiB,CAAC,cAAc,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC,CAG3F;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,EAAE,CAAC,CAGrE"}
package/dest/hash.js ADDED
@@ -0,0 +1,69 @@
1
+ import { poseidon2Hash, sha256, sha256ToField } from '@aztec/foundation/crypto';
2
+ import { Fr } from '@aztec/foundation/fields';
3
+ import { BYTES_PER_BLOB, BYTES_PER_COMMITMENT, kzg } from './kzg_context.js';
4
+ const VERSIONED_HASH_VERSION_KZG = 0x01;
5
+ /**
6
+ * Returns ethereum's versioned blob hash, following kzg_to_versioned_hash: https://eips.ethereum.org/EIPS/eip-4844#helpers
7
+ */ export function computeEthVersionedBlobHash(commitment) {
8
+ const hash = sha256(commitment);
9
+ hash[0] = VERSIONED_HASH_VERSION_KZG;
10
+ return hash;
11
+ }
12
+ // TODO(#13430): The blobsHash is confusingly similar to blobCommitmentsHash, calculated from below blobCommitments:
13
+ // - blobsHash := sha256([blobhash_0, ..., blobhash_m]) = a hash of all blob hashes in a block with m+1 blobs inserted into the header, exists so a user can cross check blobs.
14
+ // - blobCommitmentsHash := sha256( ...sha256(sha256(C_0), C_1) ... C_n) = iteratively calculated hash of all blob commitments in an epoch with n+1 blobs (see calculateBlobCommitmentsHash()),
15
+ // exists so we can validate injected commitments to the rollup circuits correspond to the correct real blobs.
16
+ // We may be able to combine these values e.g. blobCommitmentsHash := sha256( ...sha256(sha256(blobshash_0), blobshash_1) ... blobshash_l) for an epoch with l+1 blocks.
17
+ export function computeBlobsHash(evmVersionedBlobHashes) {
18
+ return sha256ToField(evmVersionedBlobHashes);
19
+ }
20
+ /**
21
+ * The hash of the fields added throughout the checkpoint. The exact number of fields is specified by the checkpoint
22
+ * prefix (the first field). It's verified in the circuit against the fields absorbed into the sponge blob.
23
+ * This hash is used in generating the challenge z for all blobs in the same checkpoint.
24
+ */ export async function computeBlobFieldsHash(fields) {
25
+ return await poseidon2Hash(fields);
26
+ }
27
+ export function computeBlobCommitment(data) {
28
+ if (data.length !== BYTES_PER_BLOB) {
29
+ throw new Error(`Expected ${BYTES_PER_BLOB} bytes per blob. Got ${data.length}.`);
30
+ }
31
+ return Buffer.from(kzg.blobToKzgCommitment(data));
32
+ }
33
+ /**
34
+ * Get the commitment fields of the blob, to compute the challenge z.
35
+ *
36
+ * The 48-byte commitment is encoded into two field elements:
37
+ * +-------------------+------------------------+
38
+ * | 31 bytes | 17 bytes |
39
+ * +-------------------+------------------------+
40
+ * | Field Element 1 | Field Element 2 |
41
+ * | [0][bytes 0-30] | [0...0][bytes 31-47] |
42
+ * +-------------------+------------------------+
43
+ *
44
+ * @param commitment - The commitment to convert to fields. Computed from `computeBlobCommitment`.
45
+ * @returns The fields representing the commitment buffer.
46
+ */ export function commitmentToFields(commitment) {
47
+ if (commitment.length !== BYTES_PER_COMMITMENT) {
48
+ throw new Error(`Expected ${BYTES_PER_COMMITMENT} bytes for blob commitment. Got ${commitment.length}.`);
49
+ }
50
+ return [
51
+ new Fr(commitment.subarray(0, 31)),
52
+ new Fr(commitment.subarray(31, BYTES_PER_COMMITMENT))
53
+ ];
54
+ }
55
+ export async function computeChallengeZ(blobFieldsHash, commitment) {
56
+ const commitmentFields = commitmentToFields(commitment);
57
+ return await poseidon2Hash([
58
+ blobFieldsHash,
59
+ commitmentFields[0],
60
+ commitmentFields[1]
61
+ ]);
62
+ }
63
+ /**
64
+ * Hash each u128 limb of the noir bignum struct representing the BLS field, to mimic the hash accumulation in the
65
+ * rollup circuits.
66
+ */ export async function hashNoirBigNumLimbs(field) {
67
+ const num = field.toNoirBigNum();
68
+ return await poseidon2Hash(num.limbs.map(Fr.fromHexString));
69
+ }
package/dest/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  export * from './blob.js';
2
2
  export * from './blob_batching.js';
3
+ export * from './blob_utils.js';
4
+ export * from './circuit_types/index.js';
3
5
  export * from './deserialize.js';
4
6
  export * from './encoding.js';
5
- export * from './interface.js';
6
7
  export * from './errors.js';
7
- export * from './blob_batching_public_inputs.js';
8
+ export * from './hash.js';
9
+ export * from './interface.js';
8
10
  export * from './sponge_blob.js';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
package/dest/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  export * from './blob.js';
2
2
  export * from './blob_batching.js';
3
+ export * from './blob_utils.js';
4
+ export * from './circuit_types/index.js';
3
5
  export * from './deserialize.js';
4
6
  export * from './encoding.js';
5
- export * from './interface.js';
6
7
  export * from './errors.js';
7
- export * from './blob_batching_public_inputs.js';
8
+ export * from './hash.js';
9
+ export * from './interface.js';
8
10
  export * from './sponge_blob.js';
@@ -2,23 +2,23 @@ import { type FieldsOf } from '@aztec/foundation/array';
2
2
  import { Fr } from '@aztec/foundation/fields';
3
3
  import { BufferReader, FieldReader, type Tuple } from '@aztec/foundation/serialize';
4
4
  /**
5
- * A Poseidon2 sponge used to accumulate data that will be added to a blob.
5
+ * A Poseidon2 sponge used to accumulate data that will be added to blobs.
6
6
  * See noir-projects/noir-protocol-circuits/crates/types/src/abis/sponge_blob.nr.
7
7
  */
8
8
  export declare class SpongeBlob {
9
- /** Sponge with absorbed tx effects that will go into a blob. */
9
+ /** Sponge with absorbed fields that will go into one or more blobs. */
10
10
  readonly sponge: Poseidon2Sponge;
11
11
  /** Number of effects absorbed so far. */
12
- fields: number;
12
+ numAbsorbedFields: number;
13
13
  /** Number of effects that will be absorbed. */
14
- readonly expectedFields: number;
14
+ readonly numExpectedFields: number;
15
15
  constructor(
16
- /** Sponge with absorbed tx effects that will go into a blob. */
16
+ /** Sponge with absorbed fields that will go into one or more blobs. */
17
17
  sponge: Poseidon2Sponge,
18
18
  /** Number of effects absorbed so far. */
19
- fields: number,
19
+ numAbsorbedFields: number,
20
20
  /** Number of effects that will be absorbed. */
21
- expectedFields: number);
21
+ numExpectedFields: number);
22
22
  static fromBuffer(buffer: Buffer | BufferReader): SpongeBlob;
23
23
  toBuffer(): Buffer<ArrayBufferLike>;
24
24
  static getFields(fields: FieldsOf<SpongeBlob>): (number | Poseidon2Sponge)[];
@@ -28,7 +28,11 @@ export declare class SpongeBlob {
28
28
  absorb(fields: Fr[]): Promise<void>;
29
29
  squeeze(): Promise<Fr>;
30
30
  static empty(): SpongeBlob;
31
- static init(expectedFields: number): SpongeBlob;
31
+ /**
32
+ * Initialize the sponge blob with the number of expected fields in the checkpoint and absorb it as the first field.
33
+ * Note: `numExpectedFields` includes the first field absorbed in this method.
34
+ */
35
+ static init(numExpectedFields: number): Promise<SpongeBlob>;
32
36
  }
33
37
  export declare class Poseidon2Sponge {
34
38
  cache: Tuple<Fr, 3>;
@@ -42,7 +46,7 @@ export declare class Poseidon2Sponge {
42
46
  toFields(): Fr[];
43
47
  static fromFields(fields: Fr[] | FieldReader): Poseidon2Sponge;
44
48
  static empty(): Poseidon2Sponge;
45
- static init(expectedFields: number): Poseidon2Sponge;
49
+ static init(numExpectedFields: number): Poseidon2Sponge;
46
50
  performDuplex(): Promise<void>;
47
51
  absorb(fields: Fr[]): Promise<void>;
48
52
  squeeze(): Promise<Fr>;
@@ -1 +1 @@
1
- {"version":3,"file":"sponge_blob.d.ts","sourceRoot":"","sources":["../src/sponge_blob.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,WAAW,EACX,KAAK,KAAK,EAGX,MAAM,6BAA6B,CAAC;AAErC;;;GAGG;AACH,qBAAa,UAAU;IAEnB,gEAAgE;aAChD,MAAM,EAAE,eAAe;IACvC,yCAAyC;IAClC,MAAM,EAAE,MAAM;IACrB,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E;AAGD,qBAAa,eAAe;IAEjB,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACnB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,OAAO;gBAHpB,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EACnB,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,OAAO;IAG7B,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,eAAe;IAUjE,QAAQ;IAIR,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC;IAIlD,QAAQ,IAAI,EAAE,EAAE;IAIhB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,eAAe;IAU9D,MAAM,CAAC,KAAK,IAAI,eAAe;IAS/B,MAAM,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,eAAe;IAUjD,aAAa;IAWb,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE;IAenB,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC;CAQ7B"}
@@ -1,31 +1,32 @@
1
+ import { TWO_POW_64 } from '@aztec/constants';
1
2
  import { makeTuple } from '@aztec/foundation/array';
2
3
  import { poseidon2Permutation } from '@aztec/foundation/crypto';
3
4
  import { Fr } from '@aztec/foundation/fields';
4
5
  import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
5
6
  /**
6
- * A Poseidon2 sponge used to accumulate data that will be added to a blob.
7
+ * A Poseidon2 sponge used to accumulate data that will be added to blobs.
7
8
  * See noir-projects/noir-protocol-circuits/crates/types/src/abis/sponge_blob.nr.
8
9
  */ export class SpongeBlob {
9
10
  sponge;
10
- fields;
11
- expectedFields;
12
- constructor(/** Sponge with absorbed tx effects that will go into a blob. */ sponge, /** Number of effects absorbed so far. */ fields, /** Number of effects that will be absorbed. */ expectedFields){
11
+ numAbsorbedFields;
12
+ numExpectedFields;
13
+ constructor(/** Sponge with absorbed fields that will go into one or more blobs. */ sponge, /** Number of effects absorbed so far. */ numAbsorbedFields, /** Number of effects that will be absorbed. */ numExpectedFields){
13
14
  this.sponge = sponge;
14
- this.fields = fields;
15
- this.expectedFields = expectedFields;
15
+ this.numAbsorbedFields = numAbsorbedFields;
16
+ this.numExpectedFields = numExpectedFields;
16
17
  }
17
18
  static fromBuffer(buffer) {
18
19
  const reader = BufferReader.asReader(buffer);
19
20
  return new SpongeBlob(reader.readObject(Poseidon2Sponge), reader.readNumber(), reader.readNumber());
20
21
  }
21
22
  toBuffer() {
22
- return serializeToBuffer(this.sponge, this.fields, this.expectedFields);
23
+ return serializeToBuffer(...SpongeBlob.getFields(this));
23
24
  }
24
25
  static getFields(fields) {
25
26
  return [
26
27
  fields.sponge,
27
- fields.fields,
28
- fields.expectedFields
28
+ fields.numAbsorbedFields,
29
+ fields.numExpectedFields
29
30
  ];
30
31
  }
31
32
  toFields() {
@@ -39,16 +40,16 @@ import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from
39
40
  return SpongeBlob.fromBuffer(this.toBuffer());
40
41
  }
41
42
  async absorb(fields) {
42
- if (this.fields + fields.length > this.expectedFields) {
43
- throw new Error(`Attempted to fill spongeblob with ${this.fields + fields.length}, but it has a max of ${this.expectedFields}`);
43
+ if (this.numAbsorbedFields + fields.length > this.numExpectedFields) {
44
+ throw new Error(`Attempted to fill spongeBlob with ${this.numAbsorbedFields + fields.length}, but it has a max of ${this.numExpectedFields}`);
44
45
  }
45
46
  await this.sponge.absorb(fields);
46
- this.fields += fields.length;
47
+ this.numAbsorbedFields += fields.length;
47
48
  }
48
49
  async squeeze() {
49
50
  // If the blob sponge is not 'full', we append 1 to match Poseidon2::hash_internal()
50
51
  // NB: There is currently no use case in which we don't 'fill' a blob sponge, but adding for completeness
51
- if (this.fields != this.expectedFields) {
52
+ if (this.numAbsorbedFields != this.numExpectedFields) {
52
53
  await this.sponge.absorb([
53
54
  Fr.ONE
54
55
  ]);
@@ -58,8 +59,18 @@ import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from
58
59
  static empty() {
59
60
  return new SpongeBlob(Poseidon2Sponge.empty(), 0, 0);
60
61
  }
61
- static init(expectedFields) {
62
- return new SpongeBlob(Poseidon2Sponge.init(expectedFields), 0, expectedFields);
62
+ /**
63
+ * Initialize the sponge blob with the number of expected fields in the checkpoint and absorb it as the first field.
64
+ * Note: `numExpectedFields` includes the first field absorbed in this method.
65
+ */ static async init(numExpectedFields) {
66
+ // This must match what the checkpoint root rollup circuit expects.
67
+ // See noir-projects/noir-protocol-circuits/types/src/abis/sponge_blob.nr -> init_for_checkpoint.
68
+ const sponge = Poseidon2Sponge.init(numExpectedFields);
69
+ await sponge.absorb([
70
+ new Fr(numExpectedFields)
71
+ ]);
72
+ const numAbsorbedFields = 1;
73
+ return new SpongeBlob(sponge, numAbsorbedFields, numExpectedFields);
63
74
  }
64
75
  }
65
76
  // This is just noir's stdlib version of the poseidon2 sponge. We use it for a blob-specific implmentation of the hasher.
@@ -99,8 +110,8 @@ export class Poseidon2Sponge {
99
110
  static empty() {
100
111
  return new Poseidon2Sponge(makeTuple(3, ()=>Fr.ZERO), makeTuple(4, ()=>Fr.ZERO), 0, false);
101
112
  }
102
- static init(expectedFields) {
103
- const iv = new Fr(expectedFields).mul(new Fr(BigInt('18446744073709551616')));
113
+ static init(numExpectedFields) {
114
+ const iv = new Fr(numExpectedFields).mul(new Fr(TWO_POW_64));
104
115
  const sponge = Poseidon2Sponge.empty();
105
116
  sponge.state[3] = iv;
106
117
  return sponge;
package/dest/testing.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { Fr } from '@aztec/foundation/fields';
1
2
  import { Blob } from './blob.js';
2
3
  import { BatchedBlobAccumulator } from './blob_batching.js';
3
4
  import { SpongeBlob } from './sponge_blob.js';
@@ -15,6 +16,9 @@ export declare function makeSpongeBlob(seed?: number): SpongeBlob;
15
16
  * @returns A blob accumulator instance.
16
17
  */
17
18
  export declare function makeBatchedBlobAccumulator(seed?: number): BatchedBlobAccumulator;
19
+ export declare function makeEncodedTxBlobFields(length: number): Fr[];
20
+ export declare function makeEncodedBlockBlobFields(...lengths: number[]): Fr[];
21
+ export declare function makeEncodedBlobFields(length: number): Fr[];
18
22
  /**
19
23
  * Make an encoded blob with the given length
20
24
  *
@@ -22,7 +26,8 @@ export declare function makeBatchedBlobAccumulator(seed?: number): BatchedBlobAc
22
26
  * @param length
23
27
  * @returns
24
28
  */
25
- export declare function makeEncodedBlob(length: number): Promise<Blob>;
29
+ export declare function makeEncodedBlob(length: number): Blob;
30
+ export declare function makeEncodedBlobs(length: number): Blob[];
26
31
  /**
27
32
  * Make a blob with random fields.
28
33
  *
@@ -30,5 +35,5 @@ export declare function makeEncodedBlob(length: number): Promise<Blob>;
30
35
  * @param length
31
36
  * @returns
32
37
  */
33
- export declare function makeRandomBlob(length: number): Promise<Blob>;
38
+ export declare function makeRandomBlob(length: number): Blob;
34
39
  //# sourceMappingURL=testing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,oBAAoB,CAAC;AAEzF,OAAO,EAAmB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,SAAI,GAAG,UAAU,CAWnD;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,SAAI,GAAG,sBAAsB,CAW3E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA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