@aztec/blob-lib 2.0.3 → 2.1.0-rc.10
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/blob.d.ts +1 -0
- package/dest/blob.d.ts.map +1 -1
- package/dest/blob.js +2 -1
- package/dest/index.js +1 -1
- package/dest/types.d.ts +14 -0
- package/dest/types.d.ts.map +1 -0
- package/dest/types.js +1 -0
- package/package.json +5 -4
- package/src/blob.ts +1 -0
- package/src/index.ts +1 -1
- package/src/types.ts +16 -0
package/dest/blob.d.ts
CHANGED
|
@@ -153,6 +153,7 @@ export declare class Blob {
|
|
|
153
153
|
static getViemKzgInstance(): {
|
|
154
154
|
blobToKzgCommitment: typeof cKzg.blobToKzgCommitment;
|
|
155
155
|
computeBlobKzgProof: typeof cKzg.computeBlobKzgProof;
|
|
156
|
+
computeCellsAndKzgProofs: typeof cKzg.computeCellsAndKzgProofs;
|
|
156
157
|
};
|
|
157
158
|
/**
|
|
158
159
|
* @param fields - Fields to broadcast in the blob(s)
|
package/dest/blob.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blob.d.ts","sourceRoot":"","sources":["../src/blob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,IAAI,MAAM,OAAO,CAAC;AACzB,OAAO,KAAK,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAK/C,eAAO,MAAM,0BAA0B,IAAO,CAAC;AAE/C;;GAEG;AACH,qBAAa,IAAI;IAEb,oDAAoD;aACpC,IAAI,EAAE,UAAU;IAChC,6IAA6I;aAC7H,UAAU,EAAE,EAAE;IAC9B,0JAA0J;aAC1I,UAAU,EAAE,EAAE;IAC9B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M,GAAG,QAAQ;IAS/B;;;;;;OAMG;IACH,QAAQ,IAAI,EAAE,EAAE;IAIhB;;;;;;;;OAQG;IACH,eAAe,IAAI,EAAE,EAAE;IAUvB;;;;;;OAMG;IACH,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;IAU3C;;;;;;;;;;;OAWG;IACH,kBAAkB,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;IAK9B,uBAAuB,IAAI,MAAM;IAMjC,MAAM,CAAC,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAM1D;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,EAAE;;;;IAWxB;;;;;;OAMG;IACH,QAAQ,IAAI,MAAM;IAalB;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAKnD;;OAEG;IACH,OAAO;IAIP;;;;;OAKG;IACH,MAAM,CAAC,6BAA6B,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,MAAM,EAAE;IAYlE,MAAM,CAAC,kBAAkB;;;;;IAQzB;;;;OAIG;WACU,gBAAgB,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAU7D"}
|
package/dest/blob.js
CHANGED
|
@@ -231,7 +231,8 @@ export const VERSIONED_HASH_VERSION_KZG = 0x01;
|
|
|
231
231
|
static getViemKzgInstance() {
|
|
232
232
|
return {
|
|
233
233
|
blobToKzgCommitment: cKzg.blobToKzgCommitment,
|
|
234
|
-
computeBlobKzgProof: cKzg.computeBlobKzgProof
|
|
234
|
+
computeBlobKzgProof: cKzg.computeBlobKzgProof,
|
|
235
|
+
computeCellsAndKzgProofs: cKzg.computeCellsAndKzgProofs
|
|
235
236
|
};
|
|
236
237
|
}
|
|
237
238
|
/**
|
package/dest/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export * from './errors.js';
|
|
|
8
8
|
export * from './blob_batching_public_inputs.js';
|
|
9
9
|
export * from './sponge_blob.js';
|
|
10
10
|
try {
|
|
11
|
-
loadTrustedSetup();
|
|
11
|
+
loadTrustedSetup(8); // See https://notes.ethereum.org/@jtraglia/windowed_multiplications
|
|
12
12
|
} catch (error) {
|
|
13
13
|
if (error.message.includes('trusted setup is already loaded')) {
|
|
14
14
|
// NB: The c-kzg lib has no way of checking whether the setup is loaded or not,
|
package/dest/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './sponge_blob.js';
|
|
2
|
+
/**
|
|
3
|
+
* Type definition for the KZG instance returned by Blob.getViemKzgInstance().
|
|
4
|
+
* Contains the cryptographic functions needed for blob commitment and proof generation.
|
|
5
|
+
*/
|
|
6
|
+
export interface BlobKzgInstance {
|
|
7
|
+
/** Function to compute KZG commitment from blob data */
|
|
8
|
+
blobToKzgCommitment(blob: Uint8Array): Uint8Array;
|
|
9
|
+
/** Function to compute KZG proof for blob data */
|
|
10
|
+
computeBlobKzgProof(blob: Uint8Array, commitment: Uint8Array): Uint8Array;
|
|
11
|
+
/** Function to compute both blob data cells and their corresponding KZG proofs for EIP7594 */
|
|
12
|
+
computeCellsAndKzgProofs(blob: Uint8Array): [Uint8Array[], Uint8Array[]];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AAIjC;;;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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sponge_blob.js';
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/blob-lib",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.1.0-rc.10",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
7
|
+
"./types": "./dest/types.js",
|
|
7
8
|
"./testing": "./dest/testing.js"
|
|
8
9
|
},
|
|
9
10
|
"typedocOptions": {
|
|
@@ -25,9 +26,9 @@
|
|
|
25
26
|
"../package.common.json"
|
|
26
27
|
],
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@aztec/constants": "2.0.
|
|
29
|
-
"@aztec/foundation": "2.0.
|
|
30
|
-
"c-kzg": "4.
|
|
29
|
+
"@aztec/constants": "2.1.0-rc.10",
|
|
30
|
+
"@aztec/foundation": "2.1.0-rc.10",
|
|
31
|
+
"c-kzg": "4.1.0",
|
|
31
32
|
"tslib": "^2.4.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
package/src/blob.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ export * from './blob_batching_public_inputs.js';
|
|
|
11
11
|
export * from './sponge_blob.js';
|
|
12
12
|
|
|
13
13
|
try {
|
|
14
|
-
loadTrustedSetup();
|
|
14
|
+
loadTrustedSetup(8); // See https://notes.ethereum.org/@jtraglia/windowed_multiplications
|
|
15
15
|
} catch (error: any) {
|
|
16
16
|
if (error.message.includes('trusted setup is already loaded')) {
|
|
17
17
|
// NB: The c-kzg lib has no way of checking whether the setup is loaded or not,
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './sponge_blob.js';
|
|
2
|
+
|
|
3
|
+
// TODO: Separate functions that use c-kzg from classes and export those classes here.
|
|
4
|
+
|
|
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
|
+
}
|