Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KZG Initialization Refactor #6

Merged
merged 10 commits into from
Mar 14, 2024
Merged

KZG Initialization Refactor #6

merged 10 commits into from
Mar 14, 2024

Conversation

holgerd77
Copy link
Member

Small refactor in preparation for a simplified KZG initialization on the EthereumJS side as discussed in the chat.

@acolytec3
Copy link
Collaborator

Have revised this slightly as follows:

  • Removed setup path from loadKZG
  • Added optional param to loadTrustedSetup with trusted setup dictionary type
  • Loads mainnet trusted setup if alternative not provided

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. WIll merge once @g11tech approves

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated
/**
*
* @param blob - a blob of data formatted as a Uint8Array of 4096 bytes
* @returns a KZG commitment corresponding to the input blob formatted as a 32 byte Uint8Array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @returns a KZG commitment corresponding to the input blob formatted as a 32 byte Uint8Array
* @returns a KZG commitment corresponding to the input blob formatted as a 48 byte Uint8Array

commitment is 48 bytes

Co-authored-by: g11tech <develop@g11tech.io>
src/index.ts Outdated
const blobToKzgCommitment = (blob: Uint8Array) => {
const blobHex = '0x' + blobToKzgCommitmentWasm(blob)
return hexToBytes(blobHex)
}

/**
*
* @param blob - a blob of data formatted as a Uint8Array of 4096 bytes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again correction needed for what is blob and size

src/index.ts Outdated
/**
*
* @param blob - a blob of data formatted as a Uint8Array of 4096 bytes
* @param commitment - a KZG commitment corresponding to a blob formatted as a 32 byte Uint8Array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param commitment - a KZG commitment corresponding to a blob formatted as a 32 byte Uint8Array
* @param commitment - a KZG commitment corresponding to a blob formatted as a 48 byte Uint8Array

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have also updated the changelog and release so we can push an update on NPM.

@acolytec3 acolytec3 merged commit 52c7768 into master Mar 14, 2024
2 checks passed
@holgerd77 holgerd77 deleted the kzg-init-refactor branch March 15, 2024 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants