Battle-tested scrolls of shadow magic, forged in the depths of the Aztec realm. These legendary contracts wield zero-knowledge enchantments to shield your secrets from prying eyes.
Forge anonymous council chambers where voices remain hidden yet true. These shadow-bound enchantments ensure each vote stays concealed while the will of the realm remains verifiable. Perfect for guild governance, realm elections, and secret conclaves.
fn main(
vote: Field,
nullifier: Field,
commitment: pub Field
) {
// Prove vote validity
assert(vote < 3);
// Generate nullifier
let hash = pedersen_hash([vote, nullifier]);
assert(hash == commitment);
}
Orchestrate clandestine auction halls where sealed bids remain shrouded in mystery until the great reveal. These enchantments ensure fair price discovery through shadow magic. Perfect for legendary artifact sales, guild procurement, and treasure vault management.
fn commit_bid(
bid_amount: Field,
nonce: Field,
commitment: pub Field
) {
let hash = pedersen_hash([bid_amount, nonce]);
assert(hash == commitment);
// Verify bid is within bounds
assert(bid_amount > 0);
}
Manage confidential asset transfers with hidden amounts and recipients while proving transaction validity. Perfect for private payments, salary distribution, and donations.
fn transfer(
input_amount: Field,
output_amount: Field,
fee: pub Field
) {
// Prove balance conservation
assert(input_amount == output_amount + fee);
// Verify amounts are positive
assert(output_amount > 0);
}
Prove identity attributes without revealing personal information using zero-knowledge credentials. Essential for KYC compliance and age verification.
fn verify_age(
birth_year: Field,
current_year: pub Field,
min_age: pub Field
) {
let age = current_year - birth_year;
assert(age >= min_age);
// Prove birth year is reasonable
assert(birth_year > 1900);
}
Anonymous weighted governance system for decentralized organizations. Enables private voting with stake-based weight calculation while maintaining transparency.
fn vote_weighted(
vote: Field,
stake: Field,
proof_of_stake: Field,
nullifier: Field
) {
// Verify stake proof
assert(proof_of_stake > 0);
// Calculate weighted vote
let weighted_vote = vote * stake;
assert(weighted_vote > 0);
}
Get started with Noircraft's contract templates in just a few commands. Choose a template, customize it, and deploy to the Aztec network.
Select from our production-ready contract templates above
cd contracts/templates
Copy and modify the template for your specific use case
cp -r private_voting my_contract
Test your contract and deploy to the Aztec network
nargo test && nargo prove