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)
- Alphabetic
- By Inheritance
- AdaptorUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def adaptorComplete(adaptorSecret: ECPrivateKey, adaptorSig: ECAdaptorSignature): ECDigitalSignature
Implements https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#decryption
- 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
- def adaptorSign(privateKey: ECPrivateKey, adaptorPoint: ECPublicKey, dataToSign: ByteVector, auxRand: ByteVector): ECAdaptorSignature
Implements https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#encrypted-signing
- def adaptorVerify(adaptorSig: ECAdaptorSignature, pubKey: ECPublicKey, data: ByteVector, adaptor: ECPublicKey): Boolean
https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#encryption-verification
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def extractAdaptorSecret(sig: ECDigitalSignature, adaptorSig: ECAdaptorSignature, adaptor: ECPublicKey): ECPrivateKey
Implements https://github.com/discreetlogcontracts/dlcspecs/blob/d01595b70269d4204b05510d19bba6a4f4fcff23/ECDSA-adaptor.md#key-recovery
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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
- 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
- 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
- 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
- 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
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()