ltc

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: BlueOak-1.0.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnitInfo = dex.UnitInfo{
		AtomicUnit: "litoshi",
		Conventional: dex.Denomination{
			Unit:             "LTC",
			ConversionFactor: 1e8,
		},
		Alternatives: []dex.Denomination{
			{
				Unit:             "mLTC",
				ConversionFactor: 1e5,
			},
			{
				Unit:             "µLTC",
				ConversionFactor: 1e2,
			},
		},
		FeeRateDenom: "vB",
	}
	// MainNetParams are the clone parameters for mainnet.
	MainNetParams = btc.ReadCloneParams(&btc.CloneParams{
		Name:             "mainnet",
		PubKeyHashAddrID: 0x30,
		ScriptHashAddrID: 0x32,
		Bech32HRPSegwit:  "ltc",
		CoinbaseMaturity: 100,
		Net:              0xdbb6c0fb,
		HDPrivateKeyID:   [4]byte{0x04, 0x88, 0xad, 0xe4},
		HDPublicKeyID:    [4]byte{0x04, 0x88, 0xb2, 0x1e},
		GenesisHash:      mustHash("12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2"),
	})
	// TestNet4Params are the clone parameters for testnet.
	TestNet4Params = btc.ReadCloneParams(&btc.CloneParams{
		Name:             "testnet4",
		PubKeyHashAddrID: 0x6f,
		ScriptHashAddrID: 0x3a,
		Bech32HRPSegwit:  "tltc",
		CoinbaseMaturity: 100,
		Net:              0xf1c8d2fd,
		HDPrivateKeyID:   [4]byte{0x04, 0x35, 0x83, 0x94},
		HDPublicKeyID:    [4]byte{0x04, 0x35, 0x87, 0xcf},
		GenesisHash:      mustHash("4966625a4b2851d9fdee139e56211a0d88575f59ed816ff5e6a63deb4e3e29a0"),
	})
	// RegressionNetParams are the clone parameters for simnet.
	RegressionNetParams = btc.ReadCloneParams(&btc.CloneParams{
		Name:             "regtest",
		PubKeyHashAddrID: 0x6f,
		ScriptHashAddrID: 0x3a,
		Bech32HRPSegwit:  "rltc",
		CoinbaseMaturity: 100,

		Net:            0x9acb0442,
		HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94},
		HDPublicKeyID:  [4]byte{0x04, 0x35, 0x87, 0xcf},
		GenesisHash:    mustHash("530827f38f93b43ed12af0b3ad25a288dc02ed74d6d7857862df51fc56c416f9"),
	})
)

Functions

func DeserializeBlock added in v0.5.0

func DeserializeBlock(blk io.Reader) (*wire.MsgBlock, error)

DeserializeBlock decodes the bytes of a serialized Litecoin block. This function exists because MWEB changes both the block and transaction serializations. Blocks may have a MW "extension block" for "peg-out" transactions, and this EB is after all the transactions in the regular LTC block. After the canonical transactions in the regular block, there may be zero or more "peg-in" transactions followed by one integration transaction (also known as a HogEx transaction), all still in the regular LTC block. The peg-in txns decode correctly, but the integration tx is a special transaction with the witness tx flag with bit 3 set (8), which prevents correct wire.MsgTx deserialization. Refs: https://github.com/litecoin-project/lips/blob/master/lip-0002.mediawiki#PegOut_Transactions https://github.com/litecoin-project/lips/blob/master/lip-0003.mediawiki#Specification https://github.com/litecoin-project/litecoin/commit/9d1f530a5fa6d16871fdcc3b506be42b593d3ce4 https://github.com/litecoin-project/litecoin/commit/8c82032f45e644f413ec5c91e121a31c993aa831 (src/libmw/include/mw/models/tx/Transaction.h for the `mweb_tx` field of the `CTransaction` in the "primitives" commit).

func DeserializeBlockBytes added in v0.5.0

func DeserializeBlockBytes(blk []byte) (*wire.MsgBlock, error)

DeserializeBlockBytes wraps DeserializeBlock using bytes.NewReader for convenience.

Types

type Tx added in v0.5.0

type Tx struct {
	*wire.MsgTx
	IsHogEx bool
	Kern0   []byte
}

func DeserializeTx added in v0.5.0

func DeserializeTx(r io.Reader) (*Tx, error)

DeserializeTx

func (*Tx) TxHash added in v0.5.0

func (tx *Tx) TxHash() chainhash.Hash

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL