Packages

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. def schnorrAdaptorComplete(adaptorSecret: ECPrivateKey, adaptorSig: SchnorrAdaptorSignature): SchnorrDigitalSignature

    Completes a Schnorr adaptor signature using the adaptor secret to create a valid Schnorr signature.

    Completes a Schnorr adaptor signature using the adaptor secret to create a valid Schnorr signature.

    https://github.com/ZhePang/Python_Specification_for_Schnorr_Adaptor/blob/51aa10bd6785d22d8fe4de85a4ecd2200efe1ef3/reference.py#L229

    adaptorSecret

    The secret key corresponding to the adaptor point

    adaptorSig

    The adaptor signature to complete

    returns

    The valid Schnorr digital signature

  21. def schnorrAdaptorSign(privateKey: ECPrivateKey, adaptorPoint: ECPublicKey, dataToSign: ByteVector, auxRand: ByteVector): SchnorrAdaptorSignature

    Signs a message using the Schnorr signature scheme with an adaptor signature.

    Signs a message using the Schnorr signature scheme with an adaptor signature.

    https://github.com/ZhePang/Python_Specification_for_Schnorr_Adaptor/blob/51aa10bd6785d22d8fe4de85a4ecd2200efe1ef3/reference.py#L162

    privateKey

    The private key of the signer

    adaptorPoint

    The adaptor point (public key of the adaptor secret)

    dataToSign

    The message to sign

    returns

    The Schnorr adaptor signature

  22. def schnorrAdaptorVerify(adaptorSig: SchnorrAdaptorSignature, pubKey: XOnlyPubKey, data: ByteVector, adaptor: ECPublicKey): Boolean

    Verifies a Schnorr adaptor signature.

    Verifies a Schnorr adaptor signature.

    https://github.com/ZhePang/Python_Specification_for_Schnorr_Adaptor/blob/51aa10bd6785d22d8fe4de85a4ecd2200efe1ef3/reference.py#L192

    adaptorSig

    The adaptor signature to verify

    pubKey

    The public key of the signer

    data

    The message that was signed

    adaptor

    The expected adaptor point

    returns

    True if the signature is valid, false otherwise

  23. def schnorrExtractAdaptor(data: ByteVector, pubKey: XOnlyPubKey, adaptorSig: SchnorrAdaptorSignature): ECPublicKey

    Extracts the adaptor point from a Schnorr adaptor signature.

    Extracts the adaptor point from a Schnorr adaptor signature.

    https://github.com/ZhePang/Python_Specification_for_Schnorr_Adaptor/blob/51aa10bd6785d22d8fe4de85a4ecd2200efe1ef3/reference.py#L204

    data

    The message that was signed

    pubKey

    The public key of the signer

    adaptorSig

    The adaptor signature

    returns

    The extracted adaptor point

  24. def schnorrExtractSecret(sig: SchnorrDigitalSignature, adaptorSig: SchnorrAdaptorSignature, adaptor: ECPublicKey): ECPrivateKey

    Extracts the adaptor secret from a valid Schnorr signature and its corresponding adaptor signature.

    Extracts the adaptor secret from a valid Schnorr signature and its corresponding adaptor signature.

    https://github.com/ZhePang/Python_Specification_for_Schnorr_Adaptor/blob/51aa10bd6785d22d8fe4de85a4ecd2200efe1ef3/reference.py#L246

    sig

    The valid Schnorr digital signature

    adaptorSig

    The adaptor signature

    adaptor

    The adaptor point (public key of the secret)

    returns

    The extracted adaptor secret

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped