Documentation ¶
Overview ¶
Package coinjoin defines a builder type for creating Decred CoinJoin transactions.
Index ¶
- func EncodeDesc(sc ScriptClass, amount int64, txVersion uint16, lockTime, expiry uint32) []byte
- type Blamer
- type Caller
- type ScriptClass
- type Tx
- func (t *Tx) Confirm(confirm interface{}, pid int) error
- func (t *Tx) Join(unmixed []byte, pid int) error
- func (t *Tx) MarshalBinary() ([]byte, error)
- func (t *Tx) Mix(m []byte)
- func (t *Tx) PublishMix(ctx context.Context) error
- func (t *Tx) Report() interface{}
- func (t *Tx) Shuffle()
- func (t *Tx) UnmarshalBinary(b []byte) error
- func (t *Tx) ValidateUnmixed(unmixed []byte, mcount int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeDesc ¶
func EncodeDesc(sc ScriptClass, amount int64, txVersion uint16, lockTime, expiry uint32) []byte
EncodeDesc encodes a description defining the parameters for a Decred coinjoin.
Types ¶
type Caller ¶
type Caller interface {
Call(ctx context.Context, method string, res interface{}, args ...interface{}) error
}
Caller performs a RPC method call.
type ScriptClass ¶
type ScriptClass int
const ( P2PKHv0 ScriptClass = iota P2SHv0 )
Recognized script classes
func DecodeDesc ¶
func DecodeDesc(desc []byte) (sc ScriptClass, amount int64, txVersion uint16, lockTime, expiry uint32, err error)
DecodeDesc decodes a description defining the parameters for a compatible coinjoin.
type Tx ¶
type Tx struct { Tx wire.MsgTx // contains filtered or unexported fields }
Tx is a Decred CoinJoin transaction builder. It is intended for usage by CoinJoin servers, not clients.
func (*Tx) Confirm ¶
Confirm extracts the signatures from peer pid in confirm and adds them the receiver.
confirm must have type *Tx.
func (*Tx) Join ¶
Join adds the inputs and outputs of a transaction in wire encoding to t. Inputs and outputs are associated with a peer id for blame assignment.
func (*Tx) MarshalBinary ¶
MarshalBinary marshals the transaction in wire encoding.
func (*Tx) Mix ¶
Mix adds an output with m as the PkScript. The output will use the builder's output value and script version.
func (*Tx) PublishMix ¶
PublishMix publishes a transaction using the dcrd sendrawtransaction RPC.
func (*Tx) Report ¶
func (t *Tx) Report() interface{}
Report returns an object that can be marshaled with reflection-based encoders such as encoding/json and encoding/gob. The object includes details about the current CoinJoin transaction.
func (*Tx) Shuffle ¶
func (t *Tx) Shuffle()
Shuffle randomly shuffles the transaction inputs and outputs. Randomness is obtained from a cryptographically-seeded PRNG. Must only be used before signing.
func (*Tx) UnmarshalBinary ¶
UnmarshalBinary unmarshals the transaction in wire encoding.