Help us shape the future of Go! Take the 2026 Go Developer Survey

template

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 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(scriptBytes []byte, pubKey *ec.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