Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Privacy-Cash/privacy-cash
/ functions
Functions
208 in github.com/Privacy-Cash/privacy-cash
⨍
Functions
208
◇
Types & classes
33
↓ 81 callers
Method
getCommitment
()
anchor/tests/lib/utxo.ts:57
↓ 69 callers
Function
getExtDataHash
(extData: { recipient: string | PublicKey; extAmount: string | number | BN; encryptedOutput1?: string |
anchor/tests/lib/utils.ts:36
↓ 67 callers
Function
createVersionedTransactionWithALT
( connection: Connection, payer: PublicKey, instructions: anchor.web3.TransactionInstruction[], altAdd
anchor/tests/lib/test_alt.ts:209
↓ 67 callers
Function
sendAndConfirmVersionedTransaction
( connection: Connection, transaction: VersionedTransaction, signers: Keypair[] )
anchor/tests/lib/test_alt.ts:245
↓ 59 callers
Method
getNullifier
()
anchor/tests/lib/utxo.ts:68
↓ 59 callers
Function
prove
* Generates a ZK proof using snarkjs and formats it for use on-chain * * @param input The circuit inputs to generate a proof for * @param keyBaseP
anchor/tests/lib/prover.ts:64
↓ 59 callers
Method
root
* Get tree root * @returns {*}
anchor/tests/lib/merkle_tree.ts:74
↓ 57 callers
Function
parseProofToBytesArray
( proof: Proof, compressed: boolean = false, )
anchor/tests/lib/prover.ts:170
↓ 57 callers
Function
parseToBytesArray
(publicSignals: string[])
anchor/tests/lib/prover.ts:241
↓ 49 callers
Method
insert
* Insert new element into the tree * @param element Element to insert
anchor/tests/lib/merkle_tree.ts:85
↓ 47 callers
Function
createGlobalTestALT
( connection: Connection, payer: Keypair, addresses: PublicKey[] )
anchor/tests/lib/test_alt.ts:29
↓ 34 callers
Function
createExtDataMinified
(extData: any)
anchor/tests/spl_tests.ts:82
↓ 33 callers
Function
createExtDataMinified
(extData: any)
anchor/tests/sol_tests.ts:78
↓ 33 callers
Function
findCrossCheckNullifierPDAs
(program: anchor.Program<any>, proof: any)
anchor/tests/spl_tests.ts:67
↓ 33 callers
Function
findCrossCheckNullifierPDAs
(program: anchor.Program<any>, proof: any)
anchor/tests/sol_tests.ts:63
↓ 33 callers
Function
findNullifierPDAs
(program: anchor.Program<any>, proof: any)
anchor/tests/spl_tests.ts:52
↓ 33 callers
Function
findNullifierPDAs
(program: anchor.Program<any>, proof: any)
anchor/tests/sol_tests.ts:48
↓ 33 callers
Function
getCreateTokenAccountInstructionIfNeeded
( connection: anchor.web3.Connection, payer: PublicKey, tokenAccountAddress: PublicKey, owner: PublicK
anchor/tests/spl_tests.ts:90
↓ 32 callers
Function
validate_fee
* Validates that the provided fee meets the minimum required fee based on global configuration. * * For deposits (ext_amount > 0): * - expected_fe
anchor/programs/zkcash/src/utils.rs:148
↓ 25 callers
Function
getTestProtocolAddressesWithMint
( programId: PublicKey, authority: PublicKey, treeAta: PublicKey, feeRecipient: PublicKey, feeRecipi
anchor/tests/lib/test_alt.ts:164
↓ 24 callers
Method
path
* Get merkle path to a leaf * @param {number} index Leaf index to generate path for * @returns {{pathElements: number[], pathIndex: number[]}} A
anchor/tests/lib/merkle_tree.ts:137
↓ 22 callers
Function
getTestProtocolAddresses
( programId: PublicKey, authority: PublicKey, feeRecipient: PublicKey )
anchor/tests/lib/test_alt.ts:127
↓ 19 callers
Function
check_public_amount
* Calculates the expected public amount from ext_amount and fee, then verifies if it matches * the provided public_amount_bytes. * * @param ext_amo
anchor/programs/zkcash/src/utils.rs:92
↓ 19 callers
Function
getMintAddressField
(mint: PublicKey)
anchor/tests/lib/utils.ts:104
↓ 17 callers
Function
calculate_complete_ext_data_hash
* Calculate ExtData hash with encrypted outputs included * This matches the client-side calculation for hash verification * * This is for SOL mint
anchor/programs/zkcash/src/utils.rs:276
↓ 16 callers
Function
change_endianness
(bytes: &[u8])
anchor/programs/zkcash/src/utils.rs:313
↓ 15 callers
Function
calculateDepositFee
(amount: number)
anchor/tests/spl_tests.ts:32
↓ 15 callers
Method
indexOf
* Find an element in the tree * @param element An element to find * @param comparator A function that checks leaf value equality * @returns {
anchor/tests/lib/merkle_tree.ts:163
↓ 14 callers
Function
calculateDepositFee
(amount: number)
anchor/tests/sol_tests.ts:28
↓ 13 callers
Function
fr_to_bytes
Helper function to convert Fr to bytes in big-endian format
anchor/programs/zkcash/tests/unit/utils_test.rs:64
↓ 12 callers
Function
generateRandomNullifier
()
anchor/tests/sol_tests.ts:18
↓ 11 callers
Function
create_test_account
()
anchor/programs/zkcash/tests/unit/merkle_tree_test.rs:5
↓ 9 callers
Function
calculateWithdrawalFee
(amount: number)
anchor/tests/spl_tests.ts:37
↓ 8 callers
Function
generateRandomNullifier
()
anchor/tests/spl_tests.ts:22
↓ 8 callers
Method
sign
* Sign a message using keypair private key * * @param {string|number|BigNumber} commitment a hex string with commitment * @param {string|numb
anchor/tests/lib/keypair.ts:40
↓ 6 callers
Function
bnToBytes
(bn: anchor.BN)
anchor/tests/sol_tests.ts:37
↓ 6 callers
Function
calculateFee
(amount: number, feeRate: number)
anchor/tests/spl_tests.ts:27
↓ 6 callers
Function
calculateWithdrawalFee
(amount: number)
anchor/tests/sol_tests.ts:33
↓ 5 callers
Method
serialize
* Serialize entire tree state including intermediate layers into a plain object * Deserializing it back will not require to recompute any hashes
anchor/tests/lib/merkle_tree.ts:184
↓ 5 callers
Function
u64_to_bytes
Helper function to create a byte array representing a u64 value
anchor/programs/zkcash/tests/unit/utils_test.rs:73
↓ 4 callers
Function
bnToBytes
(bn: anchor.BN)
anchor/tests/spl_tests.ts:41
↓ 3 callers
Method
_doCalculateWitness
(input_orig, sanityCheck)
artifacts/circuits/transaction2_js/witness_calculator.js:131
↓ 3 callers
Function
addBitmaskToByte
(byte: number, yIsPositive: boolean)
anchor/tests/lib/prover.ts:290
↓ 3 callers
Function
fromArray32
(arr)
artifacts/circuits/transaction2_js/witness_calculator.js:338
↓ 3 callers
Method
initialize
(tree_account: &mut MerkleTreeAccount)
anchor/programs/zkcash/src/merkle_tree.rs:9
↓ 3 callers
Method
verify
Verifies the proof, and checks that public inputs are smaller than field size.
anchor/programs/zkcash/src/groth16.rs:114
↓ 2 callers
Method
_rebuild
()
anchor/tests/lib/merkle_tree.ts:56
↓ 2 callers
Function
calculateFee
(amount: number, feeRate: number)
anchor/tests/spl_mint_test.ts:27
↓ 2 callers
Function
calculateFee
(amount: number, feeRate: number)
anchor/tests/sol_tests.ts:23
↓ 2 callers
Function
flatArray
(a)
artifacts/circuits/transaction2_js/witness_calculator.js:347
↓ 2 callers
Function
getMessage
()
artifacts/circuits/transaction2_js/witness_calculator.js:81
↓ 2 callers
Function
qualify_input
(prefix,input,input1)
artifacts/circuits/transaction2_js/witness_calculator.js:292
↓ 2 callers
Method
update
* Change an element in the tree * @param {number} index Index of element to change * @param element Updated element value
anchor/tests/lib/merkle_tree.ts:110
↓ 2 callers
Function
yElementIsPositiveG1
(yElement: anchor.BN)
anchor/tests/lib/prover.ts:260
↓ 1 callers
Function
calculateDepositFee
(amount: number)
anchor/tests/spl_mint_test.ts:32
↓ 1 callers
Method
calculateWTNSBin
(input, sanityCheck)
artifacts/circuits/transaction2_js/witness_calculator.js:212
↓ 1 callers
Method
calculateWitness
(input, sanityCheck)
artifacts/circuits/transaction2_js/witness_calculator.js:176
↓ 1 callers
Function
createALT
* Create a new address lookup table
scripts/create_alt_mainnet.ts:36
↓ 1 callers
Function
createExtDataMinified
(extData: any)
anchor/tests/spl_mint_test.ts:82
↓ 1 callers
Function
fillArray
(res, a)
artifacts/circuits/transaction2_js/witness_calculator.js:352
↓ 1 callers
Function
findCrossCheckNullifierPDAs
(program: anchor.Program<any>, proof: any)
anchor/tests/spl_mint_test.ts:67
↓ 1 callers
Function
findNullifierPDAs
(program: anchor.Program<any>, proof: any)
anchor/tests/spl_mint_test.ts:52
↓ 1 callers
Function
fnvHash
(str)
artifacts/circuits/transaction2_js/witness_calculator.js:369
↓ 1 callers
Method
generateNew
(lightWasm: LightWasm)
anchor/tests/lib/keypair.ts:44
↓ 1 callers
Function
generateSquadUpdateDepositLimitForSplTokenInstruction
()
scripts/update_spl_deposit_limit_via_squad.ts:36
↓ 1 callers
Function
generateSquadsTransaction
()
scripts/initialize_spl_tree_mainnet_squads.ts:23
↓ 1 callers
Function
generateUpdateDepositLimitForSplTokenDiscriminator
* Generate Anchor instruction discriminator for updateDepositLimitForSplToken * Anchor uses the first 8 bytes of SHA256("global:update_deposit_limit_
scripts/update_spl_deposit_limit_via_squad.ts:20
↓ 1 callers
Function
getProtocolAddresses
* Get all required addresses for the privacy cash protocol
scripts/create_alt_mainnet.ts:147
↓ 1 callers
Function
getTreePDA
(program: anchor.Program<any>, mint: PublicKey)
anchor/tests/spl_tests.ts:123
↓ 1 callers
Function
initialize
* Example output: * Generated PDAs: * Tree Account: 2R6iQwfvX2ixi21MFnm3KSDBfFrCAWv7qpw2cE9ygqt5 * Tree Token Account: FwQAFcHJqDWNBLKoa5qncZhP8fce
scripts/initialize_devnet.ts:46
↓ 1 callers
Function
initializeSplTree
* Example output: * Generated PDAs: * Tree Account for SPL Token: xxx * Global Config: xxx * Initialization successful! * Transaction signature:
scripts/initialize_spl_tree_devnet.ts:37
↓ 1 callers
Function
is_less_than_bn254_field_size_be
(bytes: &[u8; 32])
anchor/programs/zkcash/src/groth16.rs:149
↓ 1 callers
Function
main
()
scripts/extend_alt_mainnet.ts:32
↓ 1 callers
Function
main
()
scripts/create_alt_mainnet.ts:226
↓ 1 callers
Function
normalize
(n, prime)
artifacts/circuits/transaction2_js/witness_calculator.js:363
↓ 1 callers
Function
printSharedRWMemory
()
artifacts/circuits/transaction2_js/witness_calculator.js:91
↓ 1 callers
Function
qualify_input_list
(prefix,input,input1)
artifacts/circuits/transaction2_js/witness_calculator.js:281
↓ 1 callers
Function
resetGlobalTestALT
()
anchor/tests/lib/test_alt.ts:22
↓ 1 callers
Function
serializeNewLimit
* Serialize the new limit parameter as u64 (little-endian)
scripts/update_spl_deposit_limit_via_squad.ts:30
↓ 1 callers
Function
toArray32
(rem,size)
artifacts/circuits/transaction2_js/witness_calculator.js:321
↓ 1 callers
Function
verify_proof
(proof: Proof, verifying_key: Groth16Verifyingkey)
anchor/programs/zkcash/src/utils.rs:214
↓ 1 callers
Method
verify_unchecked
Verifies the proof, and does not check that public inputs are smaller than field size.
anchor/programs/zkcash/src/groth16.rs:120
↓ 1 callers
Function
yElementIsPositiveG2
(yElement1: anchor.BN, yElement2: anchor.BN)
anchor/tests/lib/prover.ts:264
Method
append
( leaf: [u8; 32], tree_account: &mut MerkleTreeAccount, )
anchor/programs/zkcash/src/merkle_tree.rs:26
Function
bnToBytes
(bn: anchor.BN)
anchor/tests/spl_mint_test.ts:41
Function
bnToBytes
(bn: anchor.BN)
anchor/tests/lib/utils.ts:14
Method
bulkInsert
* Insert multiple elements into the tree. Tree will be fully rebuilt during this operation. * @param {Array} elements Elements to insert
anchor/tests/lib/merkle_tree.ts:96
Method
calculateBinWitness
(input, sanityCheck)
artifacts/circuits/transaction2_js/witness_calculator.js:194
Function
calculateWithdrawalFee
(amount: number)
anchor/tests/spl_mint_test.ts:37
Method
circom_version
()
artifacts/circuits/transaction2_js/witness_calculator.js:127
Function
clearGlobalTestALT
()
anchor/tests/lib/test_alt.ts:285
Method
constructor
( levels: number, lightWasm: LightWasm, elements: string[] = [], { zeroElement = DEFAULT_ZERO
anchor/tests/lib/merkle_tree.ts:29
Method
constructor
(privkeyHex: string, lightWasm: LightWasm)
anchor/tests/lib/keypair.ts:25
Method
constructor
({ lightWasm, amount = new BN(0), /** * Tornado nova doesn't use solana eddsa with curve 255
anchor/tests/lib/utxo.ts:25
Method
constructor
(instance, sanityCheck)
artifacts/circuits/transaction2_js/witness_calculator.js:109
Method
deserialize
* Deserialize data into a MerkleTree instance * Make sure to provide the same hashFunction as was used in the source tree, * otherwise the tree
anchor/tests/lib/merkle_tree.ts:201
Method
elements
* Returns a copy of non-zero tree elements * @returns {Object[]}
anchor/tests/lib/merkle_tree.ts:175
Function
ext_data_hash_should_match
()
anchor/programs/zkcash/tests/unit/groth16_test.rs:278
Method
from_minified
(ctx: &Context<Transact>, minified: ExtDataMinified)
anchor/programs/zkcash/src/lib.rs:569
Method
from_minified_spl
(ctx: &Context<TransactSpl>, minified: ExtDataMinified)
anchor/programs/zkcash/src/lib.rs:579
next →
1–100 of 208, ranked by callers