Members
(constant) userAccount
Dummy account used to test the granting of note view access
- Source:
(constant) userAccount2
Second dummy account used to test the granting of note view access
- Source:
Methods
balancedPublicValues(nIn, nOut)
Generate a set of random input and output values based on the number of notes.
Parameters:
| Name | Type | Description |
|---|---|---|
nIn |
number |
number of input notes |
nOut |
number |
number of output notes |
- Source:
BurnProof(…args)
Export the BurnProof for a default epoch
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
any |
<repeatable> |
rest parameter representing the proof inputs |
- Source:
checkPublicComparisonWellFormed(publicComparison)
Check that the publicComparison integer is well formed. Specifically, check that it is positive and that it is an integer.
Parameters:
| Name | Type | Description |
|---|---|---|
publicComparison |
Number |
publicly visible integer, against which an AZTEC note is being compared |
create(publicKey, value, noteOwner, access) → {Promise}
Create a Note instance from a recipient public key and a desired value
Parameters:
| Name | Type | Description |
|---|---|---|
publicKey |
string |
hex-string formatted recipient public key |
value |
number |
value of the note |
noteOwner |
string |
owner of the note if different from the public key |
access |
Array |
mapping between Ethereum addresses being granted view access of a note and a linkedPublicKey |
- Source:
createZeroValueNote() → {Promise}
Create a zero value note with from a constant a to make the hash of the initial totalMinted note in
mintable assets a constant
- Source:
derive(publicKey, spendingKey) → {Promise}
Create Note instance from a public key and a spending key
Parameters:
| Name | Type | Description |
|---|---|---|
publicKey |
string |
hex-string formatted note public key |
spendingKey |
string |
hex-string formatted spending key (can also be an Ethereum private key) |
- Source:
DividendProof(…args)
Export the DividendProof for a default epoch
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
any |
<repeatable> |
rest parameter representing the proof inputs |
- Source:
encodeInputSignatures(inputSignatures) → {string|Number}
Encode input signatures into ABI compatible string array format
Parameters:
| Name | Type | Description |
|---|---|---|
inputSignatures |
Array.<Object> |
ECDSA signatures provided by note owners for their notes to be used in a zero-knowledge proof |
- Source:
encodeMetadata(notes) → {String}
Encode the metaData of multiple notes into ABI compatible string array format
Parameters:
| Name | Type | Description |
|---|---|---|
notes |
array of notes with metadata as part of their schema |
- Source:
encodeMetadata(noteArray) → {string}
Encode compressed metadata of an array of notes as a hex-string, with each entry occupying 33 bytes
Parameters:
| Name | Type | Description |
|---|---|---|
noteArray |
Array |
Array of notes to encode in metadata |
- Source:
encodeNote(notes) → {string}
Encode an AZTEC note into ABI compatible string array format
Parameters:
| Name | Type | Description |
|---|---|---|
notes |
Array.<note> |
array of AZTEC notes |
- Source:
encodeOwners(owners) → {string|Number}
Encode outputOwners into ABI compatible string array format
Parameters:
| Name | Type | Description |
|---|---|---|
owners |
Array.<Object> |
owners of notes from a zero-knowledge proof |
- Source:
encodeProofData(proofData) → {string|Number}
Encode proofData into ABI compatible string array format
Parameters:
| Name | Type | Description |
|---|---|---|
proofData |
Array.<Object> |
cryptographic proof data from proof construction |
- Source:
epoch(epochNum, setAsDefault)
Export the PrivateRangeProof for a given epoch number
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Number |
epoch number for which a PrivateRangeProof is to be returned |
setAsDefault |
bool |
if true, sets the inputted epochNum to be the default. If false, does not set the inputted epoch number to be the default |
- Source:
epoch(epochNum, setAsDefault)
Export the MintProof for a given epoch number
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Number |
epoch number for which a MintProof is to be returned |
setAsDefault |
bool |
if true, sets the inputted epochNum to be the default. If false, does not set the inputted epoch number to be the default |
- Source:
epoch(epochNum, setAsDefault)
Export the JoinSplitProof for a given epoch number
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Number |
epoch number for which a JoinSplitProof is to be returned |
setAsDefault |
bool |
if true, sets the inputted epochNum to be the default. If false, does not set the inputted epoch number to be the default |
- Source:
epoch(epochNum, setAsDefault)
Export the DividendProof for a given epoch number
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Number |
epoch number for which a DividendProof is to be returned |
setAsDefault |
bool |
if true, sets the inputted epochNum to be the default. If false, does not set the inputted epoch number to be the default |
- Source:
epoch(epochNum, setAsDefault)
Export the PublicRangeProof for a given epoch number
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Number |
epoch number for which a PublicRangeProof is to be returned |
setAsDefault |
bool |
if true, sets the inputted epochNum to be the default. If false, does not set the inputted epoch number to be the default |
- Source:
epoch(epochNum, setAsDefault)
Export the BurnProof for a given epoch number
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Number |
epoch number for which a BurnProof is to be returned |
setAsDefault |
bool |
if true, sets the inputted epochNum to be the default. If false, does not set the inputted epoch number to be the default |
- Source:
epoch(epochNum, setDefaultEpoch)
Export the SwapProof for a given epoch number
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Number |
epoch number for which a SwapProof is to be returned |
setDefaultEpoch |
bool |
if true, sets the inputted epochNum to be the default. If false, does not set the inputted epoch number to be the default |
- Source:
fromEventLog(logNoteData) → {Note}
Create Note instance from an event log and a spending key
Parameters:
| Name | Type | Description |
|---|---|---|
logNoteData |
string |
the note data returned from an event log |
- Source:
fromPublicKey(publicKey) → {Note}
Create Note instance from a Note public key
Parameters:
| Name | Type | Description |
|---|---|---|
publicKey |
string |
the public key for the note |
- Source:
fromViewKey(viewingKey) → {Promise}
Create Note instance from a viewing key
Parameters:
| Name | Type | Description |
|---|---|---|
viewingKey |
string |
the viewing key for the note |
- Source:
getProof(proofSelector, args)
Export the default epoch version of an AZTEC proof construction method
Parameters:
| Name | Type | Description |
|---|---|---|
proofSelector |
string |
proof type (e.g. JOIN_SPLIT, MINT etc.) to be exported |
args |
rest parameter representing the inputs to a particular proof construction |
- Source:
isInteger(number)
Check whether publicComparison is an integer
Parameters:
| Name | Type | Description |
|---|---|---|
number |
Number |
JavaScript number to be checked whether it is a float or not |
JoinSplitProof(…args)
Export the JoinSplitProof for a default epoch
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
any |
<repeatable> |
rest parameter representing the proof inputs |
- Source:
MintProof(…args)
Export the MintProof for a default epoch
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
any |
<repeatable> |
rest parameter representing proof inputs |
- Source:
mockLightNoteSet(kIn, kOut) → {Object}
Create a set of mock light notes from vectors of input and output values
Parameters:
| Name | Type | Description |
|---|---|---|
kIn |
Array.<number> |
vector of input note values |
kOut |
Array.<number> |
vector of output note values |
- Source:
(async) mockNote()
Construct a mock note directly from the setup algorithm's trapdoor key. Used for testing purposes only; we don't know the trapdoor key for the real deal.
- Source:
mockNoteSet(kIn, kOut) → {Object}
Create a set of mock notes from vectors of input and output values. This method uses a randomly generated trapdoor key instead of the trusted setup key.
Parameters:
| Name | Type | Description |
|---|---|---|
kIn |
Array.<number> |
vector of input note values |
kOut |
Array.<number> |
vector of output note values |
- Source:
noteSetOfValue(numberOfNotes, totalValue) → {Array}
Generate a set of notes with a defined total value
Parameters:
| Name | Type | Description |
|---|---|---|
numberOfNotes |
number |
number of notes |
totalValue |
number |
sum of notes |
- Source:
PrivateRangeProof(…args)
Export the PrivateRangeProof for a default epoch
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
any |
<repeatable> |
rest parameter representing the proof inputs |
- Source:
PublicRangeProof(…args)
Export the PublicRangeProof for a default epoch
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
any |
<repeatable> |
rest parameter representing the proof inputs |
- Source:
randomNoteValue(maxValue) → {BN}
Generate a random note value that is less than K_MAX
Parameters:
| Name | Type | Description |
|---|---|---|
maxValue |
number |
max value of random note |
- Source:
setDefaultEpoch(defaultEpochNum)
Set the default proof epoch for which proofs should be exported from
Parameters:
| Name | Type | Description |
|---|---|---|
defaultEpochNum |
user specified default epoch number |
- Source:
SwapProof(…args)
Export the SwapProof for a default epoch
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
args |
any |
<repeatable> |
rest parameter representing the proof inputs |
- Source:
validateEpochNum(epochNum)
Validate that the epochNum is within the correct bounds - greater than one, less than the latest epoch value
Parameters:
| Name | Type | Description |
|---|---|---|
epochNum |
Type Definitions
Note :Object
AZTEC note - encrypted representation of value, making use of the efficient AZTEC commitment function
Properties:
| Name | Type | Description |
|---|---|---|
owner |
address |
owner of the note |
noteHash |
bytes32 |
keccak256 hash of the uncompressed Note coordinates |
noteData |
bytes |
compressed AZTEC note data. Used when emitting events |
noteData |
bytes |
compressed AZTEC note data. Used when emitting events |
- Source: