29 releases (breaking)

0.28.0 Aug 9, 2024
0.27.1 Dec 2, 2023
0.26.0 Oct 13, 2023
0.24.0 May 12, 2023
0.8.0 Mar 22, 2021

#94 in Programming languages

Download history 17/week @ 2024-06-28 47/week @ 2024-07-05 33/week @ 2024-07-12 33/week @ 2024-07-19 159/week @ 2024-07-26 49/week @ 2024-08-02 175/week @ 2024-08-09 43/week @ 2024-08-16 31/week @ 2024-08-23 43/week @ 2024-08-30 20/week @ 2024-09-06 40/week @ 2024-09-13 87/week @ 2024-09-20 35/week @ 2024-09-27 10/week @ 2024-10-04 10/week @ 2024-10-11

144 downloads per month
Used in 15 crates (6 directly)

CC0 license

1MB
21K SLoC

Latest Version Documentation

Features:

  • ErgoTree types, values, IR nodes definition;
  • ErgoTree IR nodes serialization;

ErgoTree IR

ErgoTree Specification

Descriptions for the operations can be found in ErgoTree Specification

Not yet implemented operations:

Object properties and methods

SigmaProp

  • isProven

Implemented operations (IR nodes):

General

  • Blocks (BlockValue);
  • Variable definition (ValDef, ValUse);
  • Function definition (FuncValue);
  • Function application(Apply);
  • Tuplse field access
  • 'If' conditional

Operations

  • comparison: >, <, >=, <=, ==, !=;
  • arithmetic: +, -, *, /, %;
  • logical: &&, ||;
  • | (bitwise OR);
  • & (bitwise AND);
  • ^ (bitwise XOR);
  • | (byte-wise XOR of two collections of bytes) #296;
  • unary !;
  • unary -;
  • ^ (logical XOR);
  • unary ~ (bit inversion);

Predefined functions

  • longToByteArray
  • byteArrayToBigInt
  • byteArrayToLong
  • upcast
  • allOf
  • anyOf
  • min
  • max
  • blake2b256
  • sha256
  • proveDlog
  • proveDHTuple
  • sigmaProp
  • substConstants
  • executeFromVar
  • executeFromSelfReg
  • getVar
  • allZK
  • anyZK
  • decodePoint
  • groupGenerator #332
  • xorOf #356
  • downcast
  • avlTree
  • treeLookup
  • atLeast

Object properties and methods

GroupElement

SigmaProp

  • propBytes

Box

  • value
  • propositionBytes
  • id
  • creationInfo
  • getReg
  • tokens
  • R0 .. R9
  • bytes
  • bytesWithoutRef

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

  • dataInputs
  • INPUTS
  • OUTPUTS
  • HEIGHT
  • SELF
  • minerPubKey
  • getVar
  • selfBoxIndex
  • headers
  • preHeader
  • LastBlockUtxoRootHash

AvlTree

  • digest
  • enabledOperations
  • keyLength
  • valueLengthOpt
  • isInsertAllowed
  • isUpdateAllowed
  • isRemoveAllowed
  • updateOperations
  • insert
  • updateDigest
  • contains
  • get
  • getMany
  • update
  • remove

Collection

  • size
  • getOrElse
  • map
  • exists
  • fold
  • forall
  • slice #300
  • filter
  • append #301
  • apply
  • flatMap
  • indexOf
  • zip #329
  • indices #314
  • patch #357
  • updated #358
  • updateMany #359

Option

  • isDefined
  • get
  • getOrElse
  • map #360
  • filter #360

Dependencies

~12–20MB
~319K SLoC