Documentation ¶
Index ¶
Constants ¶
View Source
const ( CommitmentLen = 32 ScriptHashLen = 32 AmountLen = 8 AssetIDLen = 32 StateLen = 128 SaltLen = 32 )
View Source
const NullifierSize = hash.HashSize
Variables ¶
View Source
var ErrIDStrSize = fmt.Errorf("max ID string length is %v bytes", hash.HashSize*2)
View Source
var IlliumCoinID = NewID(bytes.Repeat([]byte{0x00}, 32))
Functions ¶
This section is empty.
Types ¶
type Amount ¶
type Amount uint64
Amount represents the base illium monetary unit (to be named later). The total number of coins issued is not expected to overflow an uint64 for 250 years from genesis.
type HexEncodable ¶
type HexEncodable []byte
func (HexEncodable) MarshalJSON ¶
func (h HexEncodable) MarshalJSON() ([]byte, error)
func (*HexEncodable) UnmarshalJSON ¶
func (h *HexEncodable) UnmarshalJSON(data []byte) error
type ID ¶
func NewIDFromData ¶
func NewIDFromString ¶
func (ID) Compare ¶
Compare returns 1 if hash > target, -1 if hash < target and 0 if hash == target.
func (*ID) MarshalJSON ¶
func (*ID) UnmarshalJSON ¶
type Nullifier ¶
func CalculateNullifier ¶
func CalculateNullifier(commitmentIndex uint64, salt [32]byte, scriptCommitment []byte, scriptParams ...[]byte) (Nullifier, error)
CalculateNullifier calculates and returns the nullifier for the given inputs.
func NewNullifier ¶
func NewNullifierFromString ¶
func (*Nullifier) MarshalJSON ¶
func (*Nullifier) UnmarshalJSON ¶
type Serializable ¶
type SpendNote ¶
type SpendNote struct { ScriptHash []byte Amount Amount AssetID ID State [StateLen]byte Salt [SaltLen]byte }
SpendNote holds all the data that makes up an output commitment.
func (*SpendNote) Commitment ¶
Commitment serializes and hashes the data in the note and returns the hash.
func (*SpendNote) Deserialize ¶
type UnlockingScript ¶
func (*UnlockingScript) Hash ¶
func (u *UnlockingScript) Hash() ID
func (*UnlockingScript) Serialize ¶
func (u *UnlockingScript) Serialize() []byte
Click to show internal directories.
Click to hide internal directories.