Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,211 changes: 0 additions & 2,211 deletions stealthdrop/bun.lock

This file was deleted.

Binary file added stealthdrop/bun.lockb
Binary file not shown.
10 changes: 4 additions & 6 deletions stealthdrop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"gen": "bun run utils/generateAddresses.ts"
},
"dependencies": {
"@aztec/bb.js": "0.67.0",
"@aztec/bb.js": "0.72.1",
"@noir-lang/noir_js": "1.0.0-beta.3",
"@nomicfoundation/hardhat-network-helpers": "1.0.12",
"@nomicfoundation/hardhat-toolbox-viem": "3.0.0",
"@nomicfoundation/hardhat-viem": "2.0.6",
Expand All @@ -26,7 +27,8 @@
"react": "^18.2.0",
"solidity-coverage": "^0.8.1",
"ts-node": "^10.9.1",
"viem": "^2.23.2"
"viem": "^2.23.2",
"@signorecello/plume-sig": "2.0.11"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.2",
Expand All @@ -38,15 +40,11 @@
"ethers": "^5.4.7",
"typescript": "^5.0.0"
},
"resolutions": {
"@aztec/bb.js": "0.67.0"
},
"trustedDependencies": [
"@swc/core",
"bufferutil",
"esbuild",
"keccak",
"plume-sig",
"secp256k1",
"sharp",
"utf-8-validate"
Expand Down
10 changes: 1 addition & 9 deletions stealthdrop/packages/ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"deploy": "hardhat vars set holesky ${DEPLOYER_PK} && hardhat deploy --network holesky"
},
"dependencies": {
"@aztec/bb.js": "0.67.0",
"@noir-lang/noir_js": "1.0.0-beta.1",
"@nomicfoundation/hardhat-toolbox-viem": "^3.0.0",
"@zk-kit/lean-imt": "^2.2.2",
"hardhat": "^2.18.1",
Expand All @@ -19,11 +17,5 @@
"devDependencies": {
"chai": "^4.3.10",
"typescript": "^5.0.0"
},
"resolutions": {
"@aztec/bb.js": "0.67.0"
},
"trustedDependencies": [
"plume-sig"
]
}
}
4 changes: 2 additions & 2 deletions stealthdrop/packages/ethereum/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ProofData } from '@noir-lang/types';
import { expect } from 'chai';
import pkg from '../../const.cts';
const { MESSAGE_TO_HASH } = pkg;
import { computeAllInputs } from 'plume-sig';
import { curves } from '@signorecello/plume-sig';
import { HardhatNetworkHDAccountsConfig } from 'hardhat/types';

const bbSync = await BarretenbergSync.new();
Expand Down Expand Up @@ -126,7 +126,7 @@ const getClaimInputs = async ({
// message to hash is above
const messageBytes = MESSAGE_TO_HASH.split('').map((s, i) => MESSAGE_TO_HASH.charCodeAt(i));
const privateKey = userAccount!.getHdKey().privateKey!;
const plume = await computeAllInputs(Uint8Array.from(messageBytes), privateKey);
const plume = await curves.secp256k1.computeAllInputs(Uint8Array.from(messageBytes), privateKey);

const proof = merkleTree.generateProof(index);
const pubKey = userAccount!.publicKey.slice(2);
Expand Down
3 changes: 2 additions & 1 deletion stealthdrop/packages/hardhat.config.cts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const config: HardhatUserConfig = {
noir: './noir',
},
noir: {
version: '1.0.0-beta.1',
version: '1.0.0-beta.3',
bbVersion: '0.72.1',
},
mocha: {
timeout: 1000000,
Expand Down
8 changes: 2 additions & 6 deletions stealthdrop/packages/noir/Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ authors = [""]
[dependencies]
trees = { git = "https://github.com/privacy-scaling-explorations/zk-kit.noir", tag = "main", directory = "packages/merkle-trees" }
ecrecover = { tag = "main", git = "https://github.com/colinnielsen/ecrecover-noir" }
# plume = { tag = "main", git = "https://github.com/signorecello/zk-nullifier-sig", directory = "circuits/noir/plume" }
noir_bigcurve = { tag = "zkpedro/for_plume", git = "https://github.com/noir-lang/noir_bigcurve" }
bignum = { tag = "main", git = "https://github.com/noir-lang/noir-bignum" }
nodash = { tag = "main", git = "https://github.com/olehmisar/nodash" }

plume = { path = "../../../zk-nullifier-sig/circuits/noir" }
plume = { tag = "main", git = "https://github.com/signorecello/zk-nullifier-sig", directory = "circuits/noir" }
noir_bigcurve = { tag = "v0.6.0", git = "https://github.com/noir-lang/noir_bigcurve" }
17 changes: 12 additions & 5 deletions stealthdrop/packages/noir/src/main.nr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use ecrecover::secp256k1::PubKey;
use noir_bigcurve::curves::secp256k1::{Secp256k1, Secp256k1Fq, Secp256k1Scalar};
use noir_bigcurve::scalar_field::ScalarField;

// use plume::plume_v2;
use plume::curves::secp256k1::hash_to_curve;
use plume::Plume;
use plume::PlumeVerifier;
use std::hash::poseidon2::Poseidon2::hash;
use trees::merkle::MerkleTree;
use trees::types::{MembershipProver, MT_Creator};

type BN = Secp256k1Fq;
global DEPTH: u32 = 12;

fn hasher(leaves: [Field; 2]) -> Field {
Expand All @@ -17,7 +17,7 @@ fn hasher(leaves: [Field; 2]) -> Field {
fn main(
pub_key_x: [u8; 32],
pub_key_y: [u8; 32],
message: pub [u8; 8], // signthis
message: pub [u8; 8],
c: [u8; 32],
s: [u8; 32],
nullifier_x: pub [u8; 32],
Expand Down Expand Up @@ -45,7 +45,14 @@ fn main(
is_infinity: false,
};

let plume = Plume::new(message, scalar_c, scalar_s, pubkey_bg, nullifier);
let plume = Plume::new(
message,
scalar_c,
scalar_s,
pubkey_bg,
nullifier,
hash_to_curve,
);

let (_, _) = plume.plume_v2();
let pubkey = PubKey::from_xy(pub_key_x, pub_key_y);
Expand Down
2 changes: 1 addition & 1 deletion stealthdrop/packages/noir/target/stealthdrop.json

Large diffs are not rendered by default.

Loading