public class CommitmentTree extends Object implements AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
boolean |
addBtr(byte[] scId,
long scFee,
byte[] mcDestinationAddress,
byte[][] scRequestData,
byte[] txHash,
int outIdx) |
boolean |
addCert(byte[] scId,
int epochNumber,
long quality,
BackwardTransfer[] btList,
Optional<byte[][]> customFieldsOpt,
byte[] endCumulativeScTxCommitmentTreeRoot,
long btrFee,
long ftMinAmount) |
boolean |
addCertLeaf(byte[] scId,
byte[] leaf) |
boolean |
addCsw(byte[] scId,
long amount,
byte[] nullifier,
byte[] mcPubKeyHash) |
boolean |
addFwt(byte[] scId,
long amount,
byte[] pubKey,
byte[] mcReturnAddress,
byte[] txHash,
int outIdx) |
boolean |
addScCr(byte[] scId,
long amount,
byte[] pubKey,
byte[] txHash,
int outIdx,
int withdrawalEpochLength,
byte mcBtrRequestDataLength,
CustomFieldElementsConfig[] customFieldElementsConfigs,
CustomBitvectorElementsConfig[] customBitvectorElementsConfigs,
long btrFee,
long ftMinAmount,
byte[] customCreationData,
Optional<byte[]> constantOpt,
byte[] certVerificationKey,
Optional<byte[]> cswVerificationKeyOpt) |
void |
close() |
void |
freeCommitmentTree() |
Optional<FieldElement> |
getBtrCommitment(byte[] scId) |
Optional<FieldElement> |
getCertCommitment(byte[] scId) |
Optional<FieldElement> |
getCommitment() |
Optional<List<FieldElement>> |
getCrtLeaves(byte[] scId) |
Optional<FieldElement> |
getCswCommitment(byte[] scId) |
Optional<FieldElement> |
getFwtCommitment(byte[] scId) |
Optional<ScAbsenceProof> |
getScAbsenceProof(byte[] scId) |
Optional<FieldElement> |
getScCommitment(byte[] scId) |
Optional<FieldElement> |
getScCrCommitment(byte[] scId) |
Optional<ScExistenceProof> |
getScExistenceProof(byte[] scId) |
static CommitmentTree |
init() |
boolean |
nativeAddCertLeaf(byte[] scId,
byte[] leaf) |
static boolean |
verifyScAbsence(byte[] scId,
ScAbsenceProof absenceProof,
FieldElement commitment) |
static boolean |
verifyScCommitment(FieldElement scCommitment,
ScExistenceProof existenceProof,
FieldElement commitment) |
public static CommitmentTree init()
public void freeCommitmentTree()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic boolean addScCr(byte[] scId,
long amount,
byte[] pubKey,
byte[] txHash,
int outIdx,
int withdrawalEpochLength,
byte mcBtrRequestDataLength,
CustomFieldElementsConfig[] customFieldElementsConfigs,
CustomBitvectorElementsConfig[] customBitvectorElementsConfigs,
long btrFee,
long ftMinAmount,
byte[] customCreationData,
Optional<byte[]> constantOpt,
byte[] certVerificationKey,
Optional<byte[]> cswVerificationKeyOpt)
public boolean addFwt(byte[] scId,
long amount,
byte[] pubKey,
byte[] mcReturnAddress,
byte[] txHash,
int outIdx)
public boolean addBtr(byte[] scId,
long scFee,
byte[] mcDestinationAddress,
byte[][] scRequestData,
byte[] txHash,
int outIdx)
public boolean addCert(byte[] scId,
int epochNumber,
long quality,
BackwardTransfer[] btList,
Optional<byte[][]> customFieldsOpt,
byte[] endCumulativeScTxCommitmentTreeRoot,
long btrFee,
long ftMinAmount)
public boolean nativeAddCertLeaf(byte[] scId,
byte[] leaf)
public boolean addCertLeaf(byte[] scId,
byte[] leaf)
public boolean addCsw(byte[] scId,
long amount,
byte[] nullifier,
byte[] mcPubKeyHash)
public Optional<List<FieldElement>> getCrtLeaves(byte[] scId)
public Optional<FieldElement> getScCrCommitment(byte[] scId)
public Optional<FieldElement> getFwtCommitment(byte[] scId)
public Optional<FieldElement> getBtrCommitment(byte[] scId)
public Optional<FieldElement> getCertCommitment(byte[] scId)
public Optional<FieldElement> getCswCommitment(byte[] scId)
public Optional<FieldElement> getScCommitment(byte[] scId)
public Optional<FieldElement> getCommitment()
public Optional<ScExistenceProof> getScExistenceProof(byte[] scId)
public static boolean verifyScCommitment(FieldElement scCommitment, ScExistenceProof existenceProof, FieldElement commitment)
public Optional<ScAbsenceProof> getScAbsenceProof(byte[] scId)
public static boolean verifyScAbsence(byte[] scId,
ScAbsenceProof absenceProof,
FieldElement commitment)
Copyright © 2020–2021. All rights reserved.