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

feat: GrumpkinScalar type #1919

Merged
merged 29 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1d0f22d
feat: GrumpkinScalar
benesjan Sep 5, 2023
75aeb0d
typo fix
benesjan Sep 5, 2023
c166e5b
WIP
benesjan Sep 5, 2023
077b65d
fix
benesjan Sep 5, 2023
562ae2d
typo fix to trigger full rebuild
benesjan Sep 5, 2023
6c3c743
feat: grumpkin_scalar.nr
benesjan Sep 6, 2023
2967ab0
feat: serialization of grumpkin scalar to 2 Fr elements
benesjan Sep 6, 2023
d0ccd96
WIP
benesjan Sep 6, 2023
1e2d94a
better naming + linking issue
benesjan Sep 6, 2023
8830d6d
test fix
benesjan Sep 6, 2023
9c8c7b0
snake case
benesjan Sep 6, 2023
324d193
better description
benesjan Sep 6, 2023
1159e07
reverting incorrectly introduced change
benesjan Sep 6, 2023
a06534f
camel case issue 2
benesjan Sep 6, 2023
18d6287
using sign closure to avoid code duplication
benesjan Sep 6, 2023
5b696fd
removed redundant argument
benesjan Sep 6, 2023
4ea726b
Merge branch 'master' into janb/private-key-as-grumpkin-field
benesjan Sep 7, 2023
cc23973
WIP
benesjan Sep 7, 2023
4521c85
fixes
benesjan Sep 7, 2023
de5568a
fix
benesjan Sep 7, 2023
abaf0df
typo fix to trigger full rebuild
benesjan Sep 7, 2023
332f9e7
attempt at getting more info
benesjan Sep 7, 2023
20840e8
update e2e docker-compose sandbox image
spypsy Sep 7, 2023
431103c
tag :latest in run_tests_local
spypsy Sep 7, 2023
e398fe5
revert img name
spypsy Sep 7, 2023
84515bb
Attempt build fix
PhilWindle Sep 7, 2023
941a9ce
Try again
PhilWindle Sep 7, 2023
fa2eaf3
Another attempt
PhilWindle Sep 7, 2023
0ab32ee
Merge branch 'pw/fix-build-3' into janb/private-key-as-grumpkin-field
benesjan Sep 7, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ __extension__ using uint128_t = unsigned __int128;
// NOLINTBEGIN(cppcoreguidelines-pro-type-reinterpret-cast, cert-dcl58-cpp)
// clang-format on

template <typename T>
concept IntegralOrEnum = std::integral<T> || std::is_enum_v<T>;
template <typename T> concept IntegralOrEnum = std::integral<T> || std::is_enum_v<T>;

namespace serialize {
// Forward declare derived msgpack methods
Expand Down
2 changes: 1 addition & 1 deletion circuits/cpp/src/aztec3/circuits/abis/c_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ WASM_EXPORT void abis__hash_vk(uint8_t const* vk_data_buf, uint8_t* output)
* @brief Generates a function tree leaf from its preimage.
* This is a WASM-export that can be called from Typescript.
*
* @details given a `uint8_t const*` buffer representing a function leaf's prieimage,
* @details given a `uint8_t const*` buffer representing a function leaf's preimage,
* construct a FunctionLeafPreimage instance, hash, and return the serialized results
* in the `output` buffer.
*
Expand Down
11 changes: 6 additions & 5 deletions circuits/cpp/src/aztec3/circuits/kernel/private/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void common_update_end_values(DummyBuilder& builder,

const auto& storage_contract_address = private_call_public_inputs.call_context.storage_contract_address;

// Transient read requests and witnessess are accumulated in public_inputs.end
// Transient read requests and witnesses are accumulated in public_inputs.end
// We silo the read requests (domain separation per contract address)
{
for (size_t i = 0; i < read_requests.size(); ++i) {
Expand Down Expand Up @@ -193,10 +193,11 @@ void common_update_end_values(DummyBuilder& builder,
std::array<NT::fr, MAX_NEW_NULLIFIERS_PER_CALL> siloed_nullified_commitments{};
for (size_t i = 0; i < MAX_NEW_NULLIFIERS_PER_CALL; ++i) {
siloed_nullified_commitments[i] =
nullified_commitments[i] == fr(0) ? fr(0) // don't silo when empty
: nullified_commitments[i] == fr(EMPTY_NULLIFIED_COMMITMENT)
? fr(EMPTY_NULLIFIED_COMMITMENT) // don't silo when empty
: silo_commitment<NT>(storage_contract_address, nullified_commitments[i]);
nullified_commitments[i] == fr(0)
? fr(0) // don't silo when empty
: nullified_commitments[i] == fr(EMPTY_NULLIFIED_COMMITMENT)
? fr(EMPTY_NULLIFIED_COMMITMENT) // don't silo when empty
: silo_commitment<NT>(storage_contract_address, nullified_commitments[i]);
}

push_array_to_array(
Expand Down
4 changes: 2 additions & 2 deletions circuits/cpp/src/aztec3/circuits/rollup/base/.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@ TEST_F(base_rollup_tests, native_nullifier_tree_regression)
DummyCircuitBuilder builder = DummyCircuitBuilder("base_rollup_tests__native_nullifier_tree_regression");

// This test runs after some data has already been inserted into the tree
// This test will pre-populate the tree with 6 * KERNEL_NEW_NULLILFIERS_LENGTH values (0 item + 6 *
// KERNEL_NEW_NULLILFIERS_LENGTH -1 more) simulating that a rollup inserting two random values has already
// This test will pre-populate the tree with 6 * KERNEL_NEW_NULLIFIERS_LENGTH values (0 item + 6 *
// KERNEL_NEW_NULLIFIERS_LENGTH -1 more) simulating that a rollup inserting two random values has already
// succeeded. Note that this corresponds to 3 (1 already initialized and 2 new ones) base rollups. This rollup then
// adds two further random values that will end up having their low nullifiers point at each other
std::vector<fr> initial_values(6 * MAX_NEW_NULLIFIERS_PER_TX - 1, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,14 @@ export class ClientTxExecutionContext {
* @param contractAddress - The contract address.
* @param ownerX - The x coordinate of the owner's public key.
* @param ownerY - The y coordinate of the owner's public key.
* @returns The secret key of the owner.
* @returns The secret key of the owner as a pair of ACVM fields.
*/
public async getSecretKey(contractAddress: AztecAddress, ownerX: ACVMField, ownerY: ACVMField) {
return toACVMField(
(await this.db.getSecretKey(contractAddress, new Point(fromACVMField(ownerX), fromACVMField(ownerY)))).value,
const secretKey = await this.db.getSecretKey(
contractAddress,
new Point(fromACVMField(ownerX), fromACVMField(ownerY)),
);
return [toACVMField(secretKey.high), toACVMField(secretKey.low)];
}

/**
Expand Down
6 changes: 3 additions & 3 deletions yarn-project/acir-simulator/src/client/db_oracle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompleteAddress, HistoricBlockData, PrivateKey, PublicKey } from '@aztec/circuits.js';
import { CompleteAddress, GrumpkinPrivateKey, HistoricBlockData, PublicKey } from '@aztec/circuits.js';
import { FunctionAbi, FunctionDebugMetadata, FunctionSelector } from '@aztec/foundation/abi';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { EthAddress } from '@aztec/foundation/eth-address';
Expand Down Expand Up @@ -102,10 +102,10 @@ export interface DBOracle extends CommitmentsDB {
*
* @param contractAddress - The contract address. Ignored here. But we might want to return different keys for different contracts.
* @param pubKey - The public key of an account.
* @returns A Promise that resolves to the secret key as a Buffer.
* @returns A Promise that resolves to the secret key.
* @throws An Error if the input address does not match the public key address of the key pair.
*/
getSecretKey(contractAddress: AztecAddress, pubKey: PublicKey): Promise<PrivateKey>;
getSecretKey(contractAddress: AztecAddress, pubKey: PublicKey): Promise<GrumpkinPrivateKey>;

/**
* Retrieves a set of notes stored in the database for a given contract address and storage slot.
Expand Down
23 changes: 15 additions & 8 deletions yarn-project/acir-simulator/src/client/private_execution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
L1_TO_L2_MSG_TREE_HEIGHT,
MAX_NEW_COMMITMENTS_PER_CALL,
PRIVATE_DATA_TREE_HEIGHT,
PrivateKey,
PublicCallRequest,
TxContext,
} from '@aztec/circuits.js';
Expand All @@ -28,7 +27,7 @@ import { asyncMap } from '@aztec/foundation/async-map';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
import { EthAddress } from '@aztec/foundation/eth-address';
import { Fr } from '@aztec/foundation/fields';
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
import { AppendOnlyTree, Pedersen, StandardTree, newTree } from '@aztec/merkle-tree';
import {
Expand Down Expand Up @@ -66,7 +65,7 @@ describe('Private Execution test suite', () => {
let logger: DebugLogger;

const defaultContractAddress = AztecAddress.random();
const ownerPk = PrivateKey.fromString('5e30a2f886b4b6a11aea03bf4910fbd5b24e61aa27ea4d05c393b3ab592a8d33');
const ownerPk = GrumpkinScalar.fromString('2dcc5485a58316776299be08c78fa3788a1a7961ae30dc747fb1be17692a8d32');

const treeHeights: { [name: string]: number } = {
privateData: PRIVATE_DATA_TREE_HEIGHT,
Expand Down Expand Up @@ -168,7 +167,7 @@ describe('Private Execution test suite', () => {

describe('private token airdrop contract', () => {
const contractAddress = defaultContractAddress;
const recipientPk = PrivateKey.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec');
const recipientPk = GrumpkinScalar.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec');
const mockFirstNullifier = new Fr(1111);
let owner: AztecAddress;
let recipient: AztecAddress;
Expand Down Expand Up @@ -233,7 +232,11 @@ describe('Private Execution test suite', () => {
const siloedNoteHash = siloCommitment(circuitsWasm, contractAddress, innerNoteHash);
const uniqueSiloedNoteHash = computeUniqueCommitment(circuitsWasm, note.nonce, siloedNoteHash);
const innerNullifier = Fr.fromBuffer(
pedersenPlookupCommitInputs(circuitsWasm, [uniqueSiloedNoteHash.toBuffer(), ownerPk.value]),
pedersenPlookupCommitInputs(circuitsWasm, [
uniqueSiloedNoteHash.toBuffer(),
ownerPk.high.toBuffer(),
ownerPk.low.toBuffer(),
]),
);

const result = await acirSimulator.computeNoteHashAndNullifier(
Expand Down Expand Up @@ -400,7 +403,7 @@ describe('Private Execution test suite', () => {

describe('private token contract', () => {
const contractAddress = defaultContractAddress;
const recipientPk = PrivateKey.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec');
const recipientPk = GrumpkinScalar.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec');
const mockFirstNullifier = new Fr(1111);
let owner: AztecAddress;
let recipient: AztecAddress;
Expand Down Expand Up @@ -465,7 +468,11 @@ describe('Private Execution test suite', () => {
const siloedNoteHash = siloCommitment(circuitsWasm, contractAddress, innerNoteHash);
const uniqueSiloedNoteHash = computeUniqueCommitment(circuitsWasm, note.nonce, siloedNoteHash);
const innerNullifier = Fr.fromBuffer(
pedersenPlookupCommitInputs(circuitsWasm, [uniqueSiloedNoteHash.toBuffer(), ownerPk.value]),
pedersenPlookupCommitInputs(circuitsWasm, [
uniqueSiloedNoteHash.toBuffer(),
ownerPk.high.toBuffer(),
ownerPk.low.toBuffer(),
]),
);

const result = await acirSimulator.computeNoteHashAndNullifier(
Expand Down Expand Up @@ -680,7 +687,7 @@ describe('Private Execution test suite', () => {

describe('consuming messages', () => {
const contractAddress = defaultContractAddress;
const recipientPk = PrivateKey.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec');
const recipientPk = GrumpkinScalar.fromString('0c9ed344548e8f9ba8aa3c9f8651eaa2853130f6c1e9c050ccf198f7ea18a7ec');

let recipient: AztecAddress;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CompleteAddress, FunctionData, HistoricBlockData, PrivateKey } from '@aztec/circuits.js';
import { CompleteAddress, FunctionData, HistoricBlockData } from '@aztec/circuits.js';
import { FunctionSelector, encodeArguments } from '@aztec/foundation/abi';
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { EthAddress } from '@aztec/foundation/eth-address';
import { Fr } from '@aztec/foundation/fields';
import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
import { PrivateTokenContractAbi } from '@aztec/noir-contracts/artifacts';
import { FunctionCall } from '@aztec/types';

Expand All @@ -21,7 +21,7 @@ describe('Unconstrained Execution test suite', () => {
});

describe('private token contract', () => {
const ownerPk = PrivateKey.fromString('5e30a2f886b4b6a11aea03bf4910fbd5b24e61aa27ea4d05c393b3ab592a8d33');
const ownerPk = GrumpkinScalar.fromString('2dcc5485a58316776299be08c78fa3788a1a7961ae30dc747fb1be17692a8d32');

let owner: AztecAddress;

Expand Down
4 changes: 2 additions & 2 deletions yarn-project/acir-simulator/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CircuitsWasm, PrivateKey } from '@aztec/circuits.js';
import { CircuitsWasm, GrumpkinPrivateKey } from '@aztec/circuits.js';
import { Grumpkin, pedersenPlookupCommitInputs } from '@aztec/circuits.js/barretenberg';
import { Fr } from '@aztec/foundation/fields';

Expand Down Expand Up @@ -37,7 +37,7 @@ export function computeSlotForMapping(mappingSlot: Fr, owner: NoirPoint | Fr, bb
* @param grumpkin - The grumpkin instance.
* @returns The public key.
*/
export function toPublicKey(privateKey: PrivateKey, grumpkin: Grumpkin): NoirPoint {
export function toPublicKey(privateKey: GrumpkinPrivateKey, grumpkin: Grumpkin): NoirPoint {
const point = grumpkin.mul(Grumpkin.generator, privateKey);
return {
x: point.x.value,
Expand Down
22 changes: 13 additions & 9 deletions yarn-project/aztec-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Contract,
ContractDeployer,
Fr,
GrumpkinScalar,
Point,
generatePublicKey,
getAccountWallets,
Expand All @@ -15,7 +16,7 @@ import { DebugLogger, LogFn } from '@aztec/foundation/log';
import { fileURLToPath } from '@aztec/foundation/url';
import { compileContract } from '@aztec/noir-compiler/cli';
import { SchnorrAccountContractAbi } from '@aztec/noir-contracts/artifacts';
import { CompleteAddress, ContractData, L2BlockL2Logs, PrivateKey, TxHash } from '@aztec/types';
import { CompleteAddress, ContractData, L2BlockL2Logs, TxHash } from '@aztec/types';

import { Command } from 'commander';
import { readFileSync } from 'fs';
Expand Down Expand Up @@ -94,7 +95,10 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command {

program
.command('generate-private-key')
.description('Generates a 32-byte private key.')
.summary('Generates an encryption private key.')
.description(
'Generates a private key which fits into the scalar field used by Grumpkin curve, can be used as an encryption private key.',
)
.option(
'-m, --mnemonic',
'An optional mnemonic string used for the private key generation. If not provided, random private key will be generated.',
Expand All @@ -104,11 +108,11 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command {
let publicKey;
if (options.mnemonic) {
const acc = mnemonicToAccount(options.mnemonic);
const key = Buffer.from(acc.getHdKey().privateKey!);
privKey = key.toString('hex');
publicKey = await generatePublicKey(new PrivateKey(key));
// TODO(#2052): This reduction is not secure enough. TACKLE THIS ISSUE BEFORE MAINNET.
const key = GrumpkinScalar.fromBufferWithReduction(Buffer.from(acc.getHdKey().privateKey!));
publicKey = await generatePublicKey(key);
} else {
const key = PrivateKey.random();
const key = GrumpkinScalar.random();
privKey = key.toString();
publicKey = await generatePublicKey(key);
}
Expand All @@ -130,8 +134,8 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command {
.action(async options => {
const client = await createCompatibleClient(options.rpcUrl, debugLogger);
const privateKey = options.privateKey
? PrivateKey.fromString(stripLeadingHex(options.privateKey))
: PrivateKey.random();
? GrumpkinScalar.fromString(stripLeadingHex(options.privateKey))
: GrumpkinScalar.random();

const account = getSchnorrAccount(client, privateKey, privateKey, accountCreationSalt);
const wallet = await account.waitDeploy();
Expand Down Expand Up @@ -380,7 +384,7 @@ export function getProgram(log: LogFn, debugLogger: DebugLogger): Command {
);
}

const privateKey = PrivateKey.fromString(stripLeadingHex(options.privateKey));
const privateKey = GrumpkinScalar.fromString(stripLeadingHex(options.privateKey));

const client = await createCompatibleClient(options.rpcUrl, debugLogger);
const wallet = await getAccountWallets(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AztecAddress } from '@aztec/foundation/aztec-address';
import { Fr, Point } from '@aztec/foundation/fields';
import { Fr, GrumpkinScalar, Point } from '@aztec/foundation/fields';
import { JsonRpcServer } from '@aztec/foundation/json-rpc/server';
import {
AztecRPC,
Expand All @@ -8,7 +8,6 @@ import {
ExtendedContractData,
L2BlockL2Logs,
NotePreimage,
PrivateKey,
Tx,
TxExecutionRequest,
TxHash,
Expand Down Expand Up @@ -37,8 +36,8 @@ export function getHttpRpcServer(aztecRpcServer: AztecRPC): JsonRpcServer {
TxHash,
EthAddress,
Point,
PrivateKey,
Fr,
GrumpkinScalar,
NotePreimage,
},
{ Tx, TxReceipt, L2BlockL2Logs },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
CompleteAddress,
EthAddress,
FunctionData,
GrumpkinPrivateKey,
KernelCircuitPublicInputsFinal,
MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX,
PartialAddress,
PrivateKey,
PublicCallRequest,
} from '@aztec/circuits.js';
import { encodeArguments } from '@aztec/foundation/abi';
Expand Down Expand Up @@ -104,7 +104,7 @@ export class AztecRPCServer implements AztecRPC {
this.log.info('Stopped');
}

public async registerAccount(privKey: PrivateKey, partialAddress: PartialAddress) {
public async registerAccount(privKey: GrumpkinPrivateKey, partialAddress: PartialAddress) {
const completeAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(privKey, partialAddress);
const wasAdded = await this.db.addCompleteAddress(completeAddress);
if (wasAdded) {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec-rpc/src/kernel_prover/kernel_prover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ExecutionResult, NewNoteData } from '@aztec/acir-simulator';
import {
AztecAddress,
CONTRACT_TREE_HEIGHT,
EMPTY_NULLIFIED_COMMITMENT,
Fr,
MAX_NEW_COMMITMENTS_PER_TX,
MAX_NEW_NULLIFIERS_PER_TX,
Expand All @@ -23,7 +24,6 @@ import {
makeEmptyProof,
makeTuple,
} from '@aztec/circuits.js';
import { EMPTY_NULLIFIED_COMMITMENT } from '@aztec/circuits.js';
import { Tuple, assertLength } from '@aztec/foundation/serialize';

import { KernelProofCreator, ProofCreator, ProofOutput, ProofOutputFinal } from './proof_creator.js';
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec-rpc/src/simulator_oracle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
EthAddress,
Fr,
FunctionSelector,
GrumpkinPrivateKey,
HistoricBlockData,
PrivateKey,
PublicKey,
} from '@aztec/circuits.js';
import { siloCommitment } from '@aztec/circuits.js/abis';
Expand All @@ -33,7 +33,7 @@ export class SimulatorOracle implements DBOracle {
private dataTreeProvider: DataCommitmentProvider,
) {}

getSecretKey(_contractAddress: AztecAddress, pubKey: PublicKey): Promise<PrivateKey> {
getSecretKey(_contractAddress: AztecAddress, pubKey: PublicKey): Promise<GrumpkinPrivateKey> {
return this.keyStore.getAccountPrivateKey(pubKey);
}

Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec-rpc/src/synchroniser/synchroniser.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CompleteAddress, Fr, HistoricBlockData, PrivateKey } from '@aztec/circuits.js';
import { CompleteAddress, Fr, GrumpkinScalar, HistoricBlockData } from '@aztec/circuits.js';
import { Grumpkin } from '@aztec/circuits.js/barretenberg';
import { TestKeyStore } from '@aztec/key-store';
import { AztecNode, L2Block, MerkleTreeId } from '@aztec/types';
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('Synchroniser', () => {

// Manually adding account to database so that we can call synchroniser.isAccountStateSynchronised
const keyStore = new TestKeyStore(await Grumpkin.new());
const privateKey = PrivateKey.random();
const privateKey = GrumpkinScalar.random();
keyStore.addAccount(privateKey);
const completeAddress = await CompleteAddress.fromPrivateKeyAndPartialAddress(privateKey, Fr.random());
await database.addCompleteAddress(completeAddress);
Expand Down
12 changes: 10 additions & 2 deletions yarn-project/aztec-sandbox/src/examples/private_token_contract.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { AztecAddress, Contract, Fr, PrivateKey, Wallet, createAccounts, createAztecRpcClient } from '@aztec/aztec.js';
import {
AztecAddress,
Contract,
Fr,
GrumpkinScalar,
Wallet,
createAccounts,
createAztecRpcClient,
} from '@aztec/aztec.js';
import { createDebugLogger } from '@aztec/foundation/log';
import { SchnorrSingleKeyAccountContractAbi } from '@aztec/noir-contracts/artifacts';
import { PrivateTokenContract } from '@aztec/noir-contracts/types';

const logger = createDebugLogger('aztec:http-rpc-client');

export const privateKey = PrivateKey.fromString('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80');
export const privateKey = GrumpkinScalar.fromString('ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80');

const url = 'http://localhost:8080';

Expand Down
Loading