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

refactor(zk-kit-poseidon): remove old circomlib dependencies in crypto #943

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

ctrlc03
Copy link
Collaborator

@ctrlc03 ctrlc03 commented Dec 30, 2023

Description

This PR removes an old import (ciromlib) from the crypto library and instead imports the same functions from zk-kit. zk-kit provides lightweight TypeScript libraries for zk developers, allowing MACI's packages to be slimmer and more up to date.

Additional Notes

This is the first step into removing an old dependency, currently we still use it inside the circom circuits, and will be tackled in another PR.

@cedoor MACI 🤝 zk-kit

Related issue(s)

Re: #772

Additional Info

Let's merge #944 first

Confirmation

@ctrlc03 ctrlc03 added the dependencies Pull requests that update a dependency file label Dec 30, 2023
@ctrlc03 ctrlc03 added this to the MACI v1.1.1 refactor milestone Dec 30, 2023
@ctrlc03 ctrlc03 self-assigned this Dec 30, 2023
Copy link

netlify bot commented Dec 30, 2023

Deploy Preview for maci-typedoc ready!

Name Link
🔨 Latest commit 0340f79
🔍 Latest deploy log https://app.netlify.com/sites/maci-typedoc/deploys/6596d564df69510008b3dd4f
😎 Deploy Preview https://deploy-preview-943--maci-typedoc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ctrlc03 ctrlc03 force-pushed the deps/zk-kit-poseidon branch 8 times, most recently from 9694618 to fcfae59 Compare January 3, 2024 14:54
Copy link
Collaborator

@0xmad 0xmad left a comment

Choose a reason for hiding this comment

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

@ctrlc03 thanks, just one comment/question.

export type Ciphertext = bigint[];
// we define a bignumber as either a bigint or a string
// which is what we use the most in MACI
export type BigNumber = bigint | string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this type can have conflicts if it's using with BigNumber from ethers of from bignumber.js. Maybe it makes sense to reuse BigNumberish type from ethers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good shout, I can use that instead

Copy link
Collaborator Author

@ctrlc03 ctrlc03 Jan 3, 2024

Choose a reason for hiding this comment

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

@0xmad What do you think about simply changing the type name? so we don't import from ethers and make further changes to the code

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it works as well.

@ctrlc03 ctrlc03 force-pushed the deps/zk-kit-poseidon branch 2 times, most recently from 0930543 to b6e5508 Compare January 4, 2024 15:23
@ctrlc03 ctrlc03 force-pushed the deps/zk-kit-poseidon branch from b6e5508 to 0340f79 Compare January 4, 2024 15:57
@ctrlc03 ctrlc03 merged commit 74bec23 into dev Jan 4, 2024
12 checks passed
@ctrlc03 ctrlc03 deleted the deps/zk-kit-poseidon branch January 4, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants