package ergoplatform
- Alphabetic
- Public
- All
Type Members
-
case class
DataInput(boxId: BoxId) extends Product with Serializable
Inputs, that are used to enrich script context, but won't be spent by the transaction
Inputs, that are used to enrich script context, but won't be spent by the transaction
- boxId
- id of a box to add into context (should be in UTXO)
-
sealed
trait
ErgoAddress extends AnyRef
An address is a short string corresponding to some script used to protect a box.
An address is a short string corresponding to some script used to protect a box. Unlike (string-encoded) binary representation of a script, an address has some useful characteristics:
- Integrity of an address could be checked., as it is incorporating a checksum. - A prefix of address is showing network and an address type. - An address is using an encoding (namely, Base58) which is avoiding similarly l0Oking characters, friendly to double-clicking and line-breaking in emails.
An address is encoding network type, address type, checksum, and enough information to watch for a particular scripts.
Possible network types are: Mainnet - 0x00 Testnet - 0x10
Address types are, semantics is described below: 0x01 - Pay-to-PublicKey(P2PK) address 0x02 - Pay-to-Script-Hash(P2SH) 0x03 - Pay-to-Script(P2S)
For an address type, we form content bytes as follows:
P2PK - serialized (compressed) public key P2SH - first 192 bits of the Blake2b256 hash of serialized script bytes P2S - serialized script
Address examples for testnet:
3 - P2PK (3WvsT2Gm4EpsM9Pg18PdY6XyhNNMqXDsvJTbbf6ihLvAmSb7u5RN) ? - P2SH (rbcrmKEYduUvADj9Ts3dSVSG27h54pgrq5fPuwB) ? - P2S (Ms7smJwLGbUAjuWQ)
for mainnet:
9 - P2PK (9fRAWhdxEsTcdb8PhGNrZfwqa65zfkuYHAMmkQLcic1gdLSV5vA) ? - P2SH (8UApt8czfFVuTgQmMwtsRBZ4nfWquNiSwCWUjMg) ? - P2S (4MQyML64GnzMxZgm, BxKBaHkvrTvLZrDcZjcsxsF7aSsrN73ijeFZXtbj4CXZHHcvBtqSxQ)
Prefix byte = network type + address type
checksum = blake2b256(prefix byte ++ content bytes)
address = prefix byte ++ content bytes ++ checksum
-
case class
ErgoAddressEncoder(networkPrefix: NetworkPrefix) extends Product with Serializable
Network-aware encoder for ErgoAddress <-> Base58String conversions.
Network-aware encoder for ErgoAddress <-> Base58String conversions.
- networkPrefix
network prefix value to be used in address encoding.
-
class
ErgoBox extends ErgoBoxCandidate
Box (aka coin, or an unspent output) is a basic concept of a UTXO-based cryptocurrency.
Box (aka coin, or an unspent output) is a basic concept of a UTXO-based cryptocurrency. In Bitcoin, such an object is associated with some monetary value (arbitrary, but with predefined precision, so we use integer arithmetic to work with the value), and also a guarding script (aka proposition) to protect the box from unauthorized opening.
In other way, a box is a state element locked by some proposition (ErgoTree).
In Ergo, box is just a collection of registers, some with mandatory types and semantics, others could be used by applications in any way. We add additional fields in addition to amount and proposition~(which stored in the registers R0 and R1). Namely, register R2 contains additional tokens (a sequence of pairs (token identifier, value)). Register R3 contains height when block got included into the blockchain and also transaction identifier and box index in the transaction outputs. Registers R4-R9 are free for arbitrary usage.
A transaction is unsealing a box. As a box can not be open twice, any further valid transaction can not be linked to the same box.
- trait ErgoBoxAssets extends AnyRef
- final case class ErgoBoxAssetsHolder(value: Long, tokens: Map[ModifierId, Long]) extends ErgoBoxAssets with Product with Serializable
-
class
ErgoBoxCandidate extends ErgoBoxAssets
Contains the same fields as
org.ergoplatform.ErgoBox
, except if transaction id and index, that will be calculated after full transaction formation.Contains the same fields as
org.ergoplatform.ErgoBox
, except if transaction id and index, that will be calculated after full transaction formation.- See also
org.ergoplatform.ErgoBox for more details
- trait ErgoBoxReader extends AnyRef
-
class
ErgoLikeContext extends InterpreterContext
Represents a script evaluation context to be passed to a prover and a verifier to execute and validate guarding proposition of input boxes of a transaction.
-
class
ErgoLikeInterpreter extends Interpreter
Base class of verifying interpreter which expects ErgoLikeContext as input of verify method.
Base class of verifying interpreter which expects ErgoLikeContext as input of verify method. It implements deserialization of register of SELF box.
-
class
ErgoLikeTransaction extends ErgoLikeTransactionTemplate[Input]
Signed version of
ErgoLikeTransactionTemplate
-
trait
ErgoLikeTransactionTemplate[IT <: UnsignedInput] extends AnyRef
Base trait of a real transaction to be used in Ergo network.
Base trait of a real transaction to be used in Ergo network. May be in unsigned (
UnsignedErgoLikeTransaction
) or in signed (ErgoLikeTransaction
) version. -
case class
Input(boxId: BoxId, spendingProof: ProverResult) extends UnsignedInput with Product with Serializable
Fully signed transaction input
Fully signed transaction input
- boxId
- id of a box to spent
- spendingProof
- proof of spending correctness
- trait JsonCodecs extends AnyRef
-
class
P2PKAddress extends ErgoAddress
Implementation of pay-to-public-key ErgoAddress.
-
class
Pay2SAddress extends ErgoAddress
Implementation of pay-to-script ErgoAddress.
-
class
Pay2SHAddress extends ErgoAddress
Implementation of pay-to-script-hash ErgoAddress.
-
case class
SizeConstant[T](value: T, id: Short, description: String)(implicit evidence$1: Numeric[T]) extends Product with Serializable
Descriptor of a constant which represents some size value.
Descriptor of a constant which represents some size value.
- T
type of the constant value
- value
value of the constant
- id
unique id of the constant
- description
description of the constant purpose
-
class
UnsignedErgoLikeTransaction extends ErgoLikeTransactionTemplate[UnsignedInput]
Unsigned version of
ErgoLikeTransactionTemplate
-
class
UnsignedInput extends AnyRef
Inputs of formed, but unsigned transaction
Value Members
-
object
Context extends Value[SContext.type] with NotReadyValue[SContext.type] with ValueCompanion with Product with Serializable
When interpreted evaluates to the singleton instance of special.sigma.Context.
When interpreted evaluates to the singleton instance of special.sigma.Context. Corresponds to
CONTEXT
variable in ErgoScript which can be used likeCONTEXT.headers
. - object ErgoAddressEncoder extends Serializable
- object ErgoBox
- object ErgoBoxAssetsHolder extends Serializable
- object ErgoBoxCandidate
- object ErgoLikeContext
- object ErgoLikeTransaction
- object ErgoLikeTransactionSerializer extends SigmaSerializer[ErgoLikeTransaction, ErgoLikeTransaction]
- object ErgoScriptPredef
-
object
Global extends Value[SGlobal.type] with NotReadyValue[SGlobal.type] with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to the singleton instance of special.sigma.SigmaDslBuilder.
When interpreted evaluates to the singleton instance of special.sigma.SigmaDslBuilder. Corresponds to
Global
variable in ErgoScript which can be used likeGlobal.groupGenerator
. -
object
Height extends Value[SInt.type] with NotReadyValueInt with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a IntConstant built from Context.currentHeight
- object Input extends Serializable
-
object
Inputs extends Value[SCollection[SBox.type]] with LazyCollection[SBox.type] with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a collection of BoxConstant built from Context.boxesToSpend
-
object
LastBlockUtxoRootHash extends Value[SAvlTree.type] with NotReadyValueAvlTree with ValueCompanion with Product with Serializable
When interpreted evaluates to a AvlTreeConstant built from Context.lastBlockUtxoRoot
-
object
MinerPubkey extends Value[SByteArray] with NotReadyValueByteArray with ValueCompanion with Product with Serializable
When interpreted evaluates to a ByteArrayConstant built from Context.minerPubkey
-
object
Outputs extends Value[SCollection[SBox.type]] with LazyCollection[SBox.type] with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a collection of BoxConstant built from Context.spendingTransaction.outputs
- object P2PKAddress
- object Pay2SAddress
- object Pay2SHAddress
-
object
Self extends Value[SBox.type] with NotReadyValueBox with FixedCostValueCompanion with Product with Serializable
When interpreted evaluates to a BoxConstant built from context.boxesToSpend(context.selfIndex)
-
object
SigmaConstants
Constants facade that provide access to the values used in sigma's logic and checks.
Constants facade that provide access to the values used in sigma's logic and checks. All the constants are collected in a sequence. Each constant has id, value and description. The constant ids are stable and never change. Some constant values may be defined in terms of other more fundamental values. In the future versions of sigma, the values may change, but due to versioned execution, all versions of the values should be available simultaneously.
- object UnsignedErgoLikeTransaction