Documentation
¶
Index ¶
- func DisableLog()
- func RegisterSignerServer(s *grpc.Server, srv SignerServer)
- func UseLogger(logger btclog.Logger)
- type Config
- type InputScript
- func (*InputScript) Descriptor() ([]byte, []int)
- func (m *InputScript) GetSigScript() []byte
- func (m *InputScript) GetWitness() [][]byte
- func (*InputScript) ProtoMessage()
- func (m *InputScript) Reset()
- func (m *InputScript) String() string
- func (m *InputScript) XXX_DiscardUnknown()
- func (m *InputScript) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *InputScript) XXX_Merge(src proto.Message)
- func (m *InputScript) XXX_Size() int
- func (m *InputScript) XXX_Unmarshal(b []byte) error
- type InputScriptResp
- func (*InputScriptResp) Descriptor() ([]byte, []int)
- func (m *InputScriptResp) GetInputScripts() []*InputScript
- func (*InputScriptResp) ProtoMessage()
- func (m *InputScriptResp) Reset()
- func (m *InputScriptResp) String() string
- func (m *InputScriptResp) XXX_DiscardUnknown()
- func (m *InputScriptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *InputScriptResp) XXX_Merge(src proto.Message)
- func (m *InputScriptResp) XXX_Size() int
- func (m *InputScriptResp) XXX_Unmarshal(b []byte) error
- type KeyDescriptor
- func (*KeyDescriptor) Descriptor() ([]byte, []int)
- func (m *KeyDescriptor) GetKeyLoc() *KeyLocator
- func (m *KeyDescriptor) GetRawKeyBytes() []byte
- func (*KeyDescriptor) ProtoMessage()
- func (m *KeyDescriptor) Reset()
- func (m *KeyDescriptor) String() string
- func (m *KeyDescriptor) XXX_DiscardUnknown()
- func (m *KeyDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *KeyDescriptor) XXX_Merge(src proto.Message)
- func (m *KeyDescriptor) XXX_Size() int
- func (m *KeyDescriptor) XXX_Unmarshal(b []byte) error
- type KeyLocator
- func (*KeyLocator) Descriptor() ([]byte, []int)
- func (m *KeyLocator) GetKeyFamily() int32
- func (m *KeyLocator) GetKeyIndex() int32
- func (*KeyLocator) ProtoMessage()
- func (m *KeyLocator) Reset()
- func (m *KeyLocator) String() string
- func (m *KeyLocator) XXX_DiscardUnknown()
- func (m *KeyLocator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *KeyLocator) XXX_Merge(src proto.Message)
- func (m *KeyLocator) XXX_Size() int
- func (m *KeyLocator) XXX_Unmarshal(b []byte) error
- type SignDescriptor
- func (*SignDescriptor) Descriptor() ([]byte, []int)
- func (m *SignDescriptor) GetDoubleTweak() []byte
- func (m *SignDescriptor) GetInputIndex() int32
- func (m *SignDescriptor) GetKeyDesc() *KeyDescriptor
- func (m *SignDescriptor) GetOutput() *TxOut
- func (m *SignDescriptor) GetSighash() uint32
- func (m *SignDescriptor) GetSingleTweak() []byte
- func (m *SignDescriptor) GetWitnessScript() []byte
- func (*SignDescriptor) ProtoMessage()
- func (m *SignDescriptor) Reset()
- func (m *SignDescriptor) String() string
- func (m *SignDescriptor) XXX_DiscardUnknown()
- func (m *SignDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignDescriptor) XXX_Merge(src proto.Message)
- func (m *SignDescriptor) XXX_Size() int
- func (m *SignDescriptor) XXX_Unmarshal(b []byte) error
- type SignReq
- func (*SignReq) Descriptor() ([]byte, []int)
- func (m *SignReq) GetRawTxBytes() []byte
- func (m *SignReq) GetSignDescs() []*SignDescriptor
- func (*SignReq) ProtoMessage()
- func (m *SignReq) Reset()
- func (m *SignReq) String() string
- func (m *SignReq) XXX_DiscardUnknown()
- func (m *SignReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignReq) XXX_Merge(src proto.Message)
- func (m *SignReq) XXX_Size() int
- func (m *SignReq) XXX_Unmarshal(b []byte) error
- type SignResp
- func (*SignResp) Descriptor() ([]byte, []int)
- func (m *SignResp) GetRawSigs() [][]byte
- func (*SignResp) ProtoMessage()
- func (m *SignResp) Reset()
- func (m *SignResp) String() string
- func (m *SignResp) XXX_DiscardUnknown()
- func (m *SignResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignResp) XXX_Merge(src proto.Message)
- func (m *SignResp) XXX_Size() int
- func (m *SignResp) XXX_Unmarshal(b []byte) error
- type SignerClient
- type SignerServer
- type TxOut
- func (*TxOut) Descriptor() ([]byte, []int)
- func (m *TxOut) GetPkScript() []byte
- func (m *TxOut) GetValue() int64
- func (*TxOut) ProtoMessage()
- func (m *TxOut) Reset()
- func (m *TxOut) String() string
- func (m *TxOut) XXX_DiscardUnknown()
- func (m *TxOut) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TxOut) XXX_Merge(src proto.Message)
- func (m *TxOut) XXX_Size() int
- func (m *TxOut) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until UseLogger is called.
func RegisterSignerServer ¶
func RegisterSignerServer(s *grpc.Server, srv SignerServer)
Types ¶
type InputScript ¶
type InputScript struct {
// / The serializes witness stack for the specified input.
Witness [][]byte `protobuf:"bytes,1,rep,name=witness,proto3" json:"witness,omitempty"`
// **
// The optional sig script for the specified witness that will only be set if
// the input specified is a nested p2sh witness program.
SigScript []byte `protobuf:"bytes,2,opt,name=sig_script,json=sigScript,proto3" json:"sig_script,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*InputScript) Descriptor ¶
func (*InputScript) Descriptor() ([]byte, []int)
func (*InputScript) GetSigScript ¶
func (m *InputScript) GetSigScript() []byte
func (*InputScript) GetWitness ¶
func (m *InputScript) GetWitness() [][]byte
func (*InputScript) ProtoMessage ¶
func (*InputScript) ProtoMessage()
func (*InputScript) Reset ¶
func (m *InputScript) Reset()
func (*InputScript) String ¶
func (m *InputScript) String() string
func (*InputScript) XXX_DiscardUnknown ¶
func (m *InputScript) XXX_DiscardUnknown()
func (*InputScript) XXX_Marshal ¶
func (m *InputScript) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*InputScript) XXX_Merge ¶
func (dst *InputScript) XXX_Merge(src proto.Message)
func (*InputScript) XXX_Size ¶
func (m *InputScript) XXX_Size() int
func (*InputScript) XXX_Unmarshal ¶
func (m *InputScript) XXX_Unmarshal(b []byte) error
type InputScriptResp ¶
type InputScriptResp struct {
// / The set of fully valid input scripts requested.
InputScripts []*InputScript `protobuf:"bytes,1,rep,name=input_scripts,json=inputScripts,proto3" json:"input_scripts,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*InputScriptResp) Descriptor ¶
func (*InputScriptResp) Descriptor() ([]byte, []int)
func (*InputScriptResp) GetInputScripts ¶
func (m *InputScriptResp) GetInputScripts() []*InputScript
func (*InputScriptResp) ProtoMessage ¶
func (*InputScriptResp) ProtoMessage()
func (*InputScriptResp) Reset ¶
func (m *InputScriptResp) Reset()
func (*InputScriptResp) String ¶
func (m *InputScriptResp) String() string
func (*InputScriptResp) XXX_DiscardUnknown ¶
func (m *InputScriptResp) XXX_DiscardUnknown()
func (*InputScriptResp) XXX_Marshal ¶
func (m *InputScriptResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*InputScriptResp) XXX_Merge ¶
func (dst *InputScriptResp) XXX_Merge(src proto.Message)
func (*InputScriptResp) XXX_Size ¶
func (m *InputScriptResp) XXX_Size() int
func (*InputScriptResp) XXX_Unmarshal ¶
func (m *InputScriptResp) XXX_Unmarshal(b []byte) error
type KeyDescriptor ¶
type KeyDescriptor struct {
// *
// The raw bytes of the key being identified. Either this or the KeyLocator
// must be specified.
RawKeyBytes []byte `protobuf:"bytes,1,opt,name=raw_key_bytes,json=rawKeyBytes,proto3" json:"raw_key_bytes,omitempty"`
// *
// The key locator that identifies which key to use for signing. Either this
// or the raw bytes of the target key must be specified.
KeyLoc *KeyLocator `protobuf:"bytes,2,opt,name=key_loc,json=keyLoc,proto3" json:"key_loc,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*KeyDescriptor) Descriptor ¶
func (*KeyDescriptor) Descriptor() ([]byte, []int)
func (*KeyDescriptor) GetKeyLoc ¶
func (m *KeyDescriptor) GetKeyLoc() *KeyLocator
func (*KeyDescriptor) GetRawKeyBytes ¶
func (m *KeyDescriptor) GetRawKeyBytes() []byte
func (*KeyDescriptor) ProtoMessage ¶
func (*KeyDescriptor) ProtoMessage()
func (*KeyDescriptor) Reset ¶
func (m *KeyDescriptor) Reset()
func (*KeyDescriptor) String ¶
func (m *KeyDescriptor) String() string
func (*KeyDescriptor) XXX_DiscardUnknown ¶
func (m *KeyDescriptor) XXX_DiscardUnknown()
func (*KeyDescriptor) XXX_Marshal ¶
func (m *KeyDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*KeyDescriptor) XXX_Merge ¶
func (dst *KeyDescriptor) XXX_Merge(src proto.Message)
func (*KeyDescriptor) XXX_Size ¶
func (m *KeyDescriptor) XXX_Size() int
func (*KeyDescriptor) XXX_Unmarshal ¶
func (m *KeyDescriptor) XXX_Unmarshal(b []byte) error
type KeyLocator ¶
type KeyLocator struct {
// / The family of key being identified.
KeyFamily int32 `protobuf:"varint,1,opt,name=key_family,json=keyFamily,proto3" json:"key_family,omitempty"`
// / The precise index of the key being identified.
KeyIndex int32 `protobuf:"varint,2,opt,name=key_index,json=keyIndex,proto3" json:"key_index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*KeyLocator) Descriptor ¶
func (*KeyLocator) Descriptor() ([]byte, []int)
func (*KeyLocator) GetKeyFamily ¶
func (m *KeyLocator) GetKeyFamily() int32
func (*KeyLocator) GetKeyIndex ¶
func (m *KeyLocator) GetKeyIndex() int32
func (*KeyLocator) ProtoMessage ¶
func (*KeyLocator) ProtoMessage()
func (*KeyLocator) Reset ¶
func (m *KeyLocator) Reset()
func (*KeyLocator) String ¶
func (m *KeyLocator) String() string
func (*KeyLocator) XXX_DiscardUnknown ¶
func (m *KeyLocator) XXX_DiscardUnknown()
func (*KeyLocator) XXX_Marshal ¶
func (m *KeyLocator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*KeyLocator) XXX_Merge ¶
func (dst *KeyLocator) XXX_Merge(src proto.Message)
func (*KeyLocator) XXX_Size ¶
func (m *KeyLocator) XXX_Size() int
func (*KeyLocator) XXX_Unmarshal ¶
func (m *KeyLocator) XXX_Unmarshal(b []byte) error
type SignDescriptor ¶
type SignDescriptor struct {
// *
// A descriptor that precisely describes *which* key to use for signing. This
// may provide the raw public key directly, or require the Signer to re-derive
// the key according to the populated derivation path.
KeyDesc *KeyDescriptor `protobuf:"bytes,1,opt,name=key_desc,json=keyDesc,proto3" json:"key_desc,omitempty"`
// *
// A scalar value that will be added to the private key corresponding to the
// above public key to obtain the private key to be used to sign this input.
// This value is typically derived via the following computation:
//
// derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N
SingleTweak []byte `protobuf:"bytes,2,opt,name=single_tweak,json=singleTweak,proto3" json:"single_tweak,omitempty"`
// *
// A private key that will be used in combination with its corresponding
// private key to derive the private key that is to be used to sign the target
// input. Within the Lightning protocol, this value is typically the
// commitment secret from a previously revoked commitment transaction. This
// value is in combination with two hash values, and the original private key
// to derive the private key to be used when signing.
//
// k = (privKey*sha256(pubKey || tweakPub) +
// tweakPriv*sha256(tweakPub || pubKey)) mod N
DoubleTweak []byte `protobuf:"bytes,3,opt,name=double_tweak,json=doubleTweak,proto3" json:"double_tweak,omitempty"`
// *
// The full script required to properly redeem the output. This field will
// only be populated if a p2wsh or a p2sh output is being signed.
WitnessScript []byte `protobuf:"bytes,4,opt,name=witness_script,json=witnessScript,proto3" json:"witness_script,omitempty"`
// *
// A description of the output being spent. The value and script MUST be provided.
Output *TxOut `protobuf:"bytes,5,opt,name=output,proto3" json:"output,omitempty"`
// *
// The target sighash type that should be used when generating the final
// sighash, and signature.
Sighash uint32 `protobuf:"varint,7,opt,name=sighash,proto3" json:"sighash,omitempty"`
// *
// The target input within the transaction that should be signed.
InputIndex int32 `protobuf:"varint,8,opt,name=input_index,json=inputIndex,proto3" json:"input_index,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*SignDescriptor) Descriptor ¶
func (*SignDescriptor) Descriptor() ([]byte, []int)
func (*SignDescriptor) GetDoubleTweak ¶
func (m *SignDescriptor) GetDoubleTweak() []byte
func (*SignDescriptor) GetInputIndex ¶
func (m *SignDescriptor) GetInputIndex() int32
func (*SignDescriptor) GetKeyDesc ¶
func (m *SignDescriptor) GetKeyDesc() *KeyDescriptor
func (*SignDescriptor) GetOutput ¶
func (m *SignDescriptor) GetOutput() *TxOut
func (*SignDescriptor) GetSighash ¶
func (m *SignDescriptor) GetSighash() uint32
func (*SignDescriptor) GetSingleTweak ¶
func (m *SignDescriptor) GetSingleTweak() []byte
func (*SignDescriptor) GetWitnessScript ¶
func (m *SignDescriptor) GetWitnessScript() []byte
func (*SignDescriptor) ProtoMessage ¶
func (*SignDescriptor) ProtoMessage()
func (*SignDescriptor) Reset ¶
func (m *SignDescriptor) Reset()
func (*SignDescriptor) String ¶
func (m *SignDescriptor) String() string
func (*SignDescriptor) XXX_DiscardUnknown ¶
func (m *SignDescriptor) XXX_DiscardUnknown()
func (*SignDescriptor) XXX_Marshal ¶
func (m *SignDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignDescriptor) XXX_Merge ¶
func (dst *SignDescriptor) XXX_Merge(src proto.Message)
func (*SignDescriptor) XXX_Size ¶
func (m *SignDescriptor) XXX_Size() int
func (*SignDescriptor) XXX_Unmarshal ¶
func (m *SignDescriptor) XXX_Unmarshal(b []byte) error
type SignReq ¶
type SignReq struct {
// / The raw bytes of the transaction to be signed.
RawTxBytes []byte `protobuf:"bytes,1,opt,name=raw_tx_bytes,json=rawTxBytes,proto3" json:"raw_tx_bytes,omitempty"`
// / A set of sign descriptors, for each input to be signed.
SignDescs []*SignDescriptor `protobuf:"bytes,2,rep,name=sign_descs,json=signDescs,proto3" json:"sign_descs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*SignReq) Descriptor ¶
func (*SignReq) GetRawTxBytes ¶
func (*SignReq) GetSignDescs ¶
func (m *SignReq) GetSignDescs() []*SignDescriptor
func (*SignReq) ProtoMessage ¶
func (*SignReq) ProtoMessage()
func (*SignReq) XXX_DiscardUnknown ¶
func (m *SignReq) XXX_DiscardUnknown()
func (*SignReq) XXX_Marshal ¶
func (*SignReq) XXX_Unmarshal ¶
type SignResp ¶
type SignResp struct {
// *
// A set of signatures realized in a fixed 64-byte format ordered in ascending
// input order.
RawSigs [][]byte `protobuf:"bytes,1,rep,name=raw_sigs,json=rawSigs,proto3" json:"raw_sigs,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*SignResp) Descriptor ¶
func (*SignResp) GetRawSigs ¶
func (*SignResp) ProtoMessage ¶
func (*SignResp) ProtoMessage()
func (*SignResp) XXX_DiscardUnknown ¶
func (m *SignResp) XXX_DiscardUnknown()
func (*SignResp) XXX_Marshal ¶
func (*SignResp) XXX_Unmarshal ¶
type SignerClient ¶
type SignerClient interface {
// *
// SignOutputRaw is a method that can be used to generated a signature for a
// set of inputs/outputs to a transaction. Each request specifies details
// concerning how the outputs should be signed, which keys they should be
// signed with, and also any optional tweaks. The return value is a fixed
// 64-byte signature (the same format as we use on the wire in Lightning).
//
// If we are unable to sign using the specified keys, then an error will be
// returned.
SignOutputRaw(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*SignResp, error)
// *
// ComputeInputScript generates a complete InputIndex for the passed
// transaction with the signature as defined within the passed SignDescriptor.
// This method should be capable of generating the proper input script for
// both regular p2wkh output and p2wkh outputs nested within a regular p2sh
// output.
//
// Note that when using this method to sign inputs belonging to the wallet,
// the only items of the SignDescriptor that need to be populated are pkScript
// in the TxOut field, the value in that same field, and finally the input
// index.
ComputeInputScript(ctx context.Context, in *SignReq, opts ...grpc.CallOption) (*InputScriptResp, error)
}
SignerClient is the client API for Signer service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSignerClient ¶
func NewSignerClient(cc *grpc.ClientConn) SignerClient
type SignerServer ¶
type SignerServer interface {
// *
// SignOutputRaw is a method that can be used to generated a signature for a
// set of inputs/outputs to a transaction. Each request specifies details
// concerning how the outputs should be signed, which keys they should be
// signed with, and also any optional tweaks. The return value is a fixed
// 64-byte signature (the same format as we use on the wire in Lightning).
//
// If we are unable to sign using the specified keys, then an error will be
// returned.
SignOutputRaw(context.Context, *SignReq) (*SignResp, error)
// *
// ComputeInputScript generates a complete InputIndex for the passed
// transaction with the signature as defined within the passed SignDescriptor.
// This method should be capable of generating the proper input script for
// both regular p2wkh output and p2wkh outputs nested within a regular p2sh
// output.
//
// Note that when using this method to sign inputs belonging to the wallet,
// the only items of the SignDescriptor that need to be populated are pkScript
// in the TxOut field, the value in that same field, and finally the input
// index.
ComputeInputScript(context.Context, *SignReq) (*InputScriptResp, error)
}
SignerServer is the server API for Signer service.
type TxOut ¶
type TxOut struct {
// / The value of the output being spent.
Value int64 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"`
// / The script of the output being spent.
PkScript []byte `protobuf:"bytes,2,opt,name=pk_script,json=pkScript,proto3" json:"pk_script,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*TxOut) Descriptor ¶
func (*TxOut) GetPkScript ¶
func (*TxOut) ProtoMessage ¶
func (*TxOut) ProtoMessage()
func (*TxOut) XXX_DiscardUnknown ¶
func (m *TxOut) XXX_DiscardUnknown()
func (*TxOut) XXX_Marshal ¶
func (*TxOut) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.