Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func P2SHRetrieveData ¶
P2SHRetrieveData takes a list of transaction inputs and decodes the signature scripts that contain the file
Types ¶
type Injection ¶
type Injection struct { Network *chaincfg.Params FeeRate int Addresses []*InjectionAddress // contains filtered or unexported fields }
Injection holds all necessary information to inject arbitrary data on the Bitcoin network
func NewInjection ¶
func NewInjection(data []byte, feeRate int, key *btcec.PrivateKey, network *chaincfg.Params) (*Injection, error)
NewInjection creates a new data injection structure
func (*Injection) EstimateCost ¶
EstimateCost creates a dummy transaction containing all signature scripts required to store the file This allows us to estimate the final transaction size in bytes
type InjectionAddress ¶
type InjectionAddress struct { Address *btcutil.AddressScriptHash UTXO *wire.OutPoint Amount int64 Chunks [][]byte }
InjectionAddress holds informations about a script hash address The P2SH-P2WSH address is derived from the user's public key and the file's data The user must sends coins to this script hash address. The UTXO can be redeemed by providing a signature script containing the corresponding file