template

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package template provides a collection of functions and types for working with script templates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evaluate

func Evaluate(script []byte, pubKey *bec.PublicKey) ([]byte, error)

Evaluate processes a given Bitcoin script by parsing it, replacing certain opcodes with the public key hash, and returning the resulting script as a byte array. Will replace any OP_PUBKEYHASH or OP_PUBKEY

Parameters: - script: A byte array representing the input script. - pubKey: A pointer to a bec.PublicKey which provides the dedicated public key to be used in the evaluation.

Returns: - A byte array representing the evaluated script, or nil if an error occurs.

Types

type OutputTemplate

type OutputTemplate struct {
	Script   string `json:"script"`
	Satoshis uint64 `json:"satoshis"`
}

OutputTemplate represents the script and satoshis for a Pike output

func P2PKH

func P2PKH(satoshis uint64) (*OutputTemplate, error)

P2PKH creates a single output with the PIKE template

Jump to

Keyboard shortcuts

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