Documentation ¶
Overview ¶
Package zsl is a generated protocol buffer package.
It is generated from these files:
zslbox.proto
It has these top-level messages:
ShieldedInput Note ShieldedTransferRequest VerifyShieldedTransferRequest ShieldedTransfer VerifyShieldingRequest Shielding VerifyUnshieldingRequest Unshielding ZAddress Bytes Result Void
Index ¶
- Constants
- type App
- func (app *App) BtnBindBankClicked()
- func (app *App) BtnDeployBankClicked()
- func (app *App) BtnGenerateClicked()
- func (app *App) BtnShieldClicked()
- func (app *App) BtnTransferClicked()
- func (app *App) BtnUnshieldClicked()
- func (app *App) CheckError(err error)
- func (app *App) CloseModal()
- func (app *App) CopyToClipboard(content string)
- func (app *App) FormShieldSubmitted()
- func (app *App) FormTransferSubmitted()
- func (app *App) MonitorBlockchain()
- func (app *App) MonitorEvents()
- func (app *App) OnLoad(event *js.Object)
- func (app *App) ShowSnackbar(message string)
- func (app *App) StartClock()
- func (app *App) StopClock()
- type Blockchain
- type Bytes
- type FullNote
- type JSArray
- type JSCell
- type Note
- func (m *Note) GetPk() (x []byte)
- func (m *Note) GetRho() (x []byte)
- func (m *Note) GetValue() (x uint64)
- func (m *Note) Marshal() []byte
- func (m *Note) MarshalToWriter(writer jspb.Writer)
- func (m *Note) Unmarshal(rawBytes []byte) (*Note, error)
- func (m *Note) UnmarshalFromReader(reader jspb.Reader) *Note
- type Result
- type ShieldedInput
- func (m *ShieldedInput) GetRho() (x []byte)
- func (m *ShieldedInput) GetSk() (x []byte)
- func (m *ShieldedInput) GetTreeIndex() (x uint64)
- func (m *ShieldedInput) GetTreePath() (x [][]byte)
- func (m *ShieldedInput) GetValue() (x uint64)
- func (m *ShieldedInput) Marshal() []byte
- func (m *ShieldedInput) MarshalToWriter(writer jspb.Writer)
- func (m *ShieldedInput) Unmarshal(rawBytes []byte) (*ShieldedInput, error)
- func (m *ShieldedInput) UnmarshalFromReader(reader jspb.Reader) *ShieldedInput
- type ShieldedTransfer
- func (m *ShieldedTransfer) GetCommitments() (x [][]byte)
- func (m *ShieldedTransfer) GetSendNullifiers() (x [][]byte)
- func (m *ShieldedTransfer) GetSnark() (x []byte)
- func (m *ShieldedTransfer) GetSpendNullifiers() (x [][]byte)
- func (m *ShieldedTransfer) Marshal() []byte
- func (m *ShieldedTransfer) MarshalToWriter(writer jspb.Writer)
- func (m *ShieldedTransfer) Unmarshal(rawBytes []byte) (*ShieldedTransfer, error)
- func (m *ShieldedTransfer) UnmarshalFromReader(reader jspb.Reader) *ShieldedTransfer
- type ShieldedTransferRequest
- func (m *ShieldedTransferRequest) GetInputs() (x []*ShieldedInput)
- func (m *ShieldedTransferRequest) GetOutputs() (x []*Note)
- func (m *ShieldedTransferRequest) Marshal() []byte
- func (m *ShieldedTransferRequest) MarshalToWriter(writer jspb.Writer)
- func (m *ShieldedTransferRequest) Unmarshal(rawBytes []byte) (*ShieldedTransferRequest, error)
- func (m *ShieldedTransferRequest) UnmarshalFromReader(reader jspb.Reader) *ShieldedTransferRequest
- type Shielding
- func (m *Shielding) GetCommitment() (x []byte)
- func (m *Shielding) GetSendNullifier() (x []byte)
- func (m *Shielding) GetSnark() (x []byte)
- func (m *Shielding) Marshal() []byte
- func (m *Shielding) MarshalToWriter(writer jspb.Writer)
- func (m *Shielding) Unmarshal(rawBytes []byte) (*Shielding, error)
- func (m *Shielding) UnmarshalFromReader(reader jspb.Reader) *Shielding
- type Unshielding
- func (m *Unshielding) GetSendNullifier() (x []byte)
- func (m *Unshielding) GetSnark() (x []byte)
- func (m *Unshielding) GetSpendNullifier() (x []byte)
- func (m *Unshielding) Marshal() []byte
- func (m *Unshielding) MarshalToWriter(writer jspb.Writer)
- func (m *Unshielding) Unmarshal(rawBytes []byte) (*Unshielding, error)
- func (m *Unshielding) UnmarshalFromReader(reader jspb.Reader) *Unshielding
- type VerifyShieldedTransferRequest
- func (m *VerifyShieldedTransferRequest) GetShieldedTransfer() (x *ShieldedTransfer)
- func (m *VerifyShieldedTransferRequest) GetTreeRoot() (x []byte)
- func (m *VerifyShieldedTransferRequest) Marshal() []byte
- func (m *VerifyShieldedTransferRequest) MarshalToWriter(writer jspb.Writer)
- func (m *VerifyShieldedTransferRequest) Unmarshal(rawBytes []byte) (*VerifyShieldedTransferRequest, error)
- func (m *VerifyShieldedTransferRequest) UnmarshalFromReader(reader jspb.Reader) *VerifyShieldedTransferRequest
- type VerifyShieldingRequest
- func (m *VerifyShieldingRequest) GetShielding() (x *Shielding)
- func (m *VerifyShieldingRequest) GetValue() (x uint64)
- func (m *VerifyShieldingRequest) Marshal() []byte
- func (m *VerifyShieldingRequest) MarshalToWriter(writer jspb.Writer)
- func (m *VerifyShieldingRequest) Unmarshal(rawBytes []byte) (*VerifyShieldingRequest, error)
- func (m *VerifyShieldingRequest) UnmarshalFromReader(reader jspb.Reader) *VerifyShieldingRequest
- type VerifyUnshieldingRequest
- func (m *VerifyUnshieldingRequest) GetSnark() (x []byte)
- func (m *VerifyUnshieldingRequest) GetSpendNullifier() (x []byte)
- func (m *VerifyUnshieldingRequest) GetTreeRoot() (x []byte)
- func (m *VerifyUnshieldingRequest) GetValue() (x uint64)
- func (m *VerifyUnshieldingRequest) Marshal() []byte
- func (m *VerifyUnshieldingRequest) MarshalToWriter(writer jspb.Writer)
- func (m *VerifyUnshieldingRequest) Unmarshal(rawBytes []byte) (*VerifyUnshieldingRequest, error)
- func (m *VerifyUnshieldingRequest) UnmarshalFromReader(reader jspb.Reader) *VerifyUnshieldingRequest
- type Void
- type Wallet
- func (wallet *Wallet) ConfirmNote(commitment string) error
- func (wallet *Wallet) GenerateReceiveAddress() (*ZAddress, error)
- func (wallet *Wallet) NewShielding(value uint64) (*Shielding, error)
- func (wallet *Wallet) NewTransfer(cm1 string, treeIndex1 uint64, treePath1 []string, cm2 string, ...) (*ShieldedTransfer, []*Note, error)
- func (wallet *Wallet) NewUnshielding(cm string, treeIndex uint64, treePath []string) (*Unshielding, uint64, error)
- func (wallet *Wallet) ReceivedNote(pk, rho string, value uint64)
- type ZAddress
- func (m *ZAddress) GetPk() (x []byte)
- func (m *ZAddress) GetSk() (x []byte)
- func (m *ZAddress) Marshal() []byte
- func (m *ZAddress) MarshalToWriter(writer jspb.Writer)
- func (m *ZAddress) Unmarshal(rawBytes []byte) (*ZAddress, error)
- func (m *ZAddress) UnmarshalFromReader(reader jspb.Reader) *ZAddress
- type ZSLBoxClient
Constants ¶
const ( TypeETH = "eth" TypeZETH = "zeth" TypePending = "pending" TypeSpent = "spent" TypeConfirmed = "confirmed" TypeShielding = "shielding" TypeUnshielding = "unshielding" TypeTransfer = "transfer" )
------------------------------------------------------------------------------------------------- JSArray cell types (mapped with CSS classes)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
------------------------------------------------------------------------------------------------- App data model
func NewApp ¶
func NewApp() *App
------------------------------------------------------------------------------------------------- Init functions
func (*App) BtnBindBankClicked ¶
func (app *App) BtnBindBankClicked()
func (*App) BtnDeployBankClicked ¶
func (app *App) BtnDeployBankClicked()
------------------------------------------------------------------------------------------------- Init private bank
func (*App) BtnGenerateClicked ¶
func (app *App) BtnGenerateClicked()
------------------------------------------------------------------------------------------------- Generate new key
func (*App) BtnShieldClicked ¶
func (app *App) BtnShieldClicked()
------------------------------------------------------------------------------------------------- Shielding
func (*App) BtnTransferClicked ¶
func (app *App) BtnTransferClicked()
------------------------------------------------------------------------------------------------- Shielded Transfer
func (*App) BtnUnshieldClicked ¶
func (app *App) BtnUnshieldClicked()
------------------------------------------------------------------------------------------------- Unshielding
func (*App) CheckError ¶
func (*App) CloseModal ¶
func (app *App) CloseModal()
func (*App) CopyToClipboard ¶
------------------------------------------------------------------------------------------------- Utils
func (*App) FormShieldSubmitted ¶
func (app *App) FormShieldSubmitted()
func (*App) FormTransferSubmitted ¶
func (app *App) FormTransferSubmitted()
func (*App) MonitorBlockchain ¶
func (app *App) MonitorBlockchain()
------------------------------------------------------------------------------------------------- Monitor web3js for changes
func (*App) MonitorEvents ¶
func (app *App) MonitorEvents()
------------------------------------------------------------------------------------------------- Monitor private bank events
func (*App) ShowSnackbar ¶
func (*App) StartClock ¶
func (app *App) StartClock()
type Blockchain ¶
func NewBlockchain ¶
func NewBlockchain() *Blockchain
func (*Blockchain) AddCommitment ¶
func (blockchain *Blockchain) AddCommitment(commitment string)
func (*Blockchain) AddNullifier ¶
func (blockchain *Blockchain) AddNullifier(nullifier string)
func (*Blockchain) LogEvent ¶
func (blockchain *Blockchain) LogEvent(event *ethereum.Event)
type Bytes ¶
type Bytes struct {
Bytes []byte
}
func (*Bytes) MarshalToWriter ¶
MarshalToWriter marshals Bytes to the provided writer.
type JSArray ¶
JSArray is a wrapper around a JS Array with a convenient UpdateEntry method
func NewJSArray ¶
func NewJSArray(headers ...interface{}) *JSArray
func (*JSArray) UpdateEntry ¶
UpdateEntry update or insert row with key key. if key doesn't exist, add the new row on top of the array (shift the rest)
type Note ¶
func (*Note) MarshalToWriter ¶
MarshalToWriter marshals Note to the provided writer.
type Result ¶
func (*Result) GetMessage ¶
GetMessage gets the Message of the Result.
func (*Result) MarshalToWriter ¶
MarshalToWriter marshals Result to the provided writer.
type ShieldedInput ¶
------------------------------------------------------------------------------------------------- Cross operation data structs
func (*ShieldedInput) GetRho ¶
func (m *ShieldedInput) GetRho() (x []byte)
GetRho gets the Rho of the ShieldedInput.
func (*ShieldedInput) GetSk ¶
func (m *ShieldedInput) GetSk() (x []byte)
GetSk gets the Sk of the ShieldedInput.
func (*ShieldedInput) GetTreeIndex ¶
func (m *ShieldedInput) GetTreeIndex() (x uint64)
GetTreeIndex gets the TreeIndex of the ShieldedInput.
func (*ShieldedInput) GetTreePath ¶
func (m *ShieldedInput) GetTreePath() (x [][]byte)
GetTreePath gets the TreePath of the ShieldedInput.
func (*ShieldedInput) GetValue ¶
func (m *ShieldedInput) GetValue() (x uint64)
GetValue gets the Value of the ShieldedInput.
func (*ShieldedInput) Marshal ¶
func (m *ShieldedInput) Marshal() []byte
Marshal marshals ShieldedInput to a slice of bytes.
func (*ShieldedInput) MarshalToWriter ¶
func (m *ShieldedInput) MarshalToWriter(writer jspb.Writer)
MarshalToWriter marshals ShieldedInput to the provided writer.
func (*ShieldedInput) Unmarshal ¶
func (m *ShieldedInput) Unmarshal(rawBytes []byte) (*ShieldedInput, error)
Unmarshal unmarshals a ShieldedInput from a slice of bytes.
func (*ShieldedInput) UnmarshalFromReader ¶
func (m *ShieldedInput) UnmarshalFromReader(reader jspb.Reader) *ShieldedInput
UnmarshalFromReader unmarshals a ShieldedInput from the provided reader.
type ShieldedTransfer ¶
type ShieldedTransfer struct { Snark []byte // input spend nullifiers SpendNullifiers [][]byte // output send nullifiers & commitments SendNullifiers [][]byte Commitments [][]byte }
func (*ShieldedTransfer) GetCommitments ¶
func (m *ShieldedTransfer) GetCommitments() (x [][]byte)
GetCommitments gets the Commitments of the ShieldedTransfer.
func (*ShieldedTransfer) GetSendNullifiers ¶
func (m *ShieldedTransfer) GetSendNullifiers() (x [][]byte)
GetSendNullifiers gets the SendNullifiers of the ShieldedTransfer.
func (*ShieldedTransfer) GetSnark ¶
func (m *ShieldedTransfer) GetSnark() (x []byte)
GetSnark gets the Snark of the ShieldedTransfer.
func (*ShieldedTransfer) GetSpendNullifiers ¶
func (m *ShieldedTransfer) GetSpendNullifiers() (x [][]byte)
GetSpendNullifiers gets the SpendNullifiers of the ShieldedTransfer.
func (*ShieldedTransfer) Marshal ¶
func (m *ShieldedTransfer) Marshal() []byte
Marshal marshals ShieldedTransfer to a slice of bytes.
func (*ShieldedTransfer) MarshalToWriter ¶
func (m *ShieldedTransfer) MarshalToWriter(writer jspb.Writer)
MarshalToWriter marshals ShieldedTransfer to the provided writer.
func (*ShieldedTransfer) Unmarshal ¶
func (m *ShieldedTransfer) Unmarshal(rawBytes []byte) (*ShieldedTransfer, error)
Unmarshal unmarshals a ShieldedTransfer from a slice of bytes.
func (*ShieldedTransfer) UnmarshalFromReader ¶
func (m *ShieldedTransfer) UnmarshalFromReader(reader jspb.Reader) *ShieldedTransfer
UnmarshalFromReader unmarshals a ShieldedTransfer from the provided reader.
type ShieldedTransferRequest ¶
type ShieldedTransferRequest struct { Inputs []*ShieldedInput Outputs []*Note }
------------------------------------------------------------------------------------------------- ShieldedTransfer data structs note: a shielded transfer has 2 inputs and 2 outputs (UTXO model)
func (*ShieldedTransferRequest) GetInputs ¶
func (m *ShieldedTransferRequest) GetInputs() (x []*ShieldedInput)
GetInputs gets the Inputs of the ShieldedTransferRequest.
func (*ShieldedTransferRequest) GetOutputs ¶
func (m *ShieldedTransferRequest) GetOutputs() (x []*Note)
GetOutputs gets the Outputs of the ShieldedTransferRequest.
func (*ShieldedTransferRequest) Marshal ¶
func (m *ShieldedTransferRequest) Marshal() []byte
Marshal marshals ShieldedTransferRequest to a slice of bytes.
func (*ShieldedTransferRequest) MarshalToWriter ¶
func (m *ShieldedTransferRequest) MarshalToWriter(writer jspb.Writer)
MarshalToWriter marshals ShieldedTransferRequest to the provided writer.
func (*ShieldedTransferRequest) Unmarshal ¶
func (m *ShieldedTransferRequest) Unmarshal(rawBytes []byte) (*ShieldedTransferRequest, error)
Unmarshal unmarshals a ShieldedTransferRequest from a slice of bytes.
func (*ShieldedTransferRequest) UnmarshalFromReader ¶
func (m *ShieldedTransferRequest) UnmarshalFromReader(reader jspb.Reader) *ShieldedTransferRequest
UnmarshalFromReader unmarshals a ShieldedTransferRequest from the provided reader.
type Shielding ¶
func (*Shielding) GetCommitment ¶
GetCommitment gets the Commitment of the Shielding.
func (*Shielding) GetSendNullifier ¶
GetSendNullifier gets the SendNullifier of the Shielding.
func (*Shielding) MarshalToWriter ¶
MarshalToWriter marshals Shielding to the provided writer.
type Unshielding ¶
func (*Unshielding) GetSendNullifier ¶
func (m *Unshielding) GetSendNullifier() (x []byte)
GetSendNullifier gets the SendNullifier of the Unshielding.
func (*Unshielding) GetSnark ¶
func (m *Unshielding) GetSnark() (x []byte)
GetSnark gets the Snark of the Unshielding.
func (*Unshielding) GetSpendNullifier ¶
func (m *Unshielding) GetSpendNullifier() (x []byte)
GetSpendNullifier gets the SpendNullifier of the Unshielding.
func (*Unshielding) Marshal ¶
func (m *Unshielding) Marshal() []byte
Marshal marshals Unshielding to a slice of bytes.
func (*Unshielding) MarshalToWriter ¶
func (m *Unshielding) MarshalToWriter(writer jspb.Writer)
MarshalToWriter marshals Unshielding to the provided writer.
func (*Unshielding) Unmarshal ¶
func (m *Unshielding) Unmarshal(rawBytes []byte) (*Unshielding, error)
Unmarshal unmarshals a Unshielding from a slice of bytes.
func (*Unshielding) UnmarshalFromReader ¶
func (m *Unshielding) UnmarshalFromReader(reader jspb.Reader) *Unshielding
UnmarshalFromReader unmarshals a Unshielding from the provided reader.
type VerifyShieldedTransferRequest ¶
type VerifyShieldedTransferRequest struct { ShieldedTransfer *ShieldedTransfer TreeRoot []byte }
func (*VerifyShieldedTransferRequest) GetShieldedTransfer ¶
func (m *VerifyShieldedTransferRequest) GetShieldedTransfer() (x *ShieldedTransfer)
GetShieldedTransfer gets the ShieldedTransfer of the VerifyShieldedTransferRequest.
func (*VerifyShieldedTransferRequest) GetTreeRoot ¶
func (m *VerifyShieldedTransferRequest) GetTreeRoot() (x []byte)
GetTreeRoot gets the TreeRoot of the VerifyShieldedTransferRequest.
func (*VerifyShieldedTransferRequest) Marshal ¶
func (m *VerifyShieldedTransferRequest) Marshal() []byte
Marshal marshals VerifyShieldedTransferRequest to a slice of bytes.
func (*VerifyShieldedTransferRequest) MarshalToWriter ¶
func (m *VerifyShieldedTransferRequest) MarshalToWriter(writer jspb.Writer)
MarshalToWriter marshals VerifyShieldedTransferRequest to the provided writer.
func (*VerifyShieldedTransferRequest) Unmarshal ¶
func (m *VerifyShieldedTransferRequest) Unmarshal(rawBytes []byte) (*VerifyShieldedTransferRequest, error)
Unmarshal unmarshals a VerifyShieldedTransferRequest from a slice of bytes.
func (*VerifyShieldedTransferRequest) UnmarshalFromReader ¶
func (m *VerifyShieldedTransferRequest) UnmarshalFromReader(reader jspb.Reader) *VerifyShieldedTransferRequest
UnmarshalFromReader unmarshals a VerifyShieldedTransferRequest from the provided reader.
type VerifyShieldingRequest ¶
------------------------------------------------------------------------------------------------- Shielding data structs
func (*VerifyShieldingRequest) GetShielding ¶
func (m *VerifyShieldingRequest) GetShielding() (x *Shielding)
GetShielding gets the Shielding of the VerifyShieldingRequest.
func (*VerifyShieldingRequest) GetValue ¶
func (m *VerifyShieldingRequest) GetValue() (x uint64)
GetValue gets the Value of the VerifyShieldingRequest.
func (*VerifyShieldingRequest) Marshal ¶
func (m *VerifyShieldingRequest) Marshal() []byte
Marshal marshals VerifyShieldingRequest to a slice of bytes.
func (*VerifyShieldingRequest) MarshalToWriter ¶
func (m *VerifyShieldingRequest) MarshalToWriter(writer jspb.Writer)
MarshalToWriter marshals VerifyShieldingRequest to the provided writer.
func (*VerifyShieldingRequest) Unmarshal ¶
func (m *VerifyShieldingRequest) Unmarshal(rawBytes []byte) (*VerifyShieldingRequest, error)
Unmarshal unmarshals a VerifyShieldingRequest from a slice of bytes.
func (*VerifyShieldingRequest) UnmarshalFromReader ¶
func (m *VerifyShieldingRequest) UnmarshalFromReader(reader jspb.Reader) *VerifyShieldingRequest
UnmarshalFromReader unmarshals a VerifyShieldingRequest from the provided reader.
type VerifyUnshieldingRequest ¶
type VerifyUnshieldingRequest struct { Snark []byte SpendNullifier []byte TreeRoot []byte Value uint64 }
------------------------------------------------------------------------------------------------- Unshielding data structs
func (*VerifyUnshieldingRequest) GetSnark ¶
func (m *VerifyUnshieldingRequest) GetSnark() (x []byte)
GetSnark gets the Snark of the VerifyUnshieldingRequest.
func (*VerifyUnshieldingRequest) GetSpendNullifier ¶
func (m *VerifyUnshieldingRequest) GetSpendNullifier() (x []byte)
GetSpendNullifier gets the SpendNullifier of the VerifyUnshieldingRequest.
func (*VerifyUnshieldingRequest) GetTreeRoot ¶
func (m *VerifyUnshieldingRequest) GetTreeRoot() (x []byte)
GetTreeRoot gets the TreeRoot of the VerifyUnshieldingRequest.
func (*VerifyUnshieldingRequest) GetValue ¶
func (m *VerifyUnshieldingRequest) GetValue() (x uint64)
GetValue gets the Value of the VerifyUnshieldingRequest.
func (*VerifyUnshieldingRequest) Marshal ¶
func (m *VerifyUnshieldingRequest) Marshal() []byte
Marshal marshals VerifyUnshieldingRequest to a slice of bytes.
func (*VerifyUnshieldingRequest) MarshalToWriter ¶
func (m *VerifyUnshieldingRequest) MarshalToWriter(writer jspb.Writer)
MarshalToWriter marshals VerifyUnshieldingRequest to the provided writer.
func (*VerifyUnshieldingRequest) Unmarshal ¶
func (m *VerifyUnshieldingRequest) Unmarshal(rawBytes []byte) (*VerifyUnshieldingRequest, error)
Unmarshal unmarshals a VerifyUnshieldingRequest from a slice of bytes.
func (*VerifyUnshieldingRequest) UnmarshalFromReader ¶
func (m *VerifyUnshieldingRequest) UnmarshalFromReader(reader jspb.Reader) *VerifyUnshieldingRequest
UnmarshalFromReader unmarshals a VerifyUnshieldingRequest from the provided reader.
type Void ¶
type Void struct { }
func (*Void) MarshalToWriter ¶
MarshalToWriter marshals Void to the provided writer.
type Wallet ¶
------------------------------------------------------------------------------------------------- Structs
func NewWallet ¶
func NewWallet() *Wallet
------------------------------------------------------------------------------------------------- Init
func (*Wallet) ConfirmNote ¶
ConfirmNote marks a note as mined in the blockchain
func (*Wallet) GenerateReceiveAddress ¶
------------------------------------------------------------------------------------------------- GenerateReceiveAddress generates a new key pair (pk, sk) where pk can be used as a "receive" address
func (*Wallet) NewShielding ¶
------------------------------------------------------------------------------------------------- Shielding
func (*Wallet) NewTransfer ¶
func (wallet *Wallet) NewTransfer(cm1 string, treeIndex1 uint64, treePath1 []string, cm2 string, treeIndex2 uint64, treePath2 []string, transferAddress string, transferAmount uint64) (*ShieldedTransfer, []*Note, error)
------------------------------------------------------------------------------------------------- Transfer
func (*Wallet) NewUnshielding ¶
func (wallet *Wallet) NewUnshielding(cm string, treeIndex uint64, treePath []string) (*Unshielding, uint64, error)
------------------------------------------------------------------------------------------------- Unshielding
func (*Wallet) ReceivedNote ¶
type ZAddress ¶
------------------------------------------------------------------------------------------------- Other
func (*ZAddress) MarshalToWriter ¶
MarshalToWriter marshals ZAddress to the provided writer.
type ZSLBoxClient ¶
type ZSLBoxClient interface { // CreateShielding computes a zkSNARK and a note commitment for given note. // Also returns a sendNullifier to ensure note.Rho (random) is unique CreateShielding(ctx context.Context, in *Note, opts ...grpcweb.CallOption) (*Shielding, error) // CreateUnshielding computes a zkSNARK, nullifiers for given input, using Unshielding circuit CreateUnshielding(ctx context.Context, in *ShieldedInput, opts ...grpcweb.CallOption) (*Unshielding, error) // CreateShieldedTransfer takes 2 notes as inputs (known Sk) and 2 desired output notes. // It returns the zkSNARK, the spend nullifiers for the inputs, and the commitments & send nullifiers for outputs CreateShieldedTransfer(ctx context.Context, in *ShieldedTransferRequest, opts ...grpcweb.CallOption) (*ShieldedTransfer, error) // VerifyShielding ensures that the provided Shielding proof is valid. It takes as input the zkSNARK, // the send nullifier, commitment and value of the shielded note. VerifyShielding(ctx context.Context, in *VerifyShieldingRequest, opts ...grpcweb.CallOption) (*Result, error) // VerifyUnshielding ensures that the provided Unshielding proof is valid. It takes as input the zkSNARK, // the spend nullifier, the tree root and value of the shielded note. VerifyUnshielding(ctx context.Context, in *VerifyUnshieldingRequest, opts ...grpcweb.CallOption) (*Result, error) // VerifyShieldedTransfer ensures that the provided shielded transfer proof is valid. // It takes as input the zkSNARK, treeRoot, spend nullifiers for inputs and send nullifiers & commitments // for outputs VerifyShieldedTransfer(ctx context.Context, in *VerifyShieldedTransferRequest, opts ...grpcweb.CallOption) (*Result, error) // GetCommitment returns SHA256(note.Rho || note.Pk || note.Value) // where note.Value is in little endian byte order GetCommitment(ctx context.Context, in *Note, opts ...grpcweb.CallOption) (*Bytes, error) // GetSendNullifier returns SHA256(0x00 || note.Rho) GetSendNullifier(ctx context.Context, in *Note, opts ...grpcweb.CallOption) (*Bytes, error) // GetSpendNullifier returns SHA256(0x01 || shieldedInput.Rho || shieldedInput.Sk) GetSpendNullifier(ctx context.Context, in *ShieldedInput, opts ...grpcweb.CallOption) (*Bytes, error) // GetNewAddress returns a tuple (Pk, Sk) where Pk is the paying (public) key and Sk is the secret key GetNewAddress(ctx context.Context, in *Void, opts ...grpcweb.CallOption) (*ZAddress, error) // Sha256Compress applies SHA-256 to one input block, excluding the padding step specified in [NIST2015, Section 5.1] Sha256Compress(ctx context.Context, in *Bytes, opts ...grpcweb.CallOption) (*Bytes, error) }
Provides services to compute and verify proofs for shielding, unshielding and shielded transfer operations
func NewZSLBoxClient ¶
func NewZSLBoxClient(hostname string, opts ...grpcweb.DialOption) ZSLBoxClient
NewZSLBoxClient creates a new gRPC-Web client.