
Features:
- ErgoTree AST;
- Transactions, boxes, etc.;
- JSON serialization;
- Box builder(with mint token support);
- Transaction creation(builder) and signing;
- Box selection for funds and assets (with token burning support);
ErgoScript Language
ErgoScript Language Description
ErgoTree Specification
ErgoTree interpreter
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
!
;
- 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
- proveDlog
- proveDHTuple
- sigmaProp
- executeFromVar
- executeFromSelfReg
- getVar
- allZK
- anyZK
- decodePoint
- xorOf
Object properties and methods
Byte
- toByte
- toShort
- toInt
- toLong
- toBigInt
- toBytes
- toBits
Short
- toByte
- toShort
- toInt
- toLong
- toBigInt
- toBytes
- toBits
Int
- toByte
- toShort
- toInt
- toLong
- toBigInt
- toBytes
- toBits
Long
- toByte
- toShort
- toInt
- toLong
- toBigInt
- toBytes
- toBits
BigInt
- toByte
- toShort
- toInt
- toLong
- toBigInt
- toBytes
- toBits
GroupElement
- getEncoded
- exp
- multiply
- negate
SigmaProp
Box
- :heavycheckmark: value
- :heavycheckmark: propositionBytes
- bytes
- bytesWithoutRef
- id
- 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
- minerPubKey
- getVar
Collection
- :heavycheckmark: size
- getOrElse
- :heavycheckmark: map
- exists
- :heavycheckmark: fold
- forall
- slice
- :heavycheckmark: filter
- append
- :heavycheckmark: apply
- indices
- flatMap
- patch
- updated
- updateMany
- indexOf
- zip
Option
- isDefined
- :heavycheckmark: get
- getOrElse
- map
- filter
Crate features
json
(default feature)
JSON serialization for chain types using serde
.