Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrSizeByteSlice memory checking ErrSizeByteSlice = errors.New("Byte slice size is inconsistant with Account size") // ErrNonExistingAccount account not in the database ErrNonExistingAccount = errors.New("The account is not in the rollup database") // ErrNonConsistantAccount account not in the database ErrNonConsistantAccount = errors.New("The account provided exists but is inconsistant with what's in the database") // ErrWrongSignature wrong signature ErrWrongSignature = errors.New("Invalid signature") // ErrAmountTooHigh the amount is bigger than the balance ErrAmountTooHigh = errors.New("Amount is bigger than balance") // ErrNonce inconsistant nonce between transfer and account ErrNonce = errors.New("Incorrect nonce") )
View Source
var BatchSize = 10
BatchSize size of a batch of transactions to put in a snark
View Source
var ( // SizeAccount byte size of a serialized account (5*32bytes) // index || nonce || balance || pubkeyX || pubkeyY, each chunk is 32 bytes SizeAccount = 160 )
Functions ¶
func Deserialize ¶
Deserialize deserializes a stream of byte in an account
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account describes a rollup account
type AccountCircuit ¶
type AccountCircuit struct {
// contains filtered or unexported fields
}
AccountCircuit accounts encoded as constraints
type Operator ¶
type Operator struct { State []byte // list of accounts: index || nonce || balance || pubkeyX || pubkeyY, each chunk is 256 bits HashState []byte // Hashed version of the state, each chunk is 256bits: ... || H(index || nonce || balance || pubkeyX || pubkeyY)) || ... AccountMap map[string]uint64 // hashmap of all available accounts (the key is the account.pubkey.X), the value is the index of the account in the state // contains filtered or unexported fields }
Operator represents a rollup operator
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue queue for storing the transfers (fixed size queue)
type Transfer ¶
type Transfer struct {
// contains filtered or unexported fields
}
Transfer describe a rollup transfer
func NewTransfer ¶
NewTransfer creates a new transfer (to be signed)
type TransferCircuit ¶
type TransferCircuit struct {
// contains filtered or unexported fields
}
TransferCircuit transfer encoded as constraints
Click to show internal directories.
Click to hide internal directories.