Documentation
¶
Index ¶
- Variables
- func ComputeCommitment(note *Note) []byte
- func ComputeNullifier(note *Note, spendingKey []byte) []byte
- func EncryptNote(note *Note, recipientPubKey []byte, ephemeralPrivKey []byte) ([]byte, []byte, error)
- func NewPrivacyHandler(vm *VM) http.Handler
- func NewProofHandler(vm *VM) http.Handler
- func NewRPCHandler(vm *VM) http.Handler
- type AddressManager
- func (am *AddressManager) CanDecryptNote(ephemeralPubKey []byte, address []byte) bool
- func (am *AddressManager) Close()
- func (am *AddressManager) DeriveNullifier(address []byte, note *Note) ([]byte, error)
- func (am *AddressManager) GenerateAddress() (*PrivateAddress, error)
- func (am *AddressManager) GetAddress(address []byte) (*PrivateAddress, error)
- func (am *AddressManager) GetAddressCount() uint64
- func (am *AddressManager) GetAddressesByViewingKey(viewingKey []byte) ([]*PrivateAddress, error)
- func (am *AddressManager) SignTransaction(tx *Transaction, signingAddresses [][]byte) error
- type Block
- func (b *Block) Accept(ctx context.Context) error
- func (b *Block) Bytes() []byte
- func (b *Block) Height() uint64
- func (b *Block) ID() ids.ID
- func (b *Block) Parent() ids.ID
- func (b *Block) Reject(ctx context.Context) error
- func (b *Block) Status() choices.Status
- func (b *Block) Timestamp() time.Time
- func (b *Block) ToSummary() *BlockSummary
- func (b *Block) Verify(ctx context.Context) error
- type BlockSummary
- type FHEData
- type FHEProcessor
- func (fp *FHEProcessor) AddCiphertexts(ct1, ct2 []byte) ([]byte, error)
- func (fp *FHEProcessor) DecryptValue(ciphertext []byte, privateKey []byte) (uint64, error)
- func (fp *FHEProcessor) EncryptValue(value uint64) ([]byte, error)
- func (fp *FHEProcessor) GetStats() uint64
- func (fp *FHEProcessor) MultiplyCiphertext(ct []byte, scalar uint64) ([]byte, error)
- func (fp *FHEProcessor) ProcessFHEComputation(circuitID string, encryptedInputs [][]byte) ([]byte, []byte, error)
- func (fp *FHEProcessor) VerifyFHEOperations(tx *Transaction) error
- type Factory
- type Genesis
- type Health
- type Mempool
- func (mp *Mempool) AddTransaction(tx *Transaction) error
- func (mp *Mempool) Clear()
- func (mp *Mempool) GetPendingTransactions(limit int) []*Transaction
- func (mp *Mempool) HasNullifier(nullifier []byte) bool
- func (mp *Mempool) HasTransaction(txID ids.ID) bool
- func (mp *Mempool) PruneExpired(currentHeight uint64)
- func (mp *Mempool) RemoveTransaction(txID ids.ID)
- func (mp *Mempool) Size() int
- type MempoolTx
- type Note
- type NullifierDB
- func (ndb *NullifierDB) Close()
- func (ndb *NullifierDB) GetNullifierCount() uint64
- func (ndb *NullifierDB) GetNullifierHeight(nullifier []byte) (uint64, error)
- func (ndb *NullifierDB) GetNullifiersByHeight(height uint64) [][]byte
- func (ndb *NullifierDB) IsNullifierSpent(nullifier []byte) bool
- func (ndb *NullifierDB) MarkNullifierSpent(nullifier []byte, height uint64) error
- func (ndb *NullifierDB) PruneOldNullifiers(minHeight uint64) error
- func (ndb *NullifierDB) RemoveNullifier(nullifier []byte) error
- type PrivateAddress
- type ProofVerifier
- type SetupParams
- type ShieldedOutput
- type StateTree
- func (st *StateTree) ApplyTransaction(tx *Transaction) error
- func (st *StateTree) Close()
- func (st *StateTree) ComputeRoot() ([]byte, error)
- func (st *StateTree) Finalize(newRoot []byte) error
- func (st *StateTree) GetMerkleProof(commitment []byte) ([][]byte, error)
- func (st *StateTree) GetRoot() []byte
- func (st *StateTree) VerifyMerkleProof(commitment []byte, proof [][]byte, root []byte) bool
- type Transaction
- type TransactionType
- type TransparentInput
- type TransparentOutput
- type TxHeap
- type UTXO
- type UTXODB
- func (udb *UTXODB) AddUTXO(utxo *UTXO) error
- func (udb *UTXODB) Close()
- func (udb *UTXODB) GetAllCommitments() [][]byte
- func (udb *UTXODB) GetUTXO(commitment []byte) (*UTXO, error)
- func (udb *UTXODB) GetUTXOCount() uint64
- func (udb *UTXODB) GetUTXOsByHeight(height uint64) ([]*UTXO, error)
- func (udb *UTXODB) PruneOldUTXOs(minHeight uint64) error
- func (udb *UTXODB) RemoveUTXO(commitment []byte) error
- type VM
- func (vm *VM) AppGossip(ctx context.Context, nodeID ids.NodeID, msg []byte) error
- func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, ...) error
- func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
- func (vm *VM) BuildBlock(ctx context.Context) (chain.Block, error)
- func (vm *VM) Connected(ctx context.Context, nodeID ids.NodeID, nodeVersion *version.Application) error
- func (vm *VM) CreateHandlers(context.Context) (map[string]http.Handler, error)
- func (vm *VM) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, ...) error
- func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32, appErr *common.AppError) error
- func (vm *VM) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, response []byte) error
- func (vm *VM) Disconnected(ctx context.Context, nodeID ids.NodeID) error
- func (vm *VM) GetBlock(ctx context.Context, blkID ids.ID) (chain.Block, error)
- func (vm *VM) GetBlockIDAtHeight(ctx context.Context, height uint64) (ids.ID, error)
- func (vm *VM) HealthCheck(ctx context.Context) (interface{}, error)
- func (vm *VM) Initialize(ctx context.Context, chainCtx *snow.Context, db database.Database, ...) error
- func (vm *VM) LastAccepted(ctx context.Context) (ids.ID, error)
- func (vm *VM) ParseBlock(ctx context.Context, blockBytes []byte) (chain.Block, error)
- func (vm *VM) SetPreference(ctx context.Context, blkID ids.ID) error
- func (vm *VM) SetState(ctx context.Context, state snow.State) error
- func (vm *VM) Shutdown(ctx context.Context) error
- func (vm *VM) Version(ctx context.Context) (string, error)
- type ZConfig
- type ZKProof
Constants ¶
This section is empty.
Variables ¶
var (
Version = &version.Semantic{
Major: 1,
Minor: 0,
Patch: 0,
}
)
Functions ¶
func ComputeCommitment ¶
ComputeCommitment computes a note commitment
func ComputeNullifier ¶
ComputeNullifier computes a nullifier for a note
func EncryptNote ¶
func EncryptNote(note *Note, recipientPubKey []byte, ephemeralPrivKey []byte) ([]byte, []byte, error)
EncryptNote encrypts a note for the recipient
func NewPrivacyHandler ¶
NewPrivacyHandler creates the privacy-specific handler
func NewProofHandler ¶
NewProofHandler creates the proof-specific handler
func NewRPCHandler ¶
NewRPCHandler creates the main RPC handler
Types ¶
type AddressManager ¶
type AddressManager struct {
// contains filtered or unexported fields
}
AddressManager manages private addresses and viewing keys
func NewAddressManager ¶
func NewAddressManager(db database.Database, enablePrivate bool, log log.Logger) (*AddressManager, error)
NewAddressManager creates a new address manager
func (*AddressManager) CanDecryptNote ¶
func (am *AddressManager) CanDecryptNote(ephemeralPubKey []byte, address []byte) bool
CanDecryptNote checks if we have the keys to decrypt a note
func (*AddressManager) DeriveNullifier ¶
func (am *AddressManager) DeriveNullifier(address []byte, note *Note) ([]byte, error)
DeriveNullifier derives a nullifier using the spending key
func (*AddressManager) GenerateAddress ¶
func (am *AddressManager) GenerateAddress() (*PrivateAddress, error)
GenerateAddress generates a new private address
func (*AddressManager) GetAddress ¶
func (am *AddressManager) GetAddress(address []byte) (*PrivateAddress, error)
GetAddress retrieves an address by its public address
func (*AddressManager) GetAddressCount ¶
func (am *AddressManager) GetAddressCount() uint64
GetAddressCount returns the total number of addresses
func (*AddressManager) GetAddressesByViewingKey ¶
func (am *AddressManager) GetAddressesByViewingKey(viewingKey []byte) ([]*PrivateAddress, error)
GetAddressesByViewingKey returns all addresses associated with a viewing key
func (*AddressManager) SignTransaction ¶
func (am *AddressManager) SignTransaction(tx *Transaction, signingAddresses [][]byte) error
SignTransaction signs a transaction with the appropriate keys
type Block ¶
type Block struct {
ParentID ids.ID `json:"parentId"`
BlockHeight uint64 `json:"height"`
BlockTimestamp int64 `json:"timestamp"`
Txs []*Transaction `json:"transactions"`
StateRoot []byte `json:"stateRoot"` // Merkle tree root of UTXO set
// Aggregated proof for the block (optional)
BlockProof *ZKProof `json:"blockProof,omitempty"`
// Cached values
ID_ ids.ID
// contains filtered or unexported fields
}
Block represents a block in the ZK UTXO chain
func (*Block) ToSummary ¶
func (b *Block) ToSummary() *BlockSummary
ToSummary converts a block to a summary
type BlockSummary ¶
type BlockSummary struct {
ID ids.ID `json:"id"`
Height uint64 `json:"height"`
Timestamp int64 `json:"timestamp"`
TxCount int `json:"txCount"`
StateRoot []byte `json:"stateRoot"`
}
BlockSummary represents a lightweight block summary
type FHEData ¶
type FHEData struct {
// Encrypted computation inputs
EncryptedInputs [][]byte `json:"encryptedInputs"`
// Computation circuit
CircuitID string `json:"circuitId"`
// Encrypted result
EncryptedResult []byte `json:"encryptedResult"`
// Proof of correct computation
ComputationProof []byte `json:"computationProof"`
}
FHEData represents fully homomorphic encryption data
type FHEProcessor ¶
type FHEProcessor struct {
// contains filtered or unexported fields
}
FHEProcessor handles fully homomorphic encryption operations
func NewFHEProcessor ¶
func NewFHEProcessor(config ZConfig, log log.Logger) (*FHEProcessor, error)
NewFHEProcessor creates a new FHE processor
func (*FHEProcessor) AddCiphertexts ¶
func (fp *FHEProcessor) AddCiphertexts(ct1, ct2 []byte) ([]byte, error)
AddCiphertexts performs homomorphic addition
func (*FHEProcessor) DecryptValue ¶
func (fp *FHEProcessor) DecryptValue(ciphertext []byte, privateKey []byte) (uint64, error)
DecryptValue decrypts an FHE ciphertext
func (*FHEProcessor) EncryptValue ¶
func (fp *FHEProcessor) EncryptValue(value uint64) ([]byte, error)
EncryptValue encrypts a value using FHE
func (*FHEProcessor) GetStats ¶
func (fp *FHEProcessor) GetStats() uint64
GetStats returns FHE processing statistics
func (*FHEProcessor) MultiplyCiphertext ¶
func (fp *FHEProcessor) MultiplyCiphertext(ct []byte, scalar uint64) ([]byte, error)
MultiplyCiphertext performs homomorphic multiplication by a plaintext
func (*FHEProcessor) ProcessFHEComputation ¶
func (fp *FHEProcessor) ProcessFHEComputation( circuitID string, encryptedInputs [][]byte, ) ([]byte, []byte, error)
ProcessFHEComputation performs an FHE computation
func (*FHEProcessor) VerifyFHEOperations ¶
func (fp *FHEProcessor) VerifyFHEOperations(tx *Transaction) error
VerifyFHEOperations verifies FHE operations in a transaction
type Genesis ¶
type Genesis struct {
Timestamp int64 `json:"timestamp"`
InitialTxs []*Transaction `json:"initialTransactions,omitempty"`
// Initial setup parameters
SetupParams *SetupParams `json:"setupParams,omitempty"`
}
Genesis represents genesis data
func ParseGenesis ¶
ParseGenesis parses genesis bytes
type Health ¶
type Health struct {
DatabaseHealthy bool `json:"databaseHealthy"`
UTXOCount uint64 `json:"utxoCount"`
NullifierCount uint64 `json:"nullifierCount"`
LastBlockHeight uint64 `json:"lastBlockHeight"`
PendingBlockCount int `json:"pendingBlockCount"`
MempoolSize int `json:"mempoolSize"`
ProofCacheSize int `json:"proofCacheSize"`
}
Health represents VM health status
type Mempool ¶
type Mempool struct {
// contains filtered or unexported fields
}
Mempool manages pending transactions
func NewMempool ¶
NewMempool creates a new mempool
func (*Mempool) AddTransaction ¶
func (mp *Mempool) AddTransaction(tx *Transaction) error
AddTransaction adds a transaction to the mempool
func (*Mempool) GetPendingTransactions ¶
func (mp *Mempool) GetPendingTransactions(limit int) []*Transaction
GetPendingTransactions returns pending transactions sorted by priority
func (*Mempool) HasNullifier ¶
HasNullifier checks if a nullifier is already in the mempool
func (*Mempool) HasTransaction ¶
HasTransaction checks if a transaction is in the mempool
func (*Mempool) PruneExpired ¶
PruneExpired removes expired transactions
func (*Mempool) RemoveTransaction ¶
RemoveTransaction removes a transaction from the mempool
type MempoolTx ¶
type MempoolTx struct {
// contains filtered or unexported fields
}
MempoolTx represents a transaction in the mempool
type Note ¶
type Note struct {
Value *big.Int `json:"value"` // Encrypted amount
Address []byte `json:"address"` // Recipient address
AssetID ids.ID `json:"assetId"` // Asset type
Randomness []byte `json:"randomness"` // Note randomness
Nullifier []byte `json:"nullifier"` // Computed nullifier
}
Note represents a shielded note (internal representation)
type NullifierDB ¶
type NullifierDB struct {
// contains filtered or unexported fields
}
NullifierDB manages spent nullifiers
func NewNullifierDB ¶
NewNullifierDB creates a new nullifier database
func (*NullifierDB) GetNullifierCount ¶
func (ndb *NullifierDB) GetNullifierCount() uint64
GetNullifierCount returns the total number of spent nullifiers
func (*NullifierDB) GetNullifierHeight ¶
func (ndb *NullifierDB) GetNullifierHeight(nullifier []byte) (uint64, error)
GetNullifierHeight returns the height when a nullifier was spent
func (*NullifierDB) GetNullifiersByHeight ¶
func (ndb *NullifierDB) GetNullifiersByHeight(height uint64) [][]byte
GetNullifiersByHeight returns all nullifiers spent at a specific height
func (*NullifierDB) IsNullifierSpent ¶
func (ndb *NullifierDB) IsNullifierSpent(nullifier []byte) bool
IsNullifierSpent checks if a nullifier has been spent
func (*NullifierDB) MarkNullifierSpent ¶
func (ndb *NullifierDB) MarkNullifierSpent(nullifier []byte, height uint64) error
MarkNullifierSpent marks a nullifier as spent
func (*NullifierDB) PruneOldNullifiers ¶
func (ndb *NullifierDB) PruneOldNullifiers(minHeight uint64) error
PruneOldNullifiers removes nullifiers older than a certain height
func (*NullifierDB) RemoveNullifier ¶
func (ndb *NullifierDB) RemoveNullifier(nullifier []byte) error
RemoveNullifier removes a nullifier (used for reorg)
type PrivateAddress ¶
type PrivateAddress struct {
Address []byte `json:"address"` // Public address (32 bytes)
ViewingKey []byte `json:"viewingKey"` // Viewing key for scanning
SpendingKey []byte `json:"spendingKey"` // Spending key (private)
Diversifier []byte `json:"diversifier"` // Address diversifier
IncomingViewKey []byte `json:"incomingViewKey"` // For incoming payments only
CreatedAt int64 `json:"createdAt"`
}
PrivateAddress represents a private address
type ProofVerifier ¶
type ProofVerifier struct {
// contains filtered or unexported fields
}
ProofVerifier verifies zero-knowledge proofs
func NewProofVerifier ¶
func NewProofVerifier(config ZConfig, log log.Logger) (*ProofVerifier, error)
NewProofVerifier creates a new proof verifier
func (*ProofVerifier) ClearCache ¶
func (pv *ProofVerifier) ClearCache()
ClearCache clears the proof verification cache
func (*ProofVerifier) GetCacheSize ¶
func (pv *ProofVerifier) GetCacheSize() int
GetCacheSize returns the current size of the proof cache
func (*ProofVerifier) GetStats ¶
func (pv *ProofVerifier) GetStats() (verifyCount, cacheHits, cacheMisses uint64)
GetStats returns verifier statistics
func (*ProofVerifier) VerifyBlockProof ¶
func (pv *ProofVerifier) VerifyBlockProof(block *Block) error
VerifyBlockProof verifies an aggregated block proof
func (*ProofVerifier) VerifyTransactionProof ¶
func (pv *ProofVerifier) VerifyTransactionProof(tx *Transaction) error
VerifyTransactionProof verifies a transaction's zero-knowledge proof
type SetupParams ¶
type SetupParams struct {
// Groth16 CRS
PowersOfTau []byte `json:"powersOfTau,omitempty"`
VerifyingKey []byte `json:"verifyingKey,omitempty"`
// PLONK setup
PlonkSRS []byte `json:"plonkSRS,omitempty"`
// FHE parameters
FHEPublicParams []byte `json:"fhePublicParams,omitempty"`
}
SetupParams contains trusted setup parameters
type ShieldedOutput ¶
type ShieldedOutput struct {
// Commitment to the note (amount and address)
Commitment []byte `json:"commitment"`
// Encrypted note ciphertext
EncryptedNote []byte `json:"encryptedNote"`
// Ephemeral public key for note encryption
EphemeralPubKey []byte `json:"ephemeralPubKey"`
// Output proof (rangeproof for amount)
OutputProof []byte `json:"outputProof"`
}
ShieldedOutput represents a confidential output
type StateTree ¶
type StateTree struct {
// contains filtered or unexported fields
}
StateTree manages the Merkle tree of the UTXO set
func NewStateTree ¶
NewStateTree creates a new state tree
func (*StateTree) ApplyTransaction ¶
func (st *StateTree) ApplyTransaction(tx *Transaction) error
ApplyTransaction applies a transaction to the state tree
func (*StateTree) ComputeRoot ¶
ComputeRoot computes the new Merkle root after pending changes
func (*StateTree) GetMerkleProof ¶
GetMerkleProof generates a Merkle proof for a commitment
type Transaction ¶
type Transaction struct {
ID ids.ID `json:"id"`
Type TransactionType `json:"type"`
Version uint8 `json:"version"`
// Transparent inputs/outputs (for shield/unshield)
TransparentInputs []*TransparentInput `json:"transparentInputs,omitempty"`
TransparentOutputs []*TransparentOutput `json:"transparentOutputs,omitempty"`
// Shielded components
Nullifiers [][]byte `json:"nullifiers"` // Spent note nullifiers
Outputs []*ShieldedOutput `json:"outputs"` // New shielded outputs
// Zero-knowledge proof
Proof *ZKProof `json:"proof"`
// FHE operations (optional)
FHEData *FHEData `json:"fheData,omitempty"`
// Transaction metadata
Fee uint64 `json:"fee"`
Expiry uint64 `json:"expiry"` // Block height
Memo []byte `json:"memo,omitempty"` // Encrypted memo
// Signature for transparent components
Signature []byte `json:"signature,omitempty"`
}
Transaction represents a confidential transaction
func (*Transaction) ComputeID ¶
func (tx *Transaction) ComputeID() ids.ID
ComputeID computes the transaction ID
func (*Transaction) GetNullifiers ¶
func (tx *Transaction) GetNullifiers() [][]byte
GetNullifiers returns all nullifiers in the transaction
func (*Transaction) GetOutputCommitments ¶
func (tx *Transaction) GetOutputCommitments() [][]byte
GetOutputCommitments returns all output commitments
func (*Transaction) HasFHEOperations ¶
func (tx *Transaction) HasFHEOperations() bool
HasFHEOperations returns true if the transaction includes FHE operations
func (*Transaction) ValidateBasic ¶
func (tx *Transaction) ValidateBasic() error
ValidateBasic performs basic validation
type TransactionType ¶
type TransactionType uint8
TransactionType represents the type of transaction
const ( TransactionTypeTransfer TransactionType = iota TransactionTypeMint TransactionTypeBurn TransactionTypeShield // Convert transparent to shielded TransactionTypeUnshield // Convert shielded to transparent )
type TransparentInput ¶
type TransparentInput struct {
TxID ids.ID `json:"txId"`
OutputIdx uint32 `json:"outputIdx"`
Amount uint64 `json:"amount"`
Address []byte `json:"address"`
}
TransparentInput represents an unshielded input
type TransparentOutput ¶
type TransparentOutput struct {
Amount uint64 `json:"amount"`
Address []byte `json:"address"`
AssetID ids.ID `json:"assetId"`
}
TransparentOutput represents an unshielded output
type UTXO ¶
type UTXO struct {
TxID ids.ID `json:"txId"`
OutputIndex uint32 `json:"outputIndex"`
Commitment []byte `json:"commitment"` // Output commitment
Ciphertext []byte `json:"ciphertext"` // Encrypted note
EphemeralPK []byte `json:"ephemeralPK"` // Ephemeral public key
Height uint64 `json:"height"` // Block height when created
}
UTXO represents an unspent transaction output
type UTXODB ¶
type UTXODB struct {
// contains filtered or unexported fields
}
UTXODB manages the UTXO set
func (*UTXODB) GetAllCommitments ¶
GetAllCommitments returns all UTXO commitments (for Merkle tree)
func (*UTXODB) GetUTXOCount ¶
GetUTXOCount returns the total number of UTXOs
func (*UTXODB) GetUTXOsByHeight ¶
GetUTXOsByHeight returns all UTXOs created at a specific height
func (*UTXODB) PruneOldUTXOs ¶
PruneOldUTXOs removes UTXOs older than a certain height
func (*UTXODB) RemoveUTXO ¶
RemoveUTXO removes a UTXO from the set
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM implements the Zero-Knowledge UTXO Chain VM
func (*VM) AppRequest ¶
func (vm *VM) AppRequest(ctx context.Context, nodeID ids.NodeID, requestID uint32, deadline time.Time, request []byte) error
AppRequest implements the common.VM interface
func (*VM) AppRequestFailed ¶
func (vm *VM) AppRequestFailed(ctx context.Context, nodeID ids.NodeID, requestID uint32, appErr *common.AppError) error
AppRequestFailed implements the common.VM interface
func (*VM) AppResponse ¶
func (vm *VM) AppResponse(ctx context.Context, nodeID ids.NodeID, requestID uint32, response []byte) error
AppResponse implements the common.VM interface
func (*VM) BuildBlock ¶
BuildBlock builds a new block
func (*VM) CreateHandlers ¶
CreateHandlers returns the VM handlers
func (*VM) CrossChainAppRequest ¶
func (vm *VM) CrossChainAppRequest(ctx context.Context, chainID ids.ID, requestID uint32, deadline time.Time, request []byte) error
CrossChainAppRequest implements the common.VM interface
func (*VM) CrossChainAppRequestFailed ¶
func (vm *VM) CrossChainAppRequestFailed(ctx context.Context, chainID ids.ID, requestID uint32, appErr *common.AppError) error
CrossChainAppRequestFailed implements the common.VM interface
func (*VM) CrossChainAppResponse ¶
func (vm *VM) CrossChainAppResponse(ctx context.Context, chainID ids.ID, requestID uint32, response []byte) error
CrossChainAppResponse implements the common.VM interface
func (*VM) GetBlockIDAtHeight ¶
GetBlockIDAtHeight implements the snowman.HeightIndexedChainVM interface
func (*VM) HealthCheck ¶
HealthCheck performs a health check
func (*VM) Initialize ¶
func (vm *VM) Initialize( ctx context.Context, chainCtx *snow.Context, db database.Database, genesisBytes []byte, upgradeBytes []byte, configBytes []byte, toEngine chan<- common.Message, fxs []*common.Fx, appSender common.AppSender, ) error
Initialize initializes the VM
func (*VM) ParseBlock ¶
ParseBlock parses a block from bytes
func (*VM) SetPreference ¶
Additional interface implementations
type ZConfig ¶
type ZConfig struct {
// Privacy configuration
EnableConfidentialTransfers bool `json:"enableConfidentialTransfers"`
EnablePrivateAddresses bool `json:"enablePrivateAddresses"`
// ZK proof configuration
ProofSystem string `json:"proofSystem"` // groth16, plonk, etc.
CircuitType string `json:"circuitType"` // transfer, mint, burn
VerifyingKeyPath string `json:"verifyingKeyPath"`
TrustedSetupPath string `json:"trustedSetupPath"`
// FHE configuration
EnableFHE bool `json:"enableFHE"`
FHEScheme string `json:"fheScheme"` // BFV, CKKS, etc.
SecurityLevel int `json:"securityLevel"` // 128, 192, 256
// Performance
MaxUTXOsPerBlock int `json:"maxUtxosPerBlock"`
ProofVerificationTimeout time.Duration `json:"proofVerificationTimeout"`
ProofCacheSize int `json:"proofCacheSize"`
}
ZConfig contains VM configuration