Documentation ¶
Overview ¶
Package runestone is an open-source implementation of the Bitcoin Rune protocol in Go.
The runestone project aims to provide a robust, efficient, and easy-to-use library for developers to interact with the Rune protocol. It covers various aspects of the protocol, such as transaction handling, block validation, and network communication.
Features:
- Rune protocol implementation: This package contains a complete implementation of the Rune protocol, allowing developers to build and interact with Bitcoin Rune applications easily.
- Modular design: The package is designed with modularity in mind, making it easy to extend and customize for specific use cases.
- Efficient and performant: The Go language offers excellent performance and efficient memory usage, making this package suitable for use in high-performance applications.
- Well-documented and tested: The package includes comprehensive documentation and test coverage, ensuring its reliability and ease of use.
Getting started: To start using the runestone package, simply import it into your Go project:
``` go get github.com/bxelab/runestone ```
You can then use the various components provided by the package to interact with the Rune protocol, such as creating transactions, validating blocks, and communicating with other nodes on the network.
For more information and examples, please refer to the package documentation and the project's GitHub repository.
Contributions and feedback are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on the project's GitHub repository or submit a pull request.
Index ¶
- Constants
- Variables
- func Decode(encoded []byte) *big.Int
- func Encode(n *big.Int) []byte
- func EncodeChar(r rune) []byte
- func EncodeUint128(n uint128.Uint128) []byte
- func EncodeUint32(n uint32) []byte
- func EncodeUint64(n uint64) []byte
- func EncodeUint8(n uint8) []byte
- func FirstRuneHeight(network wire.BitcoinNet) uint32
- func TagTake[T any](t Tag, fields map[Tag][]uint128.Uint128, ...) (*T, error)
- func Uint128FromString(s string) uint128.Uint128
- type Artifact
- type Cenotaph
- type Edict
- type Error
- type Etching
- type Flag
- type Flaw
- type Message
- type Payload
- type Rune
- type RuneId
- type Runestone
- type SpacedRune
- type Tag
- type Terms
Constants ¶
const ( MaxDivisibility = 38 MaxSpacers = 0b00000111_11111111_11111111_11111111 )
const ( MAGIC_NUMBER = txscript.OP_13 COMMIT_CONFIRMATIONS = 6 )
const SUBSIDY_HALVING_INTERVAL uint32 = 210_000
Variables ¶
var ( ErrSeparator = errors.New("missing separator") ErrBlock = func(err string) error { return fmt.Errorf("invalid Block height:%s", err) } ErrTransaction = func(err string) error { return fmt.Errorf("invalid Transaction index:%s", err) } )
var ( ErrCharacter = func(c rune) error { return fmt.Errorf("invalid character `%c`", c) } ErrDoubleSpacer = errors.New("double spacer") ErrLeadingSpacer = errors.New("leading spacer") ErrTrailingSpacer = errors.New("trailing spacer") )
var ErrNone = errors.New("none")
var RESERVED = Uint128FromString("6402364363415443603228541259936211926")
var STEPS = []uint128.Uint128{ Uint128FromString("0"), Uint128FromString("26"), Uint128FromString("702"), Uint128FromString("18278"), Uint128FromString("475254"), Uint128FromString("12356630"), Uint128FromString("321272406"), Uint128FromString("8353082582"), Uint128FromString("217180147158"), Uint128FromString("5646683826134"), Uint128FromString("146813779479510"), Uint128FromString("3817158266467286"), Uint128FromString("99246114928149462"), Uint128FromString("2580398988131886038"), Uint128FromString("67090373691429037014"), Uint128FromString("1744349715977154962390"), Uint128FromString("45353092615406029022166"), Uint128FromString("1179180408000556754576342"), Uint128FromString("30658690608014475618984918"), Uint128FromString("797125955808376366093607894"), Uint128FromString("20725274851017785518433805270"), Uint128FromString("538857146126462423479278937046"), Uint128FromString("14010285799288023010461252363222"), Uint128FromString("364267430781488598271992561443798"), Uint128FromString("9470953200318703555071806597538774"), Uint128FromString("246244783208286292431866971536008150"), Uint128FromString("6402364363415443603228541259936211926"), Uint128FromString("166461473448801533683942072758341510102"), }
Functions ¶
func EncodeChar ¶
func EncodeUint128 ¶
func EncodeUint32 ¶
func EncodeUint64 ¶
func EncodeUint8 ¶
func FirstRuneHeight ¶
func FirstRuneHeight(network wire.BitcoinNet) uint32
func Uint128FromString ¶
Types ¶
type Etching ¶
type Rune ¶
func MinimumAtHeight ¶
func MinimumAtHeight(chain wire.BitcoinNet, height uint64) Rune
func RuneFromString ¶
func (Rune) Commitment ¶
func (Rune) IsReserved ¶
type SpacedRune ¶
func NewSpacedRune ¶
func NewSpacedRune(r Rune, spacers uint32) *SpacedRune
func SpacedRuneFromString ¶
func SpacedRuneFromString(s string) (*SpacedRune, error)
func (*SpacedRune) String ¶
func (sr *SpacedRune) String() string
type Tag ¶
type Tag uint8
const ( TagBody Tag = 0 TagFlags Tag = 2 TagRune Tag = 4 TagPremine Tag = 6 TagCap Tag = 8 TagAmount Tag = 10 TagHeightStart Tag = 12 TagHeightEnd Tag = 14 TagOffsetStart Tag = 16 TagOffsetEnd Tag = 18 TagMint Tag = 20 TagPointer Tag = 22 TagCenotaph Tag = 126 TagDivisibility Tag = 1 TagSpacers Tag = 3 TagSymbol Tag = 5 TagNop Tag = 127 )