Trait

org.ergoplatform

ErgoAddress

Related Doc: package ergoplatform

Permalink

sealed trait ErgoAddress extends AnyRef

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

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ErgoAddress
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract val addressTypePrefix: Byte

    Permalink

    Address type code used to differentiate between pay-to-public-key, pay-to-script, pay-to-script-hash addresses.

    Address type code used to differentiate between pay-to-public-key, pay-to-script, pay-to-script-hash addresses.

    NOTE: Network type code is defined by ErgoAddressEncoder attached to each ErgoAddress instance and it is not included in this value.

    See also

    P2PKAddress, Pay2SAddress, Pay2SHAddress

  2. abstract val contentBytes: Array[Byte]

    Permalink

    Serialized bytes of the address content (depending on the address type).

    Serialized bytes of the address content (depending on the address type). Doesn't include network type and address type prefix byte.

    See also

    P2PKAddress, Pay2SAddress, Pay2SHAddress

  3. abstract def networkPrefix: NetworkPrefix

    Permalink

    Network type code to be used in address encoding.

  4. abstract val script: ErgoTree

    Permalink

    ErgoTree which corresponds to the address (depending on the address type).

    ErgoTree which corresponds to the address (depending on the address type).

    See also

    P2PKAddress, Pay2SAddress, Pay2SHAddress

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped