shachain

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2016 License: MIT Imports: 8 Imported by: 81

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HyperShaChain

type HyperShaChain struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

HyperShaChain... * https://github.com/rustyrussell/ccan/blob/master/ccan/crypto/shachain/design.txt

func New

func New() *HyperShaChain

NewHyperShaChain

  • used to track their pre-images

func NewFromSeed

func NewFromSeed(seed *[32]byte, deriveTo uint64) (*HyperShaChain, error)

NewHyperShaChainFromSeed...

  • used to derive your own pre-images

func (*HyperShaChain) AddNextHash

func (h *HyperShaChain) AddNextHash(hash [32]byte) error

addHash

func (*HyperShaChain) CurrentPreImage

func (h *HyperShaChain) CurrentPreImage() *wire.ShaHash

CurrentPreImage...

func (*HyperShaChain) CurrentRevocationHash

func (h *HyperShaChain) CurrentRevocationHash() []byte

CurrentRevocationHash... TODO(roasbeef): *wire.ShaHash vs [wire.HashSize]byte ?

func (*HyperShaChain) Decode

func (h *HyperShaChain) Decode(b io.Reader) error

UnmarshallBinary...

func (*HyperShaChain) Encode

func (h *HyperShaChain) Encode(b io.Writer) error

MarshallBinary...

func (*HyperShaChain) GetHash

func (h *HyperShaChain) GetHash(index uint64) (*[32]byte, error)

getHash... index should be commitment #

func (*HyperShaChain) LocatePreImage

func (h *HyperShaChain) LocatePreImage(outputScript []byte) (uint64, *[32]byte)

LocatePreImage... Alice just broadcasted an old commitment tx, we need the revocation hash to claim the funds so we don't get cheated. However, we aren't storing all the pre-images in memory. So which shachain index # did she broadcast?

Jump to

Keyboard shortcuts

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