6#ifndef OPENCBDC_TX_SRC_PARSEC_AGENT_RUNNERS_EVM_SIGNATURE_H_
7#define OPENCBDC_TX_SRC_PARSEC_AGENT_RUNNERS_EVM_SIGNATURE_H_
14#include <evmc/evmc.hpp>
15#include <evmc/hex.hpp>
18#include <secp256k1_extrakeys.h>
19#include <secp256k1_recovery.h>
33 const std::shared_ptr<secp256k1_context>& ctx,
34 uint64_t chain_id = opencbdc_chain_id) -> evm_sig;
43 const std::shared_ptr<secp256k1_context>& ctx,
44 uint64_t chain_id = opencbdc_chain_id)
45 -> std::optional<evmc::address>;
52 uint64_t chain_id = opencbdc_chain_id) ->
hash_t;
auto eth_sign(const privkey_t &key, hash_t &hash, evm_tx_type type, const std::shared_ptr< secp256k1_context > &ctx, uint64_t chain_id) -> evm_sig
Signs a hash using a privkey_t using ecdsa and produces an evm_sig struct Used primarily in unit test...
auto check_signature(const cbdc::parsec::agent::runner::evm_tx &tx, const std::shared_ptr< secp256k1_context > &ctx, uint64_t chain_id) -> std::optional< evmc::address >
Checks the signature of an EVM transaction.
evm_tx_type
 EVM transaction types.
auto sig_hash(const cbdc::parsec::agent::runner::evm_tx &tx, uint64_t chain_id) -> hash_t
Calculates the hash for creating / validating the signature.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
std::array< unsigned char, pubkey_len > privkey_t
A private key of a public/private keypair.