Documentation
¶
Index ¶
- Constants
- func CleanSortMustSignAddresses(addrs []fields.Address) (fields.VarUint1, []fields.Address)
- func SerializeReconciliationBalanceBillWithPrefixTypeCode(bill ReconciliationBalanceBill) ([]byte, error)
- type ChannelChainTransferProveBodyInfo
- func (elm *ChannelChainTransferProveBodyInfo) CheckAddressAndSign(leftAddress, rightAddress fields.Address) error
- func (e *ChannelChainTransferProveBodyInfo) GetAutoNumber() uint64
- func (e *ChannelChainTransferProveBodyInfo) GetChannelId() fields.ChannelId
- func (e *ChannelChainTransferProveBodyInfo) GetLeftAddress() fields.Address
- func (e *ChannelChainTransferProveBodyInfo) GetLeftBalance() fields.Amount
- func (e *ChannelChainTransferProveBodyInfo) GetLeftSatoshi() fields.Satoshi
- func (e *ChannelChainTransferProveBodyInfo) GetReuseVersion() uint32
- func (e *ChannelChainTransferProveBodyInfo) GetRightAddress() fields.Address
- func (e *ChannelChainTransferProveBodyInfo) GetRightBalance() fields.Amount
- func (e *ChannelChainTransferProveBodyInfo) GetRightSatoshi() fields.Satoshi
- func (elm *ChannelChainTransferProveBodyInfo) GetSignStuff() []byte
- func (elm *ChannelChainTransferProveBodyInfo) GetSignStuffHashHalfChecker() fields.HashHalfChecker
- func (elm *ChannelChainTransferProveBodyInfo) Parse(buf []byte, seek uint32) (uint32, error)
- func (elm *ChannelChainTransferProveBodyInfo) Serialize() ([]byte, error)
- func (elm *ChannelChainTransferProveBodyInfo) Size() uint32
- type ChannelPayCompleteDocuments
- type ChannelPayProveBodyList
- type OffChainCrossNodeSimplePaymentReconciliationBill
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) CheckValidity() error
- func (bill OffChainCrossNodeSimplePaymentReconciliationBill) ConvertToRealtimeReconciliation() *OffChainFormPaymentChannelRealtimeReconciliation
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetAutoNumber() uint64
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetChannelId() fields.ChannelId
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftAddress() fields.Address
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftBalance() fields.Amount
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftSatoshi() fields.Satoshi
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetReuseVersion() uint32
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetReuseVersionAndAutoNumber() (uint32, uint64)
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetRightAddress() fields.Address
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetRightBalance() fields.Amount
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetRightSatoshi() fields.Satoshi
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetTimestamp() uint64
- func (c *OffChainCrossNodeSimplePaymentReconciliationBill) Parse(buf []byte, seek uint32) (uint32, error)
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) Serialize() ([]byte, error)
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) SerializeWithTypeCode() ([]byte, error)
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) Size() uint32
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) TypeCode() uint8
- func (c OffChainCrossNodeSimplePaymentReconciliationBill) VerifySignature() error
- type OffChainFormPaymentChannelRealtimeReconciliation
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) CheckAddressAndSign() error
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) CheckValidity() error
- func (bill OffChainFormPaymentChannelRealtimeReconciliation) ConvertToOnChain() *OnChainArbitrationBasisReconciliation
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) FillTargetSignature(acc *account.Account) (*fields.Sign, bool, error)
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetAutoNumber() uint64
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetChannelId() fields.ChannelId
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetLeftAddress() fields.Address
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetLeftBalance() fields.Amount
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetLeftSatoshi() fields.Satoshi
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetReuseVersion() uint32
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetReuseVersionAndAutoNumber() (uint32, uint64)
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetRightAddress() fields.Address
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetRightBalance() fields.Amount
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetRightSatoshi() fields.Satoshi
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetTimestamp() uint64
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) Parse(buf []byte, seek uint32) (uint32, error)
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) Serialize() ([]byte, error)
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) SerializeForSign() ([]byte, error)
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) SerializeWithTypeCode() ([]byte, error)
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) SignStuffHash() fields.Hash
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) Size() uint32
- func (e *OffChainFormPaymentChannelRealtimeReconciliation) TypeCode() uint8
- func (elm *OffChainFormPaymentChannelRealtimeReconciliation) VerifySignature() error
- type OffChainFormPaymentChannelTransfer
- func (elm *OffChainFormPaymentChannelTransfer) CheckMustAddressAndSigns() error
- func (elm *OffChainFormPaymentChannelTransfer) CheckOneAddressSign(addr fields.Address) error
- func (elm *OffChainFormPaymentChannelTransfer) CheckValidity() error
- func (elm *OffChainFormPaymentChannelTransfer) DoSignFillPosition(acc *account.Account) (*fields.Sign, error)
- func (elm *OffChainFormPaymentChannelTransfer) FillSignByPosition(sign fields.Sign) error
- func (elm *OffChainFormPaymentChannelTransfer) GetSignStuffHash() fields.Hash
- func (elm *OffChainFormPaymentChannelTransfer) Parse(buf []byte, seek uint32) (uint32, error)
- func (elm *OffChainFormPaymentChannelTransfer) Serialize() ([]byte, error)
- func (elm *OffChainFormPaymentChannelTransfer) SerializeForPrefixSignStuff() ([]byte, error)
- func (elm *OffChainFormPaymentChannelTransfer) SerializeNoSign() ([]byte, error)
- func (elm *OffChainFormPaymentChannelTransfer) Size() uint32
- func (elm *OffChainFormPaymentChannelTransfer) VerifySignature() error
- type OnChainArbitrationBasisReconciliation
- func (elm *OnChainArbitrationBasisReconciliation) CheckAddressAndSign(laddr, raddr fields.Address) error
- func (elm *OnChainArbitrationBasisReconciliation) FillSigns(lacc, racc *account.Account) error
- func (e *OnChainArbitrationBasisReconciliation) GetAutoNumber() uint64
- func (e *OnChainArbitrationBasisReconciliation) GetChannelId() fields.ChannelId
- func (e *OnChainArbitrationBasisReconciliation) GetLeftBalance() fields.Amount
- func (e *OnChainArbitrationBasisReconciliation) GetLeftSatoshi() fields.Satoshi
- func (e *OnChainArbitrationBasisReconciliation) GetReuseVersion() uint32
- func (e *OnChainArbitrationBasisReconciliation) GetRightBalance() fields.Amount
- func (e *OnChainArbitrationBasisReconciliation) GetRightSatoshi() fields.Satoshi
- func (elm *OnChainArbitrationBasisReconciliation) Parse(buf []byte, seek uint32) (uint32, error)
- func (elm *OnChainArbitrationBasisReconciliation) Serialize() ([]byte, error)
- func (elm *OnChainArbitrationBasisReconciliation) SerializeForSign() ([]byte, error)
- func (elm *OnChainArbitrationBasisReconciliation) SignStuffHash() fields.Hash
- func (elm *OnChainArbitrationBasisReconciliation) Size() uint32
- type OnChainChannelPaymentArbitrationReconciliationBasis
- type ReconciliationBalanceBill
- type SortAddresses
Constants ¶
const ( ChannelTransferDirectionHacashLeftToRight uint8 = 1 ChannelTransferDirectionHacashRightToLeft uint8 = 2 ChannelTransferDirectionSatoshiLeftToRight uint8 = 3 ChannelTransferDirectionSatoshiRightToLeft uint8 = 4 )
const ( BillTypeCodeSimplePay uint8 = 1 // Ordinary payment BillTypeCodeReconciliation uint8 = 2 // Reconciliation )
*
支付票据类型
Variables ¶
This section is empty.
Functions ¶
func CleanSortMustSignAddresses ¶
De duplication and sorting address list
func SerializeReconciliationBalanceBillWithPrefixTypeCode ¶
func SerializeReconciliationBalanceBillWithPrefixTypeCode(bill ReconciliationBalanceBill) ([]byte, error)
serialize
Types ¶
type ChannelChainTransferProveBodyInfo ¶
type ChannelChainTransferProveBodyInfo struct { ChannelId fields.ChannelId // Channel ID ReuseVersion fields.VarUint4 // Channel reuse sequence number BillAutoNumber fields.VarUint8 // Serial number of channel bill PayDirection fields.VarUint1 // Capital flow direction: HAC 1 Left = > right; 2. right = > left BTC 3 Left = > right; 4. right = > left PayAmount fields.Amount // Payment amount cannot be negative PaySatoshi fields.SatoshiVariation // Pay bitcoin sat amount LeftBalance fields.Amount // Real time amount on the left RightBalance fields.Amount // Right real time amount LeftSatoshi fields.SatoshiVariation // Number of bitcoin sat on the left RightSatoshi fields.SatoshiVariation // Number of bitcoin sat on the right LeftAddress fields.Address // Left address RightAddress fields.Address // Right address }
Channel transfer, data body
func CreateEmptyProveBody ¶
func CreateEmptyProveBody(cid fields.ChannelId) *ChannelChainTransferProveBodyInfo
func (*ChannelChainTransferProveBodyInfo) CheckAddressAndSign ¶
func (elm *ChannelChainTransferProveBodyInfo) CheckAddressAndSign(leftAddress, rightAddress fields.Address) error
Check signature
func (*ChannelChainTransferProveBodyInfo) GetAutoNumber ¶
func (e *ChannelChainTransferProveBodyInfo) GetAutoNumber() uint64
func (*ChannelChainTransferProveBodyInfo) GetChannelId ¶
func (e *ChannelChainTransferProveBodyInfo) GetChannelId() fields.ChannelId
interface
func (*ChannelChainTransferProveBodyInfo) GetLeftAddress ¶
func (e *ChannelChainTransferProveBodyInfo) GetLeftAddress() fields.Address
func (*ChannelChainTransferProveBodyInfo) GetLeftBalance ¶
func (e *ChannelChainTransferProveBodyInfo) GetLeftBalance() fields.Amount
func (*ChannelChainTransferProveBodyInfo) GetLeftSatoshi ¶
func (e *ChannelChainTransferProveBodyInfo) GetLeftSatoshi() fields.Satoshi
func (*ChannelChainTransferProveBodyInfo) GetReuseVersion ¶
func (e *ChannelChainTransferProveBodyInfo) GetReuseVersion() uint32
func (*ChannelChainTransferProveBodyInfo) GetRightAddress ¶
func (e *ChannelChainTransferProveBodyInfo) GetRightAddress() fields.Address
func (*ChannelChainTransferProveBodyInfo) GetRightBalance ¶
func (e *ChannelChainTransferProveBodyInfo) GetRightBalance() fields.Amount
func (*ChannelChainTransferProveBodyInfo) GetRightSatoshi ¶
func (e *ChannelChainTransferProveBodyInfo) GetRightSatoshi() fields.Satoshi
func (*ChannelChainTransferProveBodyInfo) GetSignStuff ¶
func (elm *ChannelChainTransferProveBodyInfo) GetSignStuff() []byte
func (*ChannelChainTransferProveBodyInfo) GetSignStuffHashHalfChecker ¶
func (elm *ChannelChainTransferProveBodyInfo) GetSignStuffHashHalfChecker() fields.HashHalfChecker
func (*ChannelChainTransferProveBodyInfo) Parse ¶
func (elm *ChannelChainTransferProveBodyInfo) Parse(buf []byte, seek uint32) (uint32, error)
func (*ChannelChainTransferProveBodyInfo) Serialize ¶
func (elm *ChannelChainTransferProveBodyInfo) Serialize() ([]byte, error)
func (*ChannelChainTransferProveBodyInfo) Size ¶
func (elm *ChannelChainTransferProveBodyInfo) Size() uint32
type ChannelPayCompleteDocuments ¶
type ChannelPayCompleteDocuments struct { // Reconciliation bill table ProveBodys *ChannelPayProveBodyList // Payment of signed bills ChainPayment *OffChainFormPaymentChannelTransfer }
Channel chain payment bill
func (*ChannelPayCompleteDocuments) Parse ¶
func (c *ChannelPayCompleteDocuments) Parse(buf []byte, seek uint32) (uint32, error)
func (ChannelPayCompleteDocuments) Serialize ¶
func (c ChannelPayCompleteDocuments) Serialize() ([]byte, error)
func (ChannelPayCompleteDocuments) Size ¶
func (c ChannelPayCompleteDocuments) Size() uint32
type ChannelPayProveBodyList ¶
type ChannelPayProveBodyList struct { Count fields.VarUint1 ProveBodys []*ChannelChainTransferProveBodyInfo }
func (*ChannelPayProveBodyList) Parse ¶
func (c *ChannelPayProveBodyList) Parse(buf []byte, seek uint32) (uint32, error)
func (ChannelPayProveBodyList) Serialize ¶
func (c ChannelPayProveBodyList) Serialize() ([]byte, error)
func (ChannelPayProveBodyList) Size ¶
func (c ChannelPayProveBodyList) Size() uint32
type OffChainCrossNodeSimplePaymentReconciliationBill ¶
type OffChainCrossNodeSimplePaymentReconciliationBill struct { // Statement of this channel ChannelChainTransferTargetProveBody ChannelChainTransferProveBodyInfo // Channel chain payment data ChannelChainTransferData OffChainFormPaymentChannelTransfer }
func (OffChainCrossNodeSimplePaymentReconciliationBill) CheckValidity ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) CheckValidity() error
Check data availability
func (OffChainCrossNodeSimplePaymentReconciliationBill) ConvertToRealtimeReconciliation ¶
func (bill OffChainCrossNodeSimplePaymentReconciliationBill) ConvertToRealtimeReconciliation() *OffChainFormPaymentChannelRealtimeReconciliation
*
- 转换支付票据为实时对账单
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetAutoNumber ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetAutoNumber() uint64
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetChannelId ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetChannelId() fields.ChannelId
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftAddress ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftAddress() fields.Address
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftBalance ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftBalance() fields.Amount
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftSatoshi ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetLeftSatoshi() fields.Satoshi
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetReuseVersion ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetReuseVersion() uint32
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetReuseVersionAndAutoNumber ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetReuseVersionAndAutoNumber() (uint32, uint64)
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetRightAddress ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetRightAddress() fields.Address
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetRightBalance ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetRightBalance() fields.Amount
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetRightSatoshi ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetRightSatoshi() fields.Satoshi
func (OffChainCrossNodeSimplePaymentReconciliationBill) GetTimestamp ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) GetTimestamp() uint64
func (*OffChainCrossNodeSimplePaymentReconciliationBill) Parse ¶
func (c *OffChainCrossNodeSimplePaymentReconciliationBill) Parse(buf []byte, seek uint32) (uint32, error)
func (OffChainCrossNodeSimplePaymentReconciliationBill) Serialize ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) Serialize() ([]byte, error)
func (OffChainCrossNodeSimplePaymentReconciliationBill) SerializeWithTypeCode ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) SerializeWithTypeCode() ([]byte, error)
func (OffChainCrossNodeSimplePaymentReconciliationBill) Size ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) Size() uint32
func (OffChainCrossNodeSimplePaymentReconciliationBill) TypeCode ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) TypeCode() uint8
func (OffChainCrossNodeSimplePaymentReconciliationBill) VerifySignature ¶
func (c OffChainCrossNodeSimplePaymentReconciliationBill) VerifySignature() error
Verify signature on ticket
type OffChainFormPaymentChannelRealtimeReconciliation ¶
type OffChainFormPaymentChannelRealtimeReconciliation struct { // Signature hash calculation data part ChannelId fields.ChannelId // Channel ID ReuseVersion fields.VarUint4 // Channel reuse sequence number BillAutoNumber fields.VarUint8 // Serial number of channel bill LeftBalance fields.Amount // Real time amount on the left RightBalance fields.Amount // Right real time amount LeftSatoshi fields.SatoshiVariation // Number of bitcoin sat on the left RightSatoshi fields.SatoshiVariation // Number of bitcoin sat on the right // Unsigned hash calculation data part LeftAddress fields.Address // Left address RightAddress fields.Address // Right address Timestamp fields.BlockTxTimestamp // Reconciliation timestamp // Signature on both sides LeftSign fields.Sign // Left address reconciliation signature RightSign fields.Sign // Right address reconciliation signature }
*
- 通道实时对账(链下签署)
func (*OffChainFormPaymentChannelRealtimeReconciliation) CheckAddressAndSign ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) CheckAddressAndSign() error
Check signature
func (*OffChainFormPaymentChannelRealtimeReconciliation) CheckValidity ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) CheckValidity() error
Check data availability
func (OffChainFormPaymentChannelRealtimeReconciliation) ConvertToOnChain ¶
func (bill OffChainFormPaymentChannelRealtimeReconciliation) ConvertToOnChain() *OnChainArbitrationBasisReconciliation
*
- 转换链下实时对账单为链上仲裁单据
func (*OffChainFormPaymentChannelRealtimeReconciliation) FillTargetSignature ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) FillTargetSignature(acc *account.Account) (*fields.Sign, bool, error)
填充一方签名
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetAutoNumber ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetAutoNumber() uint64
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetChannelId ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetChannelId() fields.ChannelId
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetLeftAddress ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetLeftAddress() fields.Address
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetLeftBalance ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetLeftBalance() fields.Amount
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetLeftSatoshi ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetLeftSatoshi() fields.Satoshi
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetReuseVersion ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetReuseVersion() uint32
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetReuseVersionAndAutoNumber ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetReuseVersionAndAutoNumber() (uint32, uint64)
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetRightAddress ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetRightAddress() fields.Address
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetRightBalance ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetRightBalance() fields.Amount
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetRightSatoshi ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetRightSatoshi() fields.Satoshi
func (*OffChainFormPaymentChannelRealtimeReconciliation) GetTimestamp ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) GetTimestamp() uint64
func (*OffChainFormPaymentChannelRealtimeReconciliation) Parse ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) Parse(buf []byte, seek uint32) (uint32, error)
func (*OffChainFormPaymentChannelRealtimeReconciliation) Serialize ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) Serialize() ([]byte, error)
func (*OffChainFormPaymentChannelRealtimeReconciliation) SerializeForSign ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) SerializeForSign() ([]byte, error)
func (*OffChainFormPaymentChannelRealtimeReconciliation) SerializeWithTypeCode ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) SerializeWithTypeCode() ([]byte, error)
serialize
func (*OffChainFormPaymentChannelRealtimeReconciliation) SignStuffHash ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) SignStuffHash() fields.Hash
func (*OffChainFormPaymentChannelRealtimeReconciliation) Size ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) Size() uint32
func (*OffChainFormPaymentChannelRealtimeReconciliation) TypeCode ¶
func (e *OffChainFormPaymentChannelRealtimeReconciliation) TypeCode() uint8
interface type
func (*OffChainFormPaymentChannelRealtimeReconciliation) VerifySignature ¶
func (elm *OffChainFormPaymentChannelRealtimeReconciliation) VerifySignature() error
Verify signature on ticket
type OffChainFormPaymentChannelTransfer ¶
type OffChainFormPaymentChannelTransfer struct { Timestamp fields.BlockTxTimestamp // time stamp OrderNoteHashHalfChecker fields.HashHalfChecker // Order detail data hash len = 16 MustSignCount fields.VarUint1 // Number of addresses that must be signed, max. 200 MustSignAddresses []fields.Address // 顺序打乱/随机的通道必须签名的地址 ChannelCount fields.VarUint1 // Number of access channels, max. 200 ChannelTransferProveHashHalfCheckers []fields.HashHalfChecker // Hash of channel transfer certificate, from payment to final collection, hash len = 16 MustSigns []fields.Sign // 顺序打乱/随机的签名,顺序与地址相同 }
Channel chain transfer transactions (signed off the chain) can be arbitrated on the chain Adopt zero knowledge proof mode
func (*OffChainFormPaymentChannelTransfer) CheckMustAddressAndSigns ¶
func (elm *OffChainFormPaymentChannelTransfer) CheckMustAddressAndSigns() error
Check all signatures
func (*OffChainFormPaymentChannelTransfer) CheckOneAddressSign ¶
func (elm *OffChainFormPaymentChannelTransfer) CheckOneAddressSign(addr fields.Address) error
Check whether an address is signed
func (*OffChainFormPaymentChannelTransfer) CheckValidity ¶
func (elm *OffChainFormPaymentChannelTransfer) CheckValidity() error
Check data availability
func (*OffChainFormPaymentChannelTransfer) DoSignFillPosition ¶
func (elm *OffChainFormPaymentChannelTransfer) DoSignFillPosition(acc *account.Account) (*fields.Sign, error)
Sign and fill to the specified location
func (*OffChainFormPaymentChannelTransfer) FillSignByPosition ¶
func (elm *OffChainFormPaymentChannelTransfer) FillSignByPosition(sign fields.Sign) error
Populate signatures by location
func (*OffChainFormPaymentChannelTransfer) GetSignStuffHash ¶
func (elm *OffChainFormPaymentChannelTransfer) GetSignStuffHash() fields.Hash
func (*OffChainFormPaymentChannelTransfer) Parse ¶
func (elm *OffChainFormPaymentChannelTransfer) Parse(buf []byte, seek uint32) (uint32, error)
func (*OffChainFormPaymentChannelTransfer) Serialize ¶
func (elm *OffChainFormPaymentChannelTransfer) Serialize() ([]byte, error)
func (*OffChainFormPaymentChannelTransfer) SerializeForPrefixSignStuff ¶
func (elm *OffChainFormPaymentChannelTransfer) SerializeForPrefixSignStuff() ([]byte, error)
func (*OffChainFormPaymentChannelTransfer) SerializeNoSign ¶
func (elm *OffChainFormPaymentChannelTransfer) SerializeNoSign() ([]byte, error)
func (*OffChainFormPaymentChannelTransfer) Size ¶
func (elm *OffChainFormPaymentChannelTransfer) Size() uint32
func (*OffChainFormPaymentChannelTransfer) VerifySignature ¶
func (elm *OffChainFormPaymentChannelTransfer) VerifySignature() error
Verify signature on ticket
type OnChainArbitrationBasisReconciliation ¶
type OnChainArbitrationBasisReconciliation struct { // Signature hash calculation data part ChannelId fields.ChannelId // Channel ID ReuseVersion fields.VarUint4 // Channel reuse sequence number BillAutoNumber fields.VarUint8 // Serial number of channel bill LeftBalance fields.Amount // Real time amount on the left RightBalance fields.Amount // Right real time amount LeftSatoshi fields.SatoshiVariation // Number of bitcoin sat on the left RightSatoshi fields.SatoshiVariation // Number of bitcoin sat on the right // Signature on both sides LeftSign fields.Sign // Left address reconciliation signature RightSign fields.Sign // Right address reconciliation signature }
func (*OnChainArbitrationBasisReconciliation) CheckAddressAndSign ¶
func (elm *OnChainArbitrationBasisReconciliation) CheckAddressAndSign(laddr, raddr fields.Address) error
Check signature
func (*OnChainArbitrationBasisReconciliation) FillSigns ¶
func (elm *OnChainArbitrationBasisReconciliation) FillSigns(lacc, racc *account.Account) error
Fill in signature
func (*OnChainArbitrationBasisReconciliation) GetAutoNumber ¶
func (e *OnChainArbitrationBasisReconciliation) GetAutoNumber() uint64
func (*OnChainArbitrationBasisReconciliation) GetChannelId ¶
func (e *OnChainArbitrationBasisReconciliation) GetChannelId() fields.ChannelId
func (*OnChainArbitrationBasisReconciliation) GetLeftBalance ¶
func (e *OnChainArbitrationBasisReconciliation) GetLeftBalance() fields.Amount
func (*OnChainArbitrationBasisReconciliation) GetLeftSatoshi ¶
func (e *OnChainArbitrationBasisReconciliation) GetLeftSatoshi() fields.Satoshi
func (*OnChainArbitrationBasisReconciliation) GetReuseVersion ¶
func (e *OnChainArbitrationBasisReconciliation) GetReuseVersion() uint32
func (*OnChainArbitrationBasisReconciliation) GetRightBalance ¶
func (e *OnChainArbitrationBasisReconciliation) GetRightBalance() fields.Amount
func (*OnChainArbitrationBasisReconciliation) GetRightSatoshi ¶
func (e *OnChainArbitrationBasisReconciliation) GetRightSatoshi() fields.Satoshi
func (*OnChainArbitrationBasisReconciliation) Parse ¶
func (elm *OnChainArbitrationBasisReconciliation) Parse(buf []byte, seek uint32) (uint32, error)
func (*OnChainArbitrationBasisReconciliation) Serialize ¶
func (elm *OnChainArbitrationBasisReconciliation) Serialize() ([]byte, error)
func (*OnChainArbitrationBasisReconciliation) SerializeForSign ¶
func (elm *OnChainArbitrationBasisReconciliation) SerializeForSign() ([]byte, error)
func (*OnChainArbitrationBasisReconciliation) SignStuffHash ¶
func (elm *OnChainArbitrationBasisReconciliation) SignStuffHash() fields.Hash
func (*OnChainArbitrationBasisReconciliation) Size ¶
func (elm *OnChainArbitrationBasisReconciliation) Size() uint32
type OnChainChannelPaymentArbitrationReconciliationBasis ¶
type OnChainChannelPaymentArbitrationReconciliationBasis interface { GetChannelId() fields.ChannelId GetLeftBalance() fields.Amount // Left HAC amount GetRightBalance() fields.Amount // Right HAC amount GetLeftSatoshi() fields.Satoshi // BTC sat amount allocated on the left GetRightSatoshi() fields.Satoshi // BTC sat amount allocated on the right GetReuseVersion() uint32 // Channel reuse sequence number GetAutoNumber() uint64 // Check address and signature CheckAddressAndSign(laddr, raddr fields.Address) error }
Online arbitration reconciliation basis
type ReconciliationBalanceBill ¶
type ReconciliationBalanceBill interface { Size() uint32 Parse(buf []byte, seek uint32) (uint32, error) // Deserialization Serialize() ([]byte, error) // serialize SerializeWithTypeCode() ([]byte, error) // serialize TypeCode() uint8 // type GetChannelId() fields.ChannelId GetLeftSatoshi() fields.Satoshi GetRightSatoshi() fields.Satoshi GetLeftBalance() fields.Amount GetRightBalance() fields.Amount GetLeftAddress() fields.Address GetRightAddress() fields.Address GetTimestamp() uint64 // Reconciliation timestamp, seconds // Channel reuse serial number channel bill serial number GetReuseVersionAndAutoNumber() (uint32, uint64) GetReuseVersion() uint32 GetAutoNumber() uint64 CheckValidity() error // Check data availability VerifySignature() error // Verify signature on ticket }
General reconciliation bill interface
func ParseReconciliationBalanceBillByPrefixTypeCode ¶
func ParseReconciliationBalanceBillByPrefixTypeCode(buf []byte, seek uint32) (ReconciliationBalanceBill, uint32, error)
Deserialization
type SortAddresses ¶
Sorting unit
func (SortAddresses) Len ¶
func (n SortAddresses) Len() int
func (SortAddresses) Less ¶
func (n SortAddresses) Less(i, j int) bool
func (SortAddresses) Swap ¶
func (n SortAddresses) Swap(i, j int)