package
0.0.0-20191201205449-f379a713d0c2
Repository: https://github.com/rjected/lit.git
Documentation: pkg.go.dev
# Functions
AddPrivEZ adds the non-secret scalar to a private key.
AddPubsEZ is the easy derivation; A + sha(B, A)*G in LN this is used for everything but the revocable pubkey order matters.
No description provided by the author
BigIntToEncodedBytes converts a big integer into its corresponding 32 byte big endian representation.
4 byte slice to int32.
8 bytes to int64 (bitcoin amounts).
4 byte slice to uint32.
8 bytes to uint64.
CombinePrivateKeys takes a set of private keys and combines them in the same way as done for public keys.
CombinePrivKeyAndSubtract uses the same delinearization scheme as CombinePrivateKeys, but once it gets the combined private key, it subtracts the original base key.
PrivKeyCombineBytes combines a private key with a byte slice.
CombinePubs takes two 33 byte serialized points, and combines them with the deliniearized combination process.
CommitScript is the script for 0.13.1: OP_CHECKSIG turned into OP_CHECSIGVERIFY.
No description provided by the author
No description provided by the author
DlcCalcOracleSignaturePubKey computes the predicted signature s*G it's just R - h(R||m)A.
DlcCommitScript makes a script that pays to (PubKeyPeer+PubKeyOracleSig or (OurPubKey and TimeDelay)).
DlcContractFromBytes deserializes a byte array back into a DlcContract struct.
DlcOutput returns a Txo for a particular value that pays to (PubKeyPeer+PubKeyOracleSig or (OurPubKey and TimeDelay)).
ElkPoint returns the public key (point) which comes from a node in the elkrem tree (elkrem hash).
ElkScalar returns the private key (scalar) which comes from a node in the elkrem tree (elkrem hash).
FundTxOut creates a TxOut for the funding transaction.
FundMultiPre generates the non-p2sh'd multisig script for 2 of 2 pubkeys.
int32 to 4 bytes.
int64 to 8 bytes.
KeyHashFromPkScript extracts the 20 or 32 byte hash from a txout PkScript.
LitAdrBytes takes a lit address string and returns either 20 or 12 bytes.
No description provided by the author
LitAdrOK make sure the address is OK.
No description provided by the author
No description provided by the author
No description provided by the author
method for finding what type of message a generic []byte is.
LoadKeyFromFileArg opens the file and returns the key.
LoadKeyFromFileInteractive opens the file 'filename' and presents a keyboard prompt for the passphrase to decrypt it.
No description provided by the author
PubKeyMultiplyByHash multiplies a pubkey by a hash.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewDlcContractAckMsg generates a new DlcContractAckMsg struct based on the passed contract and signatures.
NewDlcContractAckMsgFromBytes deserializes a byte array into a DlcContractAckMsg.
NewDlcContractFundingSigsMsg creates a new DlcContractFundingSigsMsg based on the passed contract and signed funding TX.
NewDlcContractFundingSigsMsgFromBytes deserializes a byte array into a DlcContractFundingSigsMsg.
NewDlcContractSigProofMsg creates a new DlcContractSigProofMsg based on the passed contract and signed funding TX.
NewDlcContractSigProofMsgFromBytes deserializes a byte array into a DlcContractSigProofMsg.
NewDlcOfferAcceptMsg generates a new DlcOfferAcceptMsg struct based on the passed contract and signatures.
NewDlcOfferAcceptMsgFromBytes parses a byte array back into a DlcOfferAcceptMsg struct.
NewDlcOfferDeclineMsg creates a new DlcOfferDeclineMsg based on a peer, a reason for declining and the index of the contract we're declining.
NewDlcOfferDeclineMsgFromBytes deserializes a byte array into a DlcOfferDeclineMsg.
NewDlcOfferMsg creates a new DlcOfferMsg based on a peer and contract.
NewDlcOfferMsgFromBytes parses a byte array back into a DlcOfferMsg.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewMultihopPaymentSetupMsg does...
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewPointRespMsgFromBytes takes a byte slice and a peerid and constructs a PointRespMsg object from the bytes.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ComMsgFromBytes turns 132 bytes into a SourceMsg Silently fails with wrong size input.
NewWatchDescMsg turns 96 bytes into a WatchannelDescriptor Silently fails with incorrect size input, watch out.
No description provided by the author
ComMsgFromBytes turns 132 bytes into a SourceMsg Silently fails with wrong size input.
NopeString returns true if the string means "nope".
No description provided by the author
OldAddressFromPKH returns a base58 string from a 20 byte pubkey hash.
No description provided by the author
OutPointFromBytes gives you an outpoint from 36 bytes.
need this because before I was comparing pointers maybe? so they were the same outpoint but stored in 2 places so false negative?.
outPointToBytes turns an outpoint into 36 bytes.
P2WSHify takes a script and turns it into a 34 byte long P2WSH PkScript.
ParseAdrString splits a string like "[email protected]:8191 into a separate pkh part and network part, adding the network part if needed.
No description provided by the author
Not exported in txscript..
PrintTx prints out a transaction as serialized byte array to StdOut.
PrivKeyAddBytes adds bytes to a private key.
HashToPub turns a 32 byte hash into a 33 byte serialized pubkey.
PubKeyAddBytes adds bytes to a public key.
PubKeyArrAddBytes adds a byte slice to a serialized point.
CombinableSliceFromArrSlice turns an array of 33 byte pubkey arrays into a CombinablePubKeySlice which can then be combined.
ReadKeyFile returns an 32 byte key from a file.
No description provided by the author
No description provided by the author
No description provided by the author
saves a 32 byte key to a file, encrypting with pass.
saves a 32 byte key to file, prompting for passphrase.
SettlementTx returns the transaction to settle the contract.
TxToString prints out some info about a transaction.
uint32 to 4 bytes.
uint64 to 8 bytes.
YupString returns true if the string means "yup".
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
id numbers for messages, semi-arbitrary.
id numbers for messages, semi-arbitrary.
id numbers for messages, semi-arbitrary.
id numbers for messages, semi-arbitrary.
close channel.
id numbers for messages, semi-arbitrary.
pushing funds in channel; request to send.
Accept the contract.
Acknowledge an acceptance.
Funding signatures.
Decline the contract.
Offer a contract.
Sigproof.
Responds with funding details.
Acknowledges channel and sends along signatures for funding.
Declines the funding request.
Requests funding details (UTXOs, Change address, Pubkey), including our own details and amount needed.
id numbers for messages, semi-arbitrary.
not implemented.
resolving collision.
Like a deltasig but offers an HTLC.
Describes a new channel for routing.
Acknowledge payment (share preimage hash).
Request payment.
Setup a payment route.
Channel creation messages.
id numbers for messages, semi-arbitrary.
Like a hashsig but clears an HTLC.
Contains an RPC request from a remote peer.
Contains an RPC response to send to a remote peer.
pushing funds; revoking previous channel state.
not implemented.
id numbers for messages, semi-arbitrary.
pulling funds; signing new state and revoking old.
send a text message.
Watch_clear marks a channel as ok to delete.
desc describes a new channel.
commsg is a single state in the channel.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
message for channel acknowledgement after description message.
message with a channel's description.
text message.
message for closing a channel.
message for sending an amount with the signature.
DlcContract is a struct containing all elements to work with a Discreet Log Contract.
DlcContractAckMsg is sent from the offering party back to the peer when the contract acceptance is acknowledged.
DlcContractDivision describes a single division of the contract.
DlcContractFundingInput describes a UTXO that is offered to fund the contract with.
DlcContractFundingSigsMsg is sent by the counter party once the signatures for the settlement are verified and accepted.
DlcContractSettlementSignature contains the signature for a particular settlement transaction.
DlcContractSigProofMsg acknowledges the funding of the contract to a peer.
DlcOfferAcceptMsg is a message indicating we are accepting the contract.
No description provided by the author
DlcOfferMsg is the message we send to a peer to offer that peer a particular contract.
No description provided by the author
message for channel acknowledgement and funding signatures.
No description provided by the author
No description provided by the author
No description provided by the author
message for signaling state has moved, revoking old state.
message for offering an HTLC.
HeightEvent is to inform the LN node of a new blockheight on a particular coin type.
No description provided by the author
MultihopPaymentRequestMsg initiates a new multihop payment.
MultihopPaymentRequestMsg initiates a new multihop payment.
MultihopPaymentSetupMsg forms a new multihop payment.
OutPointEvent is a message describing events concerning an outpoint.
message with no information, just shows a point is requested.
message to be used for reply to point request.
message for clearing an HTLC.
To find how much 1 satoshi of coin type A will cost you in coin type B, if Reciprocal is false, 1 satoshi of A will buy you `rate` satoshis of B.
RemoteControlRpcRequestMsg contains a request to be executed by the local lit node, when the remote node has been authorized to do so.
RemoteControlRpcResponseMsg is sent in response to a request message and contains the output of the command that was executed.
send message across channel using Elk info.
No description provided by the author
message for proof for a signature.
a message that pushes using channel information.
TxAndHeight is just a tx, and the height at which it was confirmed.
No description provided by the author
WatchannelDescriptor is the initial message setting up a Watchannel.
ComMsg are 137 bytes.
# Interfaces
interface that all messages follow, for easy use.
# Type aliases
PubKeySlice are slices of pubkeys, which can be combined (and sorted).
DlcContractStatus is an enumeration containing the various statuses a contract can have.