
Features:
- ErgoTree types, values, IR nodes definition;
- ErgoTree IR nodes serialization;
ErgoTree IR
ErgoTree Specification
Implemented operations (IR nodes) are denoted with :heavycheckmark:.
Descriptions for the operations can be found in ErgoTree Specification
General
- :heavycheckmark: Blocks (
BlockValue
);
- :heavycheckmark: Variable definition (
ValDef
, ValUse
);
- :heavycheckmark: Function definition (
FuncValue
);
- :heavycheckmark: Function application(
Apply
);
- :heavycheckmark: Tuplse field access
- :heavycheckmark: 'If' conditional
Operations
- :heavycheckmark: comparison:
>, <, >=, <=, ==, !=
;
- :heavycheckmark: arithmetic:
+, -, *, /, %
;
- :heavycheckmark: logical:
&&, ||
;
- | (bitwise OR);
- & (bitwise AND);
- ^ (logical XOR);
- ^ (bitwise XOR);
|
(byte-wise XOR of two collections of bytes);
- :heavycheckmark: unary
!
;
- :heavycheckmark: unary
-
;
- unary
~
(bit inversion);
>>
, <<
, >>>
(bit shifts);
Predefined functions
- groupGenerator
- xor
- substConstants
- longToByteArray
- byteArrayToBigInt
- byteArrayToLong
- downcast
- :heavycheckmark: upcast
- :heavycheckmark: allOf
- :heavycheckmark: anyOf
- atLeast
- :heavycheckmark: min
- :heavycheckmark: max
- avlTree
- treeLookup
- :heavycheckmark: blake2b256
- sha256
- :heavycheckmark: proveDlog
- :heavycheckmark: proveDHTuple
- :heavycheckmark: sigmaProp
- executeFromVar
- executeFromSelfReg
- getVar
- allZK
- anyZK
- :heavycheckmark: decodePoint
- xorOf
Object properties and methods
GroupElement
- getEncoded
- exp
- multiply
- negate
SigmaProp
- :heavycheckmark: propBytes
- isProven
Box
- :heavycheckmark: value
- :heavycheckmark: propositionBytes
- bytes
- bytesWithoutRef
- :heavycheckmark: id
- :heavycheckmark: creationInfo
- :heavycheckmark: getReg
- :heavycheckmark: tokens
- :heavycheckmark: R0 .. R9
AvlTree
- digest
- enabledOperations
- keyLength
- valueLengthOpt
- isInsertAllowed
- isUpdateAllowed
- isRemoveAllowed
- updateOperations
- contains
- get
- getMany
- insert
- update
- remove
- updateDigest
Header
- id
- version
- parentId
- ADProofsRoot
- stateRoot
- transactionsRoot
- timestamp
- nBits
- height
- extensionRoot
- minerPk
- powOnetimePk
- powNonce
- powDistance
- votes
PreHeader
- version
- parentId
- timestamp
- nBits
- height
- minerPk
- votes
Context
- :heavycheckmark: dataInputs
- headers
- preHeader
- :heavycheckmark: INPUTS
- :heavycheckmark: OUTPUTS
- :heavycheckmark: HEIGHT
- :heavycheckmark: SELF
- selfBoxIndex
- LastBlockUtxoRootHash
- :heavycheckmark: minerPubKey
- :heavycheckmark: getVar
Collection
- :heavycheckmark: size
- :heavycheckmark: getOrElse
- :heavycheckmark: map
- :heavycheckmark: exists
- :heavycheckmark: fold
- :heavycheckmark: forall
- slice
- :heavycheckmark: filter
- append
- :heavycheckmark: apply
- indices
- :heavycheckmark: flatMap
- patch
- updated
- updateMany
- :heavycheckmark: indexOf
- zip
Option
- :heavycheckmark: isDefined
- :heavycheckmark: get
- :heavycheckmark: getOrElse
- map
- filter