Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddEphKeyRequest ¶
type AddEphKeyRequest struct {
// The list of keys to add the ephemeral key to.
KeyIDList []string `json:"key_id_list" validate:"required"`
}
type KeygenOpts ¶
type KeygenOpts struct {
// T is the signature threshold (how many key shares are required to generate signature).
T uint8 `json:"t" validate:"required,min=2"`
// N is the number of key shares.
N uint8 `json:"n" validate:"required"`
// Metadata is a collection of tagged values to be associated with a key share.
// All shares will contain the same set of pairs.
Metadata []types.TaggedValue `json:"metadata" validate:"required"`
// SignAlg is the chosen signature algorithm for key generation.
SignAlg types.SignatureAlgorithm `json:"signAlg" validate:"required"`
}
KeygenOpts represents parameters for distributed key generation.
func (*KeygenOpts) UnmarshalJSON ¶
func (k *KeygenOpts) UnmarshalJSON(data []byte) error
type QuorumChangeRequest ¶
type QuorumChangeRequest struct {
// New threshold
NewT uint8 `json:"new_t" validate:"required,min=2"`
// New quorum nodes (new_n). Old quorum nodes (n).
//
// (new_n >= n || new_n <= n) && new_n >= new_t
NewNodes *[]string `json:"new_nodes,omitempty" validate:"omitempty"`
// ID of the previously generated distributed key, in hex
KeyID string `json:"key_id" validate:"required"`
// Public key of the generated key. Affine representation in hex.
PublicKey string `json:"public_key" validate:"required"`
// Signature algorithm of the key
SignAlg types.SignatureAlgorithm `json:"sign_alg" validate:"required"`
}
Parameters for quorum change protocol.
func (*QuorumChangeRequest) UnmarshalJSON ¶
func (q *QuorumChangeRequest) UnmarshalJSON(data []byte) error
type RevokeEphKeyRequest ¶
type RevokeEphKeyRequest struct {
// The associated ephemeral key of this key will be revoked.
KeyID string `json:"key_id" validate:"required"`
}
type SignOpts ¶
type SignOpts struct {
/// Signature threshold (how many key shares are required to generate signature)
T uint8 `json:"t" validate:"required,min=2"`
/// id of the previously generated distributed key, in hex
KeyID string `json:"key_id" validate:"required"`
/// Message to be signed
/// Structure format: HashMap<TransactionId, Transaction>
Message string `json:"message" validate:"required"`
/// Chosen signature algorithm for signing
SignAlg types.SignatureAlgorithm `json:"signAlg" validate:"required"`
}
Parameters for distributed signature generation.
type WpRequest ¶
type WpRequest struct {
Payload WpRequestPayload `json:"payload"`
}
Represents the structure of wallet provider requests which will be sent to the network.
type WpRequestPayload ¶
type WpRequestPayload struct {
Keygen *[]KeygenOpts `json:"-"` // untagged, so no direct JSON field name
Sign *SignOpts `json:"-"`
AddEphKey *AddEphKeyRequest `json:"-"`
RevokeEphKey *RevokeEphKeyRequest `json:"-"`
QuorumChange *QuorumChangeRequest `json:"-"`
}
func (WpRequestPayload) GetSerializedBatch ¶
func (w WpRequestPayload) GetSerializedBatch() (map[string][]byte, error)
GetSerializedBatch returns a map of serialized request payloads.
func (WpRequestPayload) MarshalJSON ¶
func (w WpRequestPayload) MarshalJSON() ([]byte, error)
ensuring only the active payload is marshaled directly
func (*WpRequestPayload) String ¶
func (w *WpRequestPayload) String() string
func (WpRequestPayload) ToBytes ¶
func (w WpRequestPayload) ToBytes() ([]byte, error)
ToBytes serializes the WpRequestPayload to canonical JSON bytes (JCS).
func (*WpRequestPayload) UnmarshalJSON ¶
func (w *WpRequestPayload) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.