package ergoplatform
- Alphabetic
- Public
- Protected
Package Members
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.
Note, private constructor can only be used from within the ErgoBox companion object, e.g. by deserializer.
- 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
- 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.
- class SigmaPropProver extends ErgoLikeInterpreter with ProverInterpreter
Prover which can reduce ErgoTrees and prove sigma propositions using provided secrets.
- class SigmaPropVerifier extends ErgoLikeInterpreter
Verifier which can verify proofs generated by SigmaPropProver.
- class UnsignedErgoLikeTransaction extends ErgoLikeTransactionTemplate[UnsignedInput]
Unsigned version of
ErgoLikeTransactionTemplate
- class UnsignedInput extends AnyRef
Inputs of formed, but unsigned transaction
Value Members
- 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 ErgoTreePredef
- object Input extends Serializable
- object P2PKAddress
- object Pay2SAddress
- object Pay2SHAddress
- object UnsignedErgoLikeTransaction