Versions in this module Expand all Collapse all v0 v0.3.8 Oct 21, 2020 v0.3.7 Oct 21, 2020 Changes in this version + var BatchSize = 10 + var ErrAmountTooHigh = errors.New("amount is bigger than balance") + var ErrNonExistingAccount = errors.New("the account is not in the rollup database") + var ErrNonce = errors.New("incorrect nonce") + var ErrSizeByteSlice = errors.New("byte slice size is inconsistant with Account size") + var ErrWrongSignature = errors.New("invalid signature") + var SizeAccount = 160 + func Deserialize(res *Account, data []byte) error + type Account struct + func (ac *Account) Reset() + func (ac *Account) Serialize() []byte + type AccountConstraints struct + Balance frontend.Variable + Index frontend.Variable + Nonce frontend.Variable + PubKey eddsa.PublicKey + type Circuit struct + MerkleProofHelperReceiverAfter [batchSize][depth - 1]frontend.Variable + MerkleProofHelperReceiverBefore [batchSize][depth - 1]frontend.Variable + MerkleProofHelperSenderAfter [batchSize][depth - 1]frontend.Variable + MerkleProofHelperSenderBefore [batchSize][depth - 1]frontend.Variable + MerkleProofsReceiverAfter [batchSize][depth]frontend.Variable + MerkleProofsReceiverBefore [batchSize][depth]frontend.Variable + MerkleProofsSenderAfter [batchSize][depth]frontend.Variable + MerkleProofsSenderBefore [batchSize][depth]frontend.Variable + PublicKeysReceiver [batchSize]eddsa.PublicKey + PublicKeysSender [batchSize]eddsa.PublicKey + ReceiverAccountsAfter [batchSize]AccountConstraints + ReceiverAccountsBefore [batchSize]AccountConstraints + RootHashesAfter [batchSize]frontend.Variable + RootHashesBefore [batchSize]frontend.Variable + SenderAccountsAfter [batchSize]AccountConstraints + SenderAccountsBefore [batchSize]AccountConstraints + Transfers [batchSize]TransferConstraints + func (circuit *Circuit) Define(curveID gurvy.ID, cs *frontend.ConstraintSystem) error + type Operator struct + AccountMap map[string]uint64 + HashState []byte + State []byte + func NewOperator(nbAccounts int, h hash.Hash) Operator + type Queue struct + func NewQueue(batchSize int) Queue + type Transfer struct + func NewTransfer(amount uint64, from, to eddsa.PublicKey, nonce uint64) Transfer + func (t *Transfer) Sign(priv eddsa.PrivateKey, h hash.Hash) (eddsa.Signature, error) + func (t *Transfer) Verify(h hash.Hash) (bool, error) + type TransferConstraints struct + Amount frontend.Variable + Nonce frontend.Variable + ReceiverPubKey eddsa.PublicKey + SenderPubKey eddsa.PublicKey + Signature eddsa.Signature