Package: secp256k1-zkp-mw
secp256k1-zkp-mwThis is an early stage version of Python CFFI wrapper of theMW fork of secp256k1-zkp. It is very much needed to develop themimblewimble-py. Similar way as it was done withrust-secp256k1-zkp. It is also inspired and partially based onsecp256k1-py. All of the code used here is under the MIT license and there is no license conflict.For now only few methods are correctly wrapped. My attempts of wrapping more of them results with plenty of C compile errors which I don't always understand so any help is appreciated. Feel free to fork and PR or send me messages with some advices!InstallationThe module will automatically download the tarball containingMW fork of secp256k1-zkpat the commit that is supported and tested in this release.pipinstallsecp256k1-zkp-mwand you're good to go!If you're installing this module on Windows you might need to temporarily change yourTEMPenvironmental variable to something with a short path, likeC:\temp, and create that folder before running the above command. This is done to workaround a limitation with the Visual Studio C/C++ compiler not being able to use files with long path names. You can revert the change to yourTEMPenvironmental variable after the module is installed.DevelopmentLocally, you may install this this module manually at arbitrary height of theMW fork of secp256k1-zkpusing submodule.gitclonehttps://github.com/grinventions/secp256k1-zkp-mw.gitcdsecp256k1-zkp-mw
gitsubmoduleinit
gitsubmoduleupdate
pipinstall.Try it!Creating and destroying contextfromsecp256k1_zkp_mwimport*print('Running secp256k1_context_create(SECP256K1_CONTEXT_NONE)')ctx=secp256k1_context_create(SECP256K1_CONTEXT_NONE)print('...and it returned ctx')print(ctx)print('Running secp256k1_context_destroy(ctx)')res=secp256k1_context_destroy(ctx)it will printRunning secp256k1_context_create(SECP256K1_CONTEXT_NONE)
...and it returned ctx
<cdata 'struct secp256k1_context_struct *' 0x561c4da348e0>
Running secp256k1_context_destroy(ctx)ExportsIndexSECP256K1_FLAGS_TYPE_MASKSECP256K1_FLAGS_TYPE_CONTEXTSECP256K1_FLAGS_TYPE_COMPRESSIONSECP256K1_FLAGS_BIT_CONTEXT_VERIFYSECP256K1_FLAGS_BIT_CONTEXT_SIGNSECP256K1_FLAGS_BIT_COMPRESSIONSECP256K1_CONTEXT_VERIFYSECP256K1_CONTEXT_SIGNSECP256K1_CONTEXT_NONESECP256K1_EC_COMPRESSEDSECP256K1_EC_UNCOMPRESSEDSECP256K1_TAG_PUBKEY_EVENSECP256K1_TAG_PUBKEY_ODDSECP256K1_TAG_PUBKEY_UNCOMPRESSEDSECP256K1_TAG_PUBKEY_HYBRID_EVENSECP256K1_TAG_PUBKEY_HYBRID_ODDSECP256K1_BULLETPROOF_MAX_DEPTHSECP256K1_BULLETPROOF_MAX_PROOFSECP256K1_SURJECTIONPROOF_MAX_N_INPUTSSECP256K1_SURJECTIONPROOF_SERIALIZATION_BYTESSECP256K1_SURJECTIONPROOF_SERIALIZATION_BYTES_MAXSECP256K1_WHITELIST_MAX_N_KEYSsecp256k1_context_no_precompsecp256k1_nonce_function_rfc6979secp256k1_nonce_function_defaultsecp256k1_generator_hsecp256k1_generator_const_gsecp256k1_generator_const_hsecp256k1_context_createsecp256k1_context_clonesecp256k1_context_destroysecp256k1_context_set_illegal_callbacksecp256k1_context_set_error_callbacksecp256k1_scratch_space_createsecp256k1_scratch_space_destroysecp256k1_ec_pubkey_parsesecp256k1_ec_pubkey_serializesecp256k1_ecdsa_signature_parse_compactsecp256k1_ecdsa_signature_parse_dersecp256k1_ecdsa_signature_serialize_dersecp256k1_ecdsa_signature_serialize_compactsecp256k1_ecdsa_verifysecp256k1_ecdsa_signature_normalizesecp256k1_ecdsa_signsecp256k1_ec_seckey_verifysecp256k1_ec_pubkey_createsecp256k1_ec_privkey_negatesecp256k1_ec_pubkey_negatesecp256k1_ec_privkey_tweak_addsecp256k1_ec_pubkey_tweak_addsecp256k1_ec_privkey_tweak_mulsecp256k1_ec_pubkey_tweak_mulsecp256k1_context_randomizesecp256k1_ec_pubkey_combinesecp256k1_ec_privkey_tweak_invsecp256k1_ec_privkey_tweak_negsecp256k1_aggsig_context_createsecp256k1_aggsig_context_destroysecp256k1_aggsig_generate_noncesecp256k1_aggsig_export_secnonce_singlesecp256k1_aggsig_sign_singlesecp256k1_aggsig_partial_signsecp256k1_aggsig_combine_signaturessecp256k1_aggsig_add_signatures_singlesecp256k1_aggsig_verify_singlesecp256k1_aggsig_verifysecp256k1_aggsig_build_scratch_and_verifysecp256k1_bulletproof_generators_createsecp256k1_bulletproof_generators_destroysecp256k1_bulletproof_rangeproof_verifysecp256k1_bulletproof_rangeproof_verify_multisecp256k1_bulletproof_rangeproof_rewindsecp256k1_bulletproof_rangeproof_provesecp256k1_pedersen_commitment_parsesecp256k1_pedersen_commitment_serializesecp256k1_pedersen_commitsecp256k1_pedersen_blind_commitsecp256k1_pedersen_blind_sumsecp256k1_pedersen_commit_sumsecp256k1_pedersen_verify_tallysecp256k1_pedersen_blind_generator_blind_sumsecp256k1_blind_switchsecp256k1_pedersen_commitment_to_pubkeysecp256k1_pubkey_to_pedersen_commitmentsecp256k1_ecdhsecp256k1_generator_parsesecp256k1_generator_serializesecp256k1_generator_generatesecp256k1_generator_generate_blindedsecp256k1_context_preallocated_sizesecp256k1_context_preallocated_createsecp256k1_context_preallocated_clone_sizesecp256k1_context_preallocated_clonesecp256k1_context_preallocated_destroysecp256k1_rangeproof_verifysecp256k1_rangeproof_rewindsecp256k1_rangeproof_signsecp256k1_rangeproof_infosecp256k1_ecdsa_recoverable_signature_parse_compactsecp256k1_ecdsa_recoverable_signature_convertsecp256k1_ecdsa_recoverable_signature_serialize_compactsecp256k1_ecdsa_sign_recoverablesecp256k1_ecdsa_recoversecp256k1_schnorrsig_serializesecp256k1_schnorrsig_parsesecp256k1_schnorrsig_signsecp256k1_schnorrsig_verifysecp256k1_schnorrsig_verify_batchsecp256k1_surjectionproof_parsesecp256k1_surjectionproof_serializesecp256k1_surjectionproof_n_total_inputssecp256k1_surjectionproof_n_used_inputssecp256k1_surjectionproof_serialized_sizesecp256k1_surjectionproof_initializesecp256k1_surjectionproof_generatesecp256k1_surjectionproof_verifysecp256k1_whitelist_signature_parsesecp256k1_whitelist_signature_n_keyssecp256k1_whitelist_signature_serializesecp256k1_whitelist_signsecp256k1_whitelist_verifyDefinitionsNameTypeDescriptionSECP256K1_FLAGS_TYPE_MASKintUsed internally by other definitions. Should not be used directly.SECP256K1_FLAGS_TYPE_CONTEXTintUsed internally by other definitions. Should not be used directly.SECP256K1_FLAGS_TYPE_COMPRESSIONintUsed internally by other definitions. Should not be used directly.SECP256K1_FLAGS_BIT_CONTEXT_VERIFYintUsed internally by other definitions. Should not be used directly.SECP256K1_FLAGS_BIT_CONTEXT_SIGNintUsed internally by other definitions. Should not be used directly.SECP256K1_FLAGS_BIT_COMPRESSIONintUsed internally by other definitions. Should not be used directly.SECP256K1_CONTEXT_VERIFYintUsed as a bit-field in theflagsargument for thesecp256k1_context_create,secp256k1_context_preallocated_size, andsecp256k1_context_preallocated_createfunctions to indicate that the context will be used for verifying.SECP256K1_CONTEXT_SIGNintUsed as a bit-field in theflagsargument for thesecp256k1_context_create,secp256k1_context_preallocated_size, andsecp256k1_context_preallocated_createfunctions to indicate that the context will be used for signing.SECP256K1_CONTEXT_NONEintUsed as a bit-field in theflagsargument for thesecp256k1_context_create,secp256k1_context_preallocated_size, andsecp256k1_context_preallocated_createfunctions to indicate that the context won't be used for verifying or signing.SECP256K1_EC_COMPRESSEDintUsed as a bit-field in thesecp256k1_ec_pubkey_serializefunction to indicate that the public key should be compressed.SECP256K1_EC_UNCOMPRESSEDintUsed as a bit-field in thesecp256k1_ec_pubkey_serializefunction to indicate that the public key should be uncompressed.SECP256K1_TAG_PUBKEY_EVENintPrefix byte for serialized even, compressed public keys.SECP256K1_TAG_PUBKEY_ODDintPrefix byte for serialized odd, compressed public keys.SECP256K1_TAG_PUBKEY_UNCOMPRESSEDintPrefix byte for serialized uncompressed public keys.SECP256K1_TAG_PUBKEY_HYBRID_EVENintPrefix byte for serialized even, hybrid public keys.SECP256K1_TAG_PUBKEY_HYBRID_ODDintPrefix byte for serialized odd, hybrid public keys.SECP256K1_BULLETPROOF_MAX_DEPTHintMaximum depth of a Bulletproof.SECP256K1_BULLETPROOF_MAX_PROOFintMaximum size in bytes of a Bulletproof.SECP256K1_SURJECTIONPROOF_MAX_N_INPUTSintMaximum number of inputs in a surjection proof.SECP256K1_SURJECTIONPROOF_SERIALIZATION_BYTESfunctionFunction that provides the number of bytes required to serialized a surjection proof given the number of inputs and the number of used inputs.SECP256K1_SURJECTIONPROOF_SERIALIZATION_BYTES_MAXintMaximum size in bytes of a serialized surjection proof.SECP256K1_WHITELIST_MAX_N_KEYSintMaximum number of keys in a whitelist proof.ConstantsNameTypeDescriptionsecp256k1_context_no_precomp<cdata 'struct secp256k1_context *'>A context with no precomputed tables that can be used when a context won't be verifying or signing.secp256k1_nonce_function_rfc6979<cdata 'secp256k1_nonce_function'>A nonce generation function that implements RFC6979. An optional 32 byte of extra entropy can be provided to this function as nonce data.secp256k1_nonce_function_default<cdata 'secp256k1_nonce_function'>The default nonce generation function.secp256k1_generator_h<cdata 'struct secp256k1_generator *'>Standard secp256k1 generator h.secp256k1_generator_const_g<cdata 'struct secp256k1_generator *'>Standard secp256k1 generator g.secp256k1_generator_const_h<cdata 'struct secp256k1_generator *'>Standard secp256k1 generator h.FunctionsAll of the following functions will raise the following exceptions for the described reasons:TypeError: An argument doesn't have the correct type.OverflowError: Anintargument is negative or too large.AssertionError: Something internally failed in an unexpected way.secp256k1_context_createReturns a context that can perform the features indicated by the provided flags.Definition:secp256k1_context_create(flags)Parameters:NameTypeDescriptionflagsintBitwise combination ofSECP256K1_CONTEXT_VERIFY,SECP256K1_CONTEXT_SIGN, and/orSECP256K1_CONTEXT_NONE.Return on success:<cdata 'struct secp256k1_context *'>Return on failure:Nonesecp256k1_context_cloneReturns a copy of a provided context.Definition:secp256k1_context_clone(ctx)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to copy.Return on success:<cdata 'struct secp256k1_context *'>Return on failure:Nonesecp256k1_context_destroyDeallocates memory used by a provided context or does nothing if the provided context isNone.Definition:secp256k1_context_destroy(ctx)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>orNoneThe context to destroy.Return on success:N/AReturn on failure:N/Asecp256k1_context_set_illegal_callbackSets a callback function to call when an illegal argument is passed to an internal API call, or restores the default handler if the callback function isNone.Definition:secp256k1_context_set_illegal_callback(ctx, fun, data)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.fun<ctype 'void(*)(char *, void *)'>orNoneThe callback function to use.data<cdata 'void *'>orNoneData to pass to the callback function.Return on success:N/AReturn on failure:N/Asecp256k1_context_set_error_callbackSets a callback function to call when an internal consistency check fails, or restores the default handler if the callback function isNone.Definition:secp256k1_context_set_error_callback(ctx, fun, data)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.fun<ctype 'void(*)(char *, void *)'> orNone`The callback function to use.data<cdata 'void *'>orNoneData to pass to the callback function.Return on success:N/AReturn on failure:N/Asecp256k1_scratch_space_createReturns a scratch space that is at most the provided max size.Definition:secp256k1_scratch_space_create(ctx, max_size)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.max_sizeintThe maximum amount of memory to allocate.Return on success:<cdata 'struct secp256k1_scratch_space *'>Return on failure:Nonesecp256k1_scratch_space_destroyDeallocates memory used by a provided scratch space or does nothing if the scratch space isNone.Definition:secp256k1_scratch_space_destroy(scratch)Parameters:NameTypeDescriptionscratch<cdata 'struct secp256k1_scratch_space *'>orNoneThe scratch space to destroy.Return on success:N/AReturn on failure:N/Asecp256k1_ec_pubkey_parseReturns a public key if the provided input is a valid serialized public key.Definition:secp256k1_ec_pubkey_parse(ctx, input)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.inputbytesThe serialized public key to parse.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_ec_pubkey_serializeReturns the serialized version of a provided public key.Definition:secp256k1_ec_pubkey_serialize(ctx, pubkey, flags)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.pubkey<cdata 'struct secp256k1_pubkey *'>The public key to serialize.flagsintSECP256K1_EC_COMPRESSEDorSECP256K1_EC_UNCOMPRESSEDReturn on success:bytesReturn on failure:Nonesecp256k1_ecdsa_signature_parse_compactReturns an ECDSA signature if the provided input is a valid serialized ECDSA compact signature.Definition:secp256k1_ecdsa_signature_parse_compact(ctx, input64)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.input64bytesThe 64 byte serialized ECDSA compact signature to parse.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:Nonesecp256k1_ecdsa_signature_parse_derReturns an ECDSA signature if the provided input is a valid serialized ECDSA DER signature.Definition:secp256k1_ecdsa_signature_parse_der(ctx, input)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.inputbytesThe serialized ECDSA DER signature to parse.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:Nonesecp256k1_ecdsa_signature_serialize_derReturns the serialized DER version of a provided ECDSA signature.Definition:secp256k1_ecdsa_signature_serialize_der(ctx, sig)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_ecdsa_signature *'>The ECDSA signature to serialize.Return on success:bytesReturn on failure:Nonesecp256k1_ecdsa_signature_serialize_compactReturns the serialized compact version of a provided ECDSA signature.Definition:secp256k1_ecdsa_signature_serialize_compact(ctx, sig)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_ecdsa_signature *'>The ECDSA signature to serialize.Return on success:bytesReturn on failure:Nonesecp256k1_ecdsa_verifyReturns if the ECDSA signature is valid for the provided public key and message.Definition:secp256k1_ecdsa_verify(ctx, sig, msg32, pubkey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_ecdsa_signature *'>The ECDSA signature.msg32bytesThe 32 byte message that was signed.pubkey<cdata 'struct secp256k1_pubkey *'>The public key corresponding to the secret key that signed the message.Return on success:boolReturn on failure:N/Asecp256k1_ecdsa_signature_normalizeReturns the normalized version of the provided signature.Definition:secp256k1_ecdsa_signature_normalize(ctx, sigin)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sigin<cdata 'struct secp256k1_ecdsa_signature *'>The ECDSA signature to normalize.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:N/Asecp256k1_ecdsa_signReturns the ECDSA signature that signs a provided message with a provided secret key. A nonce function and nonce data can be provided to specify which nonce function to use.Definition:secp256k1_ecdsa_sign(ctx, msg32, seckey, noncefp, ndata)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.msg32bytesThe 32 byte message to sign.seckeybytesThe 32 byte secret key to sign the message with.noncefp<cdata 'secp256k1_nonce_function'>orNoneThe nonce function to use. Default tosecp256k1_nonce_function_defaultifNoneis provided.ndatabytesorNoneData to use with the nonce function.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:Nonesecp256k1_ec_seckey_verifyReturns if a provided secret key is valid.Definition:secp256k1_ec_seckey_verify(ctx, seckey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckeybytesThe 32 byte secret key to verify.Return on success:boolReturn on failure:N/Asecp256k1_ec_pubkey_createReturns the public key for a provided secret key.Definition:secp256k1_ec_pubkey_create(ctx, seckey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckeybytesThe 32 byte secret key to get the public key of.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_ec_privkey_negateReturns the negated version of a provided secret key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided secret key.Definition:secp256k1_ec_privkey_negate(ctx, seckey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckeybytesThe 32 byte secret key to use.Return on success:bytesReturn on failure:Nonesecp256k1_ec_pubkey_negateReturns the negated version of a provided public key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided public key.Definition:secp256k1_ec_pubkey_negate(ctx, pubkey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.pubkey<cdata 'struct secp256k1_pubkey *'>The public key to use.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_ec_privkey_tweak_addReturns the result of tweak adding with a provided secret key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided secret key.Definition:secp256k1_ec_privkey_tweak_add(ctx, seckey, tweak)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckeybytesThe 32 byte secret key to use.tweakbytesThe 32 byte tweak to use.Return on success:bytesReturn on failure:Nonesecp256k1_ec_pubkey_tweak_addReturns the result of tweak adding with a provided public key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided public key.Definition:secp256k1_ec_pubkey_tweak_add(ctx, pubkey, tweak)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckey<cdata 'struct secp256k1_pubkey *'>The public key to use.tweakbytesThe 32 byte tweak to use.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_ec_privkey_tweak_mulReturns the result of tweak multiplying with to a provided secret key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided secret key.Definition:secp256k1_ec_privkey_tweak_mul(ctx, seckey, tweak)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckeybytesThe 32 byte secret key to use.tweakbytesThe 32 byte tweak to use.Return on success:bytesReturn on failure:Nonesecp256k1_ec_pubkey_tweak_mulReturns the result of tweak multiplying with a provided public key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided public key.Definition:secp256k1_ec_pubkey_tweak_mul(ctx, pubkey, tweak)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckey<cdata 'struct secp256k1_pubkey *'>The public key to use.tweakbytesThe 32 byte tweak to use.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_context_randomizeReturns the the randomized version of a provided context using an optional seed. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided context.Definition:secp256k1_context_randomize(ctx, seed32)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seed32bytesorNoneThe 32 byte seed to use.Return on success:<cdata 'struct secp256k1_context *'>Return on failure:Nonesecp256k1_ec_pubkey_combineReturns the the result of combining a list if public keys.Definition:secp256k1_ec_pubkey_combine(ctx, ins)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.inslist<<cdata 'struct secp256k1_pubkey *'>>The list of public keys to combine.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_ec_privkey_tweak_invReturns the result of tweak inverting a provided secret key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided secret key.Definition:secp256k1_ec_privkey_tweak_inv(ctx, seckey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckeybytesThe 32 byte secret key to use.Return on success:bytesReturn on failure:Nonesecp256k1_ec_privkey_tweak_negReturns the result of tweak negating a provided secret key. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided secret key.Definition:secp256k1_ec_privkey_tweak_neg(ctx, seckey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seckeybytesThe 32 byte secret key to use.Return on success:bytesReturn on failure:Nonesecp256k1_aggsig_context_createReturns an aggsig context.Definition:secp256k1_aggsig_context_create(ctx, pubkeys, seed)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.pubkeyslist<<cdata 'struct secp256k1_pubkey *'>>The list of public keys that the context can aggregate the signatures for.seedbytesThe 32 byte seed used for nonce-generating.Return on success:<cdata 'struct secp256k1_aggsig_context *'>Return on failure:Nonesecp256k1_aggsig_context_destroyDeallocates memory used by a provided aggsig context or does nothing if the provided aggsig context isNone.Definition:secp256k1_aggsig_context_destroy(aggctx)Parameters:NameTypeDescriptionaggctx<cdata 'struct secp256k1_aggsig_context *'>orNoneThe aggsig context to destroy.Return on success:N/AReturn on failure:N/Asecp256k1_aggsig_generate_nonceReturns if a nonce pair was successfully generated for the aggregate signature.Definition:secp256k1_aggsig_generate_nonce(ctx, aggctx, index)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.aggctx<cdata 'struct secp256k1_aggsig_context *'>The aggsig context to use.indexintThe index of the signature to generate the nonce for.Return on success:boolReturn on failure:N/Asecp256k1_aggsig_export_secnonce_singleReturns a secret nonce.Definition:secp256k1_aggsig_export_secnonce_single(ctx, seed)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seedbytesThe 32 byte random seed.Return on success:bytesReturn on failure:Nonesecp256k1_aggsig_sign_singleReturns a single-signer signature.Definition:secp256k1_aggsig_sign_single(ctx, msg32, seckey32, secnonce32, extra32, pubnonce_for_e, pubnonce_total, pubkey_for_e, seed)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.msg32bytesThe 32 byte message to sign.seckey32bytesThe 32 byte secret key to sign the message with.secnonce32bytesorNoneThe 32 byte secret nonce to use. A nonce will be generated ifNoneis used.extra32bytesorNone32 bytes that will be added to s if notNone.pubnonce_for_e<cdata 'struct secp256k1_pubkey *'>orNoneThis will be encoded in e instead of the derived if notNone.pubnonce_total<cdata 'struct secp256k1_pubkey *'>orNoneAllows this signature to be included in combined signature in all cases by negating secnonce32 if the this value isn'tNoneand has Jacobi symbol -1.pubkey_for_e<cdata 'struct secp256k1_pubkey *'>orNoneThis will be encoded in e if notNone.seedbytesThe 32 byte seed used for nonce-generating.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:Nonesecp256k1_aggsig_partial_signReturns a signature part in an aggregated signature.Definition:secp256k1_aggsig_partial_sign(ctx, aggctx, msg32, seckey32, index)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.aggctx<cdata 'struct secp256k1_aggsig_context *'>The aggsig context to use.msg32bytesThe 32 byte message to sign.seckey32bytesThe 32 byte secret key to sign the message with.indexintThe index of the signature in the aggregate signature.Return on success:<cdata 'struct secp256k1_aggsig_partial_signature *'>Return on failure:Nonesecp256k1_aggsig_combine_signaturesReturns aggregated signature created from multiple signature parts.Definition:secp256k1_aggsig_combine_signatures(ctx, aggctx, partial)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.aggctx<cdata 'struct secp256k1_aggsig_context *'>The aggsig context to use.partiallist<<cdata 'struct secp256k1_aggsig_partial_signature *'>>List of partial signatures to aggregate.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:Nonesecp256k1_aggsig_add_signatures_singleReturns the result of adding two signatures into a single signature.Definition:secp256k1_aggsig_add_signatures_single(ctx, sigs, pubnonce_total)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sigslist<<cdata 'struct secp256k1_ecdsa_signature *'>>List of signatures to add.pubnonce_total<cdata 'struct secp256k1_pubkey *'>The total of all public nonces.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:Nonesecp256k1_aggsig_verify_singleReturns if a single-signer signature verifies a provided message.Definition:secp256k1_aggsig_verify_single(ctx, sig64, msg32, pubnonce, pubkey, pubkey_total, extra_pubkey, is_partial)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig64<cdata 'struct secp256k1_ecdsa_signature *'>The signature to verify the message.msg32bytesThe 32 byte message to verify.pubnonce<cdata 'struct secp256k1_pubkey *'>orNoneThis value overrides the public nonce used to calculate e if notNone.pubkey<cdata 'struct secp256k1_pubkey *'>The public key of the secret key that signed the message.pubkey_total<cdata 'struct secp256k1_pubkey *'>orNoneThis value is encoded in e if notNone.extra_pubkey<cdata 'struct secp256k1_pubkey *'>orNoneThis value value is subtracted from sG if notNone.is_partialboolAllows verifying partial signatures that may have had their secret nonces negated.Return on success:boolReturn on failure:N/Asecp256k1_aggsig_verifyReturns if an aggregated signature verifies a provided message.Definition:secp256k1_aggsig_verify(ctx, scratch, sig64, msg32, pubkeys)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.scratch<cdata 'struct secp256k1_scratch_space *'>Scratch space to use.sig64<cdata 'struct secp256k1_ecdsa_signature *'>The signature to verify the message.msg32bytesThe 32 byte message to verify.pubkeyslist<<cdata 'struct secp256k1_pubkey *'>>List of public keys of the secret keys that signed the message.Return on success:boolReturn on failure:N/Asecp256k1_aggsig_build_scratch_and_verifyReturns if an aggregated signature verifies a provided message without needing a provided scratch space.Definition:secp256k1_aggsig_build_scratch_and_verify(ctx, sig64, msg32, pubkeys)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig64<cdata 'struct secp256k1_ecdsa_signature *'>The signature to verify the message.msg32bytesThe 32 byte message to verify.pubkeyslist<<cdata 'struct secp256k1_pubkey *'>>List of public keys of the secret keys that signed the message.Return on success:boolReturn on failure:N/Asecp256k1_bulletproof_generators_createReturns a Bulletproof generators with the provided number of generators.Definition:secp256k1_bulletproof_generators_create(ctx, blinding_gen, n)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.blinding_gen<cdata 'secp256k1_generator *'>The generator that the blinding factors will be multiplied by.nintThe number of generators to produce.Return on success:<cdata 'struct secp256k1_bulletproof_generators *'>Return on failure:Nonesecp256k1_bulletproof_generators_destroyDeallocates memory used by a provided Bulletproof generators or does nothing if the Bulletproof generators isNone.Definition:secp256k1_bulletproof_generators_destroy(ctx, gen)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.gen<cdata 'struct secp256k1_bulletproof_generators *'>orNoneThe Bulletproof generators to destroy.Return on success:N/AReturn on failure:N/Asecp256k1_bulletproof_rangeproof_verifyReturns if a provided Bulletproof is valid.Definition:secp256k1_bulletproof_rangeproof_verify(ctx, scratch, gens, proof, min_value, commit, nbits, value_gen, extra_commit)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.scratch<cdata 'struct secp256k1_scratch_space *'>The scratch space to use.gens<cdata 'struct secp256k1_bulletproof_generators *'>The Bulletproof generators set to use.proofbytesThe Bulletproof to verify.min_valuelist<int>orNoneThe list of minimum values to prove the range is above. Defaults to all zeros ifNone.commitlist<<cdata 'struct secp256k1_pedersen_commitment *'>>The list of Pedersen commitments that the Bulletproof is over.nbitsintThe number of bits proven by the Bulletproof.value_gen<cdata 'struct secp256k1_generator *'>The generator multiplied by the value in the Pedersen commitments.extra_commitbytesorNoneThe optional additional data committed to by the Bulletproof.Return on success:boolReturn on failure:N/Asecp256k1_bulletproof_rangeproof_verify_multiReturns if all provided Bulletproofs are valid.Definition:secp256k1_bulletproof_rangeproof_verify_multi(ctx, scratch, gens, proof, min_value, commit, nbits, value_gen, extra_commit)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.scratch<cdata 'struct secp256k1_scratch_space *'>The scratch space to use.gens<cdata 'struct secp256k1_bulletproof_generators *'>The Bulletproof generators set to use.prooflist<bytes>The list of Bulletproofs to verify.min_valuelist<list<int>>orNoneThe list of list of minimum values to prove each range is above. Defaults to all zeros ifNone.commitlist<list<<cdata 'struct secp256k1_pedersen_commitment *'>>>The list of list of Pedersen commitments that each Bulletproof is over.nbitsintThe number of bits proven by each Bulletproof.value_genlist<<cdata 'struct secp256k1_generator *'>>The list of generators multiplied by the value in each Pedersen commitments.extra_commitlist<bytes>orNoneThe list of optional additional data committed to by each Bulletproof.Return on success:boolReturn on failure:N/Asecp256k1_bulletproof_rangeproof_rewindReturns the value, blinding factor, and message from a provided Bulletproof.Definition:secp256k1_bulletproof_rangeproof_rewind(ctx, proof, min_value, commit, value_gen, nonce, extra_commit)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proofbytesThe proof to get the information for.min_valueintThe minimum value that the Bulletproof ranges over.commit<cdata 'struct secp256k1_pedersen_commitment *'>The Pedersen commitment that the Bulletproof is over.value_gen<cdata 'struct secp256k1_generator *'>The generator multiplied by the value in the Pedersen commitment.noncebytesThe 32 byte random seed used to derive blinding factors.extra_commitbytesorNoneThe optional additional data committed to by the Bulletproof.Return on success:tuple<int, bytes, bytes>Return on failure:Nonesecp256k1_bulletproof_rangeproof_proveReturns a Bulletproof that proves the provided committed values.Definition:secp256k1_bulletproof_rangeproof_prove(ctx, scratch, gens, tau_x, t_one, t_two, value, min_value, blind, commits, value_gen, nbits, nonce, private_nonce, extra_commit, message)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.scratch<cdata 'struct secp256k1_scratch_space *'>The scratch space to use.gens<cdata 'struct secp256k1_bulletproof_generators *'>The Bulletproof generators set to use.tau_xbytesorNoneThe 32 byte tau x to use for a multi-party proof.t_one<cdata 'struct secp256k1_pubkey *'>orNoneThe t one to use for a multi-party proof.t_two<cdata 'struct secp256k1_pubkey *'>orNoneThe t two to use for a multi-party proof.valuelist<int>The list of values to commit.min_valuelist<int>orNoneThe list of minimum values to prove the range is above. Defaults to all zeros ifNone.blindlist<bytes>The list of 32 byte blinding factors for the Pedersen commitments.commitslist<<cdata 'struct secp256k1_pedersen_commitment *'>>orNoneThe list of Pedersen commitments to use for a multi-party proof.value_gen<cdata 'struct secp256k1_generator *'>The generator to multiply by the value in the Pedersen commitments.nbitsintThe number of bits proven by the Bulletproof.noncebytesThe 32 byte random seed used to derive blinding factors.private_noncebytesorNoneThe 32 byte random seed used to derive private blinding factors for a multi-party proof.extra_commitbytesorNoneThe optional additional data committed to by the Bulletproof.messagebytesorNoneThe optional 20 byte message that can be recovered by rewinding the Bulletproof. Defaults to all zeros ifNone.Return on success:bytesReturn on failure:Nonesecp256k1_pedersen_commitment_parseReturns a commit if the provided input is a valid serialized commit.Definition:secp256k1_pedersen_commitment_parse(ctx, input)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.inputbytesThe serialized commit to parse.Return on success:<cdata 'struct secp256k1_pedersen_commitment *'>Return on failure:Nonesecp256k1_pedersen_commitment_serializeReturns the serialized version of a provided commit.Definition:secp256k1_pedersen_commitment_serialize(ctx, commit)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.commit<cdata 'struct secp256k1_pedersen_commitment *'>The commit to serialize.Return on success:bytesReturn on failure:Nonesecp256k1_pedersen_commitReturns a commit for the provided number value.Definition:secp256k1_pedersen_commit(ctx, blind, value, value_gen, blind_gen)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.blindbytesThe 32 byte blinding factor to use.valueintThe value to get the commit for.value_gen<cdata 'struct secp256k1_generator *'>The value generator to use.blind_gen<cdata 'struct secp256k1_generator *'>The blind generator to use.Return on success:<cdata 'struct secp256k1_pedersen_commitment *'>Return on failure:Nonesecp256k1_pedersen_blind_commitReturns a commit for the provided blinding factor value.Definition:secp256k1_pedersen_blind_commit(ctx, blind, value, value_gen, blind_gen)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.blindbytesThe 32 byte blinding factor to use.valuebytesThe 32 byte value to get the commit for.value_gen<cdata 'struct secp256k1_generator *'>The value generator to use.blind_gen<cdata 'struct secp256k1_generator *'>The blind generator to use.Return on success:<cdata 'struct secp256k1_pedersen_commitment *'>Return on failure:Nonesecp256k1_pedersen_blind_sumReturns the sum of provided blinding factors.Definition:secp256k1_pedersen_blind_sum(ctx, blinds, npositive)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.blindslist<bytes>The list of 32 byte blinding factor to use.npositiveintHow many of the blinding factors should be treated as being positive.Return on success:bytesReturn on failure:Nonesecp256k1_pedersen_commit_sumReturns the sum of provided positive and negative commits.Definition:secp256k1_pedersen_commit_sum(ctx, commits, ncommits)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.commitslist<<cdata 'struct secp256k1_pedersen_commitment *'>>The list of positive commits to use.ncommitslist<<cdata 'struct secp256k1_pedersen_commitment *'>>The list of negative commits to use.Return on success:<cdata 'struct secp256k1_pedersen_commitment *'>Return on failure:Nonesecp256k1_pedersen_verify_tallyReturns if the provided positive and negative commits sum to zero.Definition:secp256k1_pedersen_verify_tally(ctx, pos, neg)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.poslist<<cdata 'struct secp256k1_pedersen_commitment *'>>The list of positive commits to use.neglist<<cdata 'struct secp256k1_pedersen_commitment *'>>The list of negative commits to use.Return on success:boolReturn on failure:N/Asecp256k1_pedersen_blind_generator_blind_sumReturns the final blinding factor value needed to get the total sum to zero. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided blinding factor.Definition:secp256k1_pedersen_blind_generator_blind_sum(ctx, value, generator_blind, blinding_factor, n_inputs)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.valuelist<int>The list of values to use.generator_blindlist<bytes>The list of asset blinding factors to use.blinding_factorlist<bytes>List of commitment blinding factors to use.n_inputsintThe number of values that will be negated in the final sum.Return on success:bytesReturn on failure:Nonesecp256k1_blind_switchReturns the blinding factor used in the switch commit.Definition:secp256k1_blind_switch(ctx, blind, value, value_gen, blind_gen, switch_pubkey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.blindbytesThe 32 byte blinding factor to use.valueintThe value to commit to.value_gen<cdata 'struct secp256k1_generator *'>The value generator to use.blind_gen<cdata 'struct secp256k1_generator *'>The blind generator to use.switch_pubkey<cdata 'struct secp256k1_pubkey *'>The public key to use.Return on success:bytesReturn on failure:Nonesecp256k1_pedersen_commitment_to_pubkeyReturns the public key version of a provided commit.Definition:secp256k1_pedersen_commitment_to_pubkey(ctx, commit)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.commit<cdata 'struct secp256k1_pedersen_commitment *'>The commit to use.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_pubkey_to_pedersen_commitmentReturns the commit version of a provided public key.Definition:secp256k1_pubkey_to_pedersen_commitment(ctx, pubkey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.pubkey<cdata 'struct secp256k1_pubkey *'>The public key to use.Return on success:<cdata 'struct secp256k1_pedersen_commitment *'>Return on failure:Nonesecp256k1_ecdhReturns the EC Diffie-Hellman shared secret for the provided public key and private key.Definition:secp256k1_ecdh(ctx, pubkey, privkey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.pubkey<cdata 'struct secp256k1_pubkey *'>The public key to use.privkeybytesThe 32 byte secret key to use.Return on success:bytesReturn on failure:Nonesecp256k1_generator_parseReturns a generator if the provided input is a valid serialized generator.Definition:secp256k1_generator_parse(ctx, input)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.inputbytesThe serialized generator to parse.Return on success:<cdata 'struct secp256k1_generator *'>Return on failure:Nonesecp256k1_generator_serializeReturns the serialized version of a provided generator.Definition:secp256k1_generator_serialize(ctx, commit)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.commit<cdata 'struct secp256k1_generator *'>The generator to serialize.Return on success:bytesReturn on failure:Nonesecp256k1_generator_generateReturns a generator created with a provided seed.Definition:secp256k1_generator_generate(ctx, seed32)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.seed32bytesThe 32 byte seed to use.Return on success:<cdata 'struct secp256k1_generator *'>Return on failure:Nonesecp256k1_generator_generate_blindedReturns a blinded generator created with a provided key and blinding factor.Definition:secp256k1_generator_generate_blinded(ctx, key32, blind32)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.key32bytesThe 32 byte key to use.blind32bytesThe 32 byte blinding factor to use.Return on success:<cdata 'struct secp256k1_generator *'>Return on failure:Nonesecp256k1_context_preallocated_sizeReturns the size in bytes required to create the type of preallocated context indicated by the provided flags.Definition:secp256k1_context_preallocated_size(flags)Parameters:NameTypeDescriptionflagsintBitwise combination ofSECP256K1_CONTEXT_VERIFY,SECP256K1_CONTEXT_SIGN, and/orSECP256K1_CONTEXT_NONE.Return on success:intReturn on failure:N/Asecp256k1_context_preallocated_createReturns a context that uses the preallocated memory provided which can perform the features indicated by the provided flags.Definition:secp256k1_context_preallocated_create(prealloc, flags)Parameters:NameTypeDescriptionprealloc<cdata 'void *'>The preallocated memory for the context to use.flagsintBitwise combination ofSECP256K1_CONTEXT_VERIFY,SECP256K1_CONTEXT_SIGN, and/orSECP256K1_CONTEXT_NONE.Return on success:<cdata 'struct secp256k1_context *'>Return on failure:Nonesecp256k1_context_preallocated_clone_sizeReturns the size in bytes required to create a preallocated context to clone a provided context.Definition:secp256k1_context_preallocated_clone_size(ctx)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to get the preallocated size of.Return on success:intReturn on failure:N/Asecp256k1_context_preallocated_cloneReturns a copy of a provided context that uses the preallocated memory provided.Definition:secp256k1_context_preallocated_clone(ctx, prealloc)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to copy.prealloc<cdata 'void *'>The preallocated memory for the context to use.Return on success:<cdata 'struct secp256k1_context *'>Return on failure:Nonesecp256k1_context_preallocated_destroyDestroys a provided preallocated context or does nothing if the provided preallocated context isNone.Definition:secp256k1_context_preallocated_destroy(ctx)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>orNoneThe preallocated context to destroy.Return on success:N/AReturn on failure:N/Asecp256k1_rangeproof_verifyReturns the min and max values for a provided committed value if the provided rangeproof is valid for it.Definition:secp256k1_rangeproof_verify(ctx, commit, proof, extra_commit, gen)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.commit<cdata 'struct secp256k1_pedersen_commitment *'>The commit for the committed value.proofbytesThe rangeproof to verify.extra_commitbytesorNoneThe optional additional data covered in the rangeproof.gen<cdata 'struct secp256k1_generator *'>The additional generator.Return on success:tuple<int, int>Return on failure:Nonesecp256k1_rangeproof_rewindReturns the blinding factor, value, message, min value, and max value for a provided rangeproof. The returned message's length isn't the actual length of the message, and this bug is inherent to libsecp256k1-zkp.Definition:secp256k1_rangeproof_rewind(ctx, nonce, commit, proof, extra_commit, gen)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.noncebytesThe 32 byte secret nonce used to create the rangeproof.commit<cdata 'struct secp256k1_pedersen_commitment *'>The commit for the committed value.proofbytesThe rangeproof to get values for.extra_commitbytesorNoneThe optional additional data covered in the rangeproof.gen<cdata 'struct secp256k1_generator *'>The additional generator.Return on success:tuple<bytes, int, bytes, int, int>Return on failure:Nonesecp256k1_rangeproof_signReturns a rangeproof that proves a committed value is within a range.Definition:secp256k1_rangeproof_sign(ctx, min_value, commit, blind, nonce, exp, min_bits, value, message, extra_commit, gen)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.min_valueintThe min value for the rangeproof to prove.commit<cdata 'struct secp256k1_pedersen_commitment *'>The commit for the committed value.blindbytesThe 32 byte blinding factor used by the commit.noncebytesThe 32 byte secret nonce to use.expintThe exponent to use.min_bitsintThe number of bits of the value to keep private. (0 = auto/minimal, - 64).valueintThe committed value.messagebytesorNoneThe optional 4096 byte message to embed in the rangeproof.extra_commitbytesorNoneThe optional additional data to cover in the rangeproof.gen<cdata 'struct secp256k1_generator *'>The additional generator.Return on success:bytesReturn on failure:Nonesecp256k1_rangeproof_infoReturns the exponent, mantissa, min value, and max value for a provided rangeproof.Definition:secp256k1_rangeproof_info(ctx, proof)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proofbytesThe rangeproof to get info for.Return on success:tuple<int, int, int, int>Return on failure:Nonesecp256k1_ecdsa_recoverable_signature_parse_compactReturns a recoverable signature if the provided input is a valid serialized recoverable signature.Definition:secp256k1_ecdsa_recoverable_signature_parse_compact(ctx, input64, recid)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.input64bytesThe 64 byte serialized recoverable signature to parse.recidintThe recovery ID.Return on success:<cdata 'struct secp256k1_ecdsa_recoverable_signature *'>Return on failure:Nonesecp256k1_ecdsa_recoverable_signature_convertReturns the ECDSA signature version of a provided recoverable signature.Definition:secp256k1_ecdsa_recoverable_signature_convert(ctx, sigin)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sigin<cdata 'struct secp256k1_ecdsa_recoverable_signature *'>The recoverable signature to convert.Return on success:<cdata 'struct secp256k1_ecdsa_signature *'>Return on failure:Nonesecp256k1_ecdsa_recoverable_signature_serialize_compactReturns the serialized version and recovery ID of a provided recoverable signature.Definition:secp256k1_ecdsa_recoverable_signature_serialize_compact(ctx, sig)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_ecdsa_recoverable_signature *'>The recoverable signature to serialize.Return on success:tuple<bytes, int>Return on failure:Nonesecp256k1_ecdsa_sign_recoverableReturns the recoverable signature that signs a provided message with a provided secret key. A nonce function and nonce data can be provided to specify which nonce function to use.Definition:secp256k1_ecdsa_sign_recoverable(ctx, msg32, seckey, noncefp, ndata)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.msg32bytesThe 32 byte message to sign.seckeybytesThe 32 byte secret key to sign the message with.noncefp<cdata 'secp256k1_nonce_function'>orNoneThe nonce function to use. Default tosecp256k1_nonce_function_defaultifNoneis provided.ndatabytesorNoneData to use with the nonce function.Return on success:<cdata 'struct secp256k1_ecdsa_recoverable_signature *'>Return on failure:Nonesecp256k1_ecdsa_recoverReturns a public key obtained from a provided recoverable signature and message.Definition:secp256k1_ecdsa_recover(ctx, sig, msg32)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_ecdsa_recoverable_signature *'>The recoverable signature to get the public key from.msg32bytesThe 32 byte message to that was signed.Return on success:<cdata 'struct secp256k1_pubkey *'>Return on failure:Nonesecp256k1_schnorrsig_serializeReturns the serialized version of a provided Schnorr signature.Definition:secp256k1_schnorrsig_serialize(ctx, sig)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_schnorrsig *'>The Schnorr signature to serialize.Return on success:bytesReturn on failure:Nonesecp256k1_schnorrsig_parseReturns a Schnorr signature if the provided input is a valid serialized Schnorr signature.Definition:secp256k1_schnorrsig_parse(ctx, in64)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.in64bytesThe 64 byte serialized Schnorr signature to parse.Return on success:<cdata 'struct secp256k1_schnorrsig *'>Return on failure:Nonesecp256k1_schnorrsig_signReturns the Schnorr signature that signs a provided message with a provided secret key and if the nonce is negated. A nonce function and nonce data can be provided to specify which nonce function to use.Definition:secp256k1_schnorrsig_sign(ctx, msg32, seckey, noncefp, ndata)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.msg32bytesThe 32 byte message to sign.seckeybytesThe 32 byte secret key to sign the message with.noncefp<cdata 'secp256k1_nonce_function'>orNoneThe nonce function to use. Default tosecp256k1_nonce_function_bipschnorrifNoneis provided.ndatabytesorNoneData to use with the nonce function.Return on success:tuple<<cdata 'struct secp256k1_schnorrsig *'>, bool>Return on failure:Nonesecp256k1_schnorrsig_verifyReturns if the Schnorr signature is valid for the provided public key and message.Definition:secp256k1_schnorrsig_verify(ctx, sig, msg32, pubkey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_schnorrsig *'>The Schnorr signature.msg32bytesThe 32 byte message that was signed.pubkey<cdata 'struct secp256k1_pubkey *'>The public key corresponding to the secret key that signed the message.Return on success:boolReturn on failure:N/Asecp256k1_schnorrsig_verify_batchReturns if all the Schnorr signatures are valid for the provided public keys and messages.Definition:secp256k1_schnorrsig_verify_batch(ctx, scratch, sig, msg32, pk)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.scratch<cdata 'struct secp256k1_scratch_space *'>Scratch space to use.siglist<<cdata 'struct secp256k1_schnorrsig *'>>The Schnorr signatures.msg32list<bytes>The 32 byte messages that were signed.pklist<<cdata 'struct secp256k1_pubkey *'>>The public keys corresponding to the secret keys that signed the messages.Return on success:boolReturn on failure:N/Asecp256k1_surjectionproof_parseReturns a surjection proof if the provided input is a valid serialized surjection proof.Definition:secp256k1_surjectionproof_parse(ctx, input)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.inputbytesThe serialized surjection proof to parse.Return on success:<cdata 'struct secp256k1_surjectionproof *'>Return on failure:Nonesecp256k1_surjectionproof_serializeReturns the serialized version of a provided surjection proof.Definition:secp256k1_surjectionproof_serialize(ctx, proof)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proof<cdata 'struct secp256k1_surjectionproof *'>The surjection proof to serialize.Return on success:bytesReturn on failure:Nonesecp256k1_surjectionproof_n_total_inputsReturns the number of total inputs for a provided surjection proof.Definition:secp256k1_surjectionproof_n_total_inputs(ctx, proof)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proof<cdata 'struct secp256k1_surjectionproof *'>The surjection proof to get the number of total inputs for.Return on success:intReturn on failure:N/Asecp256k1_surjectionproof_n_used_inputsReturns the number of used inputs for a provided surjection proof.Definition:secp256k1_surjectionproof_n_used_inputs(ctx, proof)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proof<cdata 'struct secp256k1_surjectionproof *'>The surjection proof to get the number of used inputs for.Return on success:intReturn on failure:N/Asecp256k1_surjectionproof_serialized_sizeReturns the size in bytes required to serialize a provided surjection proof.Definition:secp256k1_surjectionproof_serialized_size(ctx, proof)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proof<cdata 'struct secp256k1_surjectionproof *'>The surjection proof to get the serialized size for.Return on success:intReturn on failure:N/Asecp256k1_surjectionproof_initializeReturns an initialized surjection proof and its input index.Definition:secp256k1_surjectionproof_initialize(ctx, fixed_input_tags, n_input_tags_to_use, fixed_output_tag, n_max_iterations, random_seed32)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.fixed_input_tagslist<<cdata 'struct secp256k1_fixed_asset_tag *'>>The fixed input tags for all inputs.n_input_tags_to_useintThe number of inputs to select randomly to put in the anonymity set.fixed_output_tag<cdata 'struct secp256k1_fixed_asset_tag *'>The fixed output tag.n_max_iterationsintThe max number of iterations to do before giving up.random_seed32bytesThe 32 byte random seed to use for input selection.Return on success:tuple<<cdata 'struct secp256k1_surjectionproof *'>, int>Return on failure:Nonesecp256k1_surjectionproof_generateReturns the generated version of a provided initialized surjection proof. This function differs from its libsecp256k1-zkp equivalent in that it doesn't modify the provided proof.Definition:secp256k1_surjectionproof_generate(ctx, proof, ephemeral_input_tags, ephemeral_output_tag, input_index, input_blinding_key, output_blinding_key)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proof<cdata 'struct secp256k1_surjectionproof *'>The initialized surjection proof to use.ephemeral_input_tagslist<<cdata 'struct secp256k1_generator *'>>The ephemeral asset tags for all inputs.ephemeral_output_tag<cdata 'struct secp256k1_generator *'>The ephemeral asset tag for the output.input_indexintThe index of the input that actually maps to the output.input_blinding_keybytesThe 32 byte blinding key of the input.output_blinding_keybytesThe 32 byte blinding key of the output.Return on success:<cdata 'struct secp256k1_surjectionproof *'>Return on failure:Nonesecp256k1_surjectionproof_verifyReturns if verifying a provided surjection proof was successful.Definition:secp256k1_surjectionproof_verify(ctx, proof, ephemeral_input_tags, ephemeral_output_tag)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.proof<cdata 'struct secp256k1_surjectionproof *'>The surjection proof to verify.ephemeral_input_tagslist<<cdata 'struct secp256k1_generator *'>>The ephemeral asset tags for all inputs.ephemeral_output_tag<cdata 'struct secp256k1_generator *'>The ephemeral asset tag for the output.Return on success:boolReturn on failure:N/Asecp256k1_whitelist_signature_parseReturns a whitelist signature if the provided input is a valid serialized whitelist signature.Definition:secp256k1_whitelist_signature_parse(ctx, input)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.inputbytesThe serialized whitelist signature to parse.Return on success:<cdata 'struct secp256k1_whitelist_signature *'>Return on failure:Nonesecp256k1_whitelist_signature_n_keysReturns the number of keys for a provided whitelist signature.Definition:secp256k1_whitelist_signature_n_keys(sig)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_whitelist_signature *'>The whitelist signature to get the number of keys for.Return on success:intReturn on failure:N/Asecp256k1_whitelist_signature_serializeReturns the serialized version of a provided whitelist signature.Definition:secp256k1_whitelist_signature_serialize(ctx, sig)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.sig<cdata 'struct secp256k1_whitelist_signature *'>The whitelist signature to serialize.Return on success:bytesReturn on failure:Nonesecp256k1_whitelist_signReturns the whitelist signature that signs a provided public key with a provided secret key from a group. A nonce function and nonce data can be provided to specify which nonce function to use.Definition:secp256k1_whitelist_sign(ctx, online_pubkeys, offline_pubkeys, sub_pubkey, online_seckey, summed_seckey, index, noncefp, noncedata)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.online_pubkeyslist<<cdata 'struct secp256k1_pubkey *'>>The list of online public keys.offline_pubkeyslist<<cdata 'struct secp256k1_pubkey *'>>The list of offline public keys.sub_pubkey<cdata 'struct secp256k1_pubkey *'>The public key to be whitelisted.online_seckeybytesThe 32 byte online secret key to sign the public key with.summed_seckeybytesThe 32 byte secret key to the sum of the whitelisted public key's secret key and the offline secret key.indexintThe index of the signer's key in the list of keys.noncefp<cdata 'secp256k1_nonce_function'>orNoneThe nonce function to use. Default tosecp256k1_nonce_function_defaultifNoneis provided.noncedatabytesorNoneData to use with the nonce function.Return on success:<cdata 'struct secp256k1_whitelist_signature *'>Return on failure:Nonesecp256k1_whitelist_verifyReturns the whitelist signature verifies that a provided public key is whitelisted.Definition:secp256k1_whitelist_verify(ctx, sig, online_pubkeys, offline_pubkeys, sub_pubkey)Parameters:NameTypeDescriptionctx<cdata 'struct secp256k1_context *'>The context to use.online_pubkeyslist<<cdata 'struct secp256k1_pubkey *'>>The list of online public keys.offline_pubkeyslist<<cdata 'struct secp256k1_pubkey *'>>The list of offline public keys.sub_pubkey<cdata 'struct secp256k1_pubkey *'>The public key to verify.Return on success:boolReturn on failure:N/A