o

org.bitcoins.crypto

AdaptorUtil

object AdaptorUtil

Implements the ECDSA Adaptor Signing Specification: https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md

Note that the naming is not entirely consistent between the specification and this file in hopes of making this code more readable.

The naming in this file more closely matches the naming in the secp256k1-zkp implementation: https://github.com/ElementsProject/secp256k1-zkp/tree/master/src/modules/ecdsa_adaptor

Legend: x <> privKey X <> pubKey y <> adaptorSecret Y <> adaptorPoint/adaptor messageHash <> dataToSign/data/message R_a <> untweakedNonce R <> tweakedNonce proof <> (e, s)

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AdaptorUtil
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def adaptorComplete(adaptorSecret: ECPrivateKey, adaptorSig: ECAdaptorSignature): ECDigitalSignature

    Implements https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#decryption

  5. def adaptorNonce(message: ByteVector, privKey: ECPrivateKey, adaptorPoint: ECPublicKey, algoName: String, auxRand: ByteVector): FieldElement

    Generates a secure random nonce as is done in BIP340: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki#default-signing

  6. def adaptorSign(privateKey: ECPrivateKey, adaptorPoint: ECPublicKey, dataToSign: ByteVector, auxRand: ByteVector): ECAdaptorSignature

    Implements https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#encrypted-signing

  7. def adaptorVerify(adaptorSig: ECAdaptorSignature, pubKey: ECPublicKey, data: ByteVector, adaptor: ECPublicKey): Boolean

    https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#encryption-verification

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. def extractAdaptorSecret(sig: ECDigitalSignature, adaptorSig: ECAdaptorSignature, adaptor: ECPublicKey): ECPrivateKey

    Implements https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#key-recovery

  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped