Coverity (#28)
* stratum_server: resolve CID 210144 (UNINIT_CTOR)
* stratum_server: resolve CID 210042/210085/210104 (UNCAUGHT_EXCEPT)
The potential to throw exists within the logger,
remove_blockchain_update_listener, and any paths involving the logger
(including CATCH_ENTRY_*).
* epee: misc_log_ex: create CATCH_ENTRY_NO_RETURN macro
A temporary substition for what I hope will eventually be a full-fledged
exception-dispatcher (class-based, not macro).
* stratum_server: resolve CID 210080/210084/210089 (UNCAUGHT_EXCEPT)
The potential to throw exists within the logger,
remove_protocol_handler, and any paths involving the logger
(including CATCH_ENTRY_*).
* epee: levin_protocol_handler_async: resolve CID 210140/210182/210165 (UNCAUGHT_EXCEPT)
The potential to throw exists within guarded_critical_region_t, and any
paths involving the logger (including CATCH_ENTRY_*).
* epee: levin_protocol_handler_async: resolve CID 210110/210119/210155 (UNCAUGHT_EXCEPT)
The potential to throw exists within the logger, del_connection, and any
paths involving the logger (including CATCH_ENTRY_*).
* epee: misc_log_ex: move macros to *top* of file
so they can be used *within* this file.
* daemon: resolve CID 210069/210092/210166 (UNCAUGHT_EXCEPT)
The potential to throw exists within log_space, and any paths involving
the logger (including CATCH_ENTRY_*).
* daemon: return cstdlib proper types in main
* simplewallet: resolve 6 different CIDs (UNCAUGHT_EXCEPT)
CID: 210082
CID: 210086
CID: 210096
CID: 210147
CID: 210149
CID: 210150
The potential to throw exists throughout various paths in main.
* simplewallet: return cstdlib proper types in main
* simplewallet: resolve CID 210128/210160 (UNCAUGHT_EXCEPT)
The potential to throw exists within various paths, and any paths
involving the logger (including CATCH_ENTRY_*).
* conn_tool: resolve 5 different CIDs (UNCAUGHT_EXCEPT)
CID: 210038
CID: 210047
CID: 210108
CID: 210122
CID: 210157
The potential to throw exists throughout various paths in main.
* conn_tool: return cstdlib proper types in main
* miniupnp_helper: resolve CID 210050 (UNCAUGHT_EXCEPT)
The potential to throw exists within deinit, including any paths
involving the logger (including CATCH_ENTRY_*).
* epee: profile_tools: resolve CID 210055 (UNCAUGHT_EXCEPT)
The potential to throw exists within boost microsec_clock::localtime(),
and any paths involving the logger (including CATCH_ENTRY_*).
* db_backend_lmdb: resolve CID 210056/210133 (UNCAUGHT_EXCEPT)
The potential to throw exists within close(), including any paths
involving the logger (including CATCH_ENTRY_*).
* epee: misc_log_ex: resolve CID 210060/210124 (UNCAUGHT_EXCEPT)
The potential to throw exists within several paths, including any paths
involving the logger (including CATCH_ENTRY_*).
* epee: misc_language: resolve 4 CIDs (UNCAUGHT_EXCEPT)
CID: 210064
CID: 210093
CID: 210136
CID: 210139
The potential to throw exists within m_func(), including any paths
involving the logger (including CATCH_ENTRY_*).
* db_abstract_accessor: resolve 4 CIDs (UNCAUGHT_EXCEPT)
CID: 210072
CID: 210094
CID: 210116
CID: 210141
The potential to throw exists within m_cache.clear(), including any
paths involving the logger (including CATCH_ENTRY_*).
* epee: net_helper: resolve CID 210100 (UNCAUGHT_EXCEPT)
The potential to throw exists within shutdown(), including any
paths involving the logger (including CATCH_ENTRY_*).
* epee: syncobj: resolve CID 210123 (UNCAUGHT_EXCEPT)
The potential to throw exists within unlock(), including any
paths involving the logger (including CATCH_ENTRY_*).
* epee: profile_tools: resolve CID 210145/210154 (UNCAUGHT_EXCEPT)
The potential to throw exists within various paths, including any paths
involving the logger (including CATCH_ENTRY_*).
* epee: http_base: resolve CID 210176 (UNINIT_CTOR)
* p2p: net_node: resolve CID 210173 (UNINIT_CTOR)
* epee: net_helper: resolve CID 210138 (UNINIT_CTOR)
* p2p: net_peerlist: resolve CID 210137 (UNINIT_CTOR)
* currency_basic: resolve CID 210117 (UNINIT_CTOR)
* epee: abstract_tcp_server2: resolve 3 CIDs (UNINIT_CTOR)
CID: 210040
CID: 210090
CID: 210105
* simplewallet: resolve CID 210103 (UNINIT_CTOR)
* epee: levin_protocol_handler_async: resolve CID 210091 (UNINIT_CTOR)
* json_archive: resolve CID 210087 (UNINIT_CTOR)
* epee: levin_protocol_handler_async: resolve CID 210073 (UNINIT_CTOR)
* miniupnp_helper: resolve CID 210037 (UNINIT_CTOR)
* crypto: ge_frombytes_vartime: resolve CID 210142 (CHECKED_RETURN)
* wallet2: resolve CID 210041 (CHECKED_RETURN)
* epee: misc_log_ex: resolve CID 210127 (DEADCODE)
* epee: levin_protocol_handler_sync: resolve 3 CIDs (PASS_BY_VALUE)
CID: 210167
CID: 210170
CID: 210180
* p2p: net_node: resolve CID 210065 (PASS_BY_VALUE)
* epee: levin_abstract_invoke2: resolve CID 210049 (PASS_BY_VALUE)
* epee: abstract_tcp_server2: resolve CID 210045 (PASS_BY_VALUE)
* epee: misc_log_ex: add NESTED_*_ENTRY macros
* simplewallet: use NESTED_*_ENTRY in message_writer dtor
* stratum_protocol_handler_config: use NESTED_*_ENTRY in dtor
* stratum_protocol_handler: use NESTED_*_ENTRY in dtor
* lmdb_db_backend: use NESTED_*_ENTRY in dtor
* epee: abstract_tcp_server2: resolve 4 CIDs (UNCAUGHT_EXCEPT)
CID: 210088
CID: 210106
CID: 210164
CID: 210179
The potential to throw exists within various paths, including any
paths involving the logger (including CATCH_ENTRY_*).
* db_abstract_accessor: use NESTED_*_ENTRY in dtor
* miniupnp_helper: use NESTED_*_ENTRY in dtor
* epee: misc_log_ex: use NESTED_*_ENTRY in log_frame dtor
* epee: levin_protocol_handler_async: use NESTED_*_ENTRY in dtors
* epee: net_helper: use NESTED_*_ENTRY in dtor
* epee: profile_tools: use NESTED_*_ENTRY in dtors
* epee: misc_language: use NESTED_*_ENTRY in dtor
* epee: syncobj: use NESTED_*_ENTRY in dtor
* zano: license contact w/ zano.org email instead of sekreta.org email
2019-05-20 09:32:36 +00:00
// Copyright (c) 2014-2019 Zano Project
2018-12-27 18:50:45 +03:00
// Copyright (c) 2014-2018 The Louisdor Project
// Copyright (c) 2012-2013 The Cryptonote developers
// Copyright (c) 2014-2015 The Boolberry developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
# pragma once
# include <type_traits>
# include <boost/variant.hpp>
# include <boost/functional/hash/hash.hpp>
# include <boost/mpl/back_inserter.hpp>
# include <boost/mpl/copy.hpp>
# include <boost/mpl/unique.hpp>
# include <boost/mpl/list.hpp>
# include <boost/mpl/equal.hpp>
2020-04-27 14:52:31 +03:00
# include <boost/mpl/vector/vector30.hpp>
2018-12-27 18:50:45 +03:00
# include <boost/type_traits/is_same.hpp>
# include <vector>
# include <cstring> // memcmp
# include <sstream>
# include <chrono>
# include "include_base_utils.h"
# include "serialization/binary_archive.h"
2022-05-10 21:56:42 +02:00
# include "common/crypto_serialization.h"
2018-12-27 18:50:45 +03:00
# include "serialization/stl_containers.h"
# include "serialization/serialization.h"
# include "serialization/variant.h"
# include "serialization/json_archive.h"
# include "serialization/debug_archive.h"
# include "serialization/keyvalue_serialization.h" // epee key-value serialization
# include "string_tools.h"
# include "currency_config.h"
# include "crypto/crypto.h"
# include "crypto/hash.h"
2022-05-10 21:10:33 +02:00
# include "crypto/range_proofs.h"
2018-12-27 18:50:45 +03:00
# include "misc_language.h"
# include "block_flags.h"
# include "etc_custom_serialization.h"
namespace currency
{
const static crypto : : hash null_hash = AUTO_VAL_INIT ( null_hash ) ;
const static crypto : : public_key null_pkey = AUTO_VAL_INIT ( null_pkey ) ;
const static crypto : : key_image null_ki = AUTO_VAL_INIT ( null_ki ) ;
const static crypto : : secret_key null_skey = AUTO_VAL_INIT ( null_skey ) ;
const static crypto : : signature null_sig = AUTO_VAL_INIT ( null_sig ) ;
const static crypto : : key_derivation null_derivation = AUTO_VAL_INIT ( null_derivation ) ;
2020-04-30 22:29:08 +02:00
const static crypto : : hash gdefault_genesis = epee : : string_tools : : hex_to_pod < crypto : : hash > ( " CC608F59F8080E2FBFE3C8C80EB6E6A953D47CF2D6AEBD345BADA3A1CAB99852 " ) ;
2019-04-03 12:48:09 +03:00
typedef std : : string payment_id_t ;
2018-12-27 18:50:45 +03:00
/************************************************************************/
/* */
/************************************************************************/
2020-04-27 14:52:31 +03:00
//since structure used in blockchain as a key accessor, then be sure that there is no padding inside
# pragma pack(push, 1)
struct account_public_address_old
{
crypto : : public_key spend_public_key ;
crypto : : public_key view_public_key ;
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( spend_public_key )
FIELD ( view_public_key )
END_SERIALIZE ( )
BEGIN_KV_SERIALIZE_MAP ( )
2020-05-07 14:57:45 +03:00
KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N ( spend_public_key , " m_spend_public_key " )
KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N ( view_public_key , " m_view_public_key " )
2020-04-27 14:52:31 +03:00
END_KV_SERIALIZE_MAP ( )
} ;
# pragma pack(pop)
# define ACCOUNT_PUBLIC_ADDRESS_SERIZALIZATION_VER 1
# define ACCOUNT_PUBLIC_ADDRESS_FLAG_AUDITABLE 0x01 // auditable address
//since structure used in blockchain as a key accessor, then be sure that there is no padding inside
2018-12-27 18:50:45 +03:00
# pragma pack(push, 1)
struct account_public_address
{
2020-04-22 22:30:29 +03:00
crypto : : public_key spend_public_key ;
crypto : : public_key view_public_key ;
2020-04-30 18:50:22 +03:00
uint8_t flags ;
2018-12-27 18:50:45 +03:00
2020-04-27 14:52:31 +03:00
DEFINE_SERIALIZATION_VERSION ( ACCOUNT_PUBLIC_ADDRESS_SERIZALIZATION_VER )
2018-12-27 18:50:45 +03:00
BEGIN_SERIALIZE_OBJECT ( )
2020-04-22 22:30:29 +03:00
FIELD ( spend_public_key )
FIELD ( view_public_key )
2020-04-30 18:50:22 +03:00
FIELD ( flags )
2018-12-27 18:50:45 +03:00
END_SERIALIZE ( )
2020-04-27 14:52:31 +03:00
BEGIN_KV_SERIALIZE_MAP ( )
2020-05-18 17:19:21 +03:00
KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N ( spend_public_key , " m_spend_public_key " )
KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N ( view_public_key , " m_view_public_key " )
2020-04-30 18:50:22 +03:00
KV_SERIALIZE ( flags )
2020-04-27 14:52:31 +03:00
END_KV_SERIALIZE_MAP ( )
2020-05-07 15:02:35 +03:00
bool is_auditable ( ) const
{
return ( flags & ACCOUNT_PUBLIC_ADDRESS_FLAG_AUDITABLE ) ! = 0 ;
}
2020-04-27 14:52:31 +03:00
static account_public_address from_old ( const account_public_address_old & rhs )
{
account_public_address result = AUTO_VAL_INIT ( result ) ;
result . spend_public_key = rhs . spend_public_key ;
result . view_public_key = rhs . view_public_key ;
return result ;
}
account_public_address_old to_old ( ) const
{
account_public_address_old result = AUTO_VAL_INIT ( result ) ;
result . spend_public_key = spend_public_key ;
result . view_public_key = view_public_key ;
return result ;
}
2018-12-27 18:50:45 +03:00
} ;
# pragma pack(pop)
2020-04-27 14:52:31 +03:00
2018-12-27 18:50:45 +03:00
const static account_public_address null_pub_addr = AUTO_VAL_INIT ( null_pub_addr ) ;
typedef std : : vector < crypto : : signature > ring_signature ;
/************************************************************************/
/* extra structures */
/************************************************************************/
struct extra_attachment_info
{
uint64_t sz ;
crypto : : hash hsh ;
uint64_t cnt ;
BEGIN_SERIALIZE ( )
VARINT_FIELD ( sz )
FIELD ( hsh )
VARINT_FIELD ( cnt )
END_SERIALIZE ( )
} ;
/* outputs */
// 'mix_attr' possible values
# define CURRENCY_TO_KEY_OUT_RELAXED 0 // the output may be mixed with any fake outputs
# define CURRENCY_TO_KEY_OUT_FORCED_NO_MIX 1 // the output can't be mixed, only direct spend allowed
# define CURRENCY_TO_KEY_OUT_FORCED_MIX_LOWER_BOUND 2 // this and greather values means minimum number of total outputs (fakes + 1) must be mixed together for using that one
# pragma pack(push, 1)
struct txout_to_key
{
txout_to_key ( ) : key ( null_pkey ) , mix_attr ( 0 ) { }
txout_to_key ( const crypto : : public_key & _key ) : key ( _key ) , mix_attr ( 0 ) { }
crypto : : public_key key ;
uint8_t mix_attr ;
} ;
# pragma pack(pop)
/* inputs */
struct txin_gen
{
size_t height ;
BEGIN_SERIALIZE_OBJECT ( )
VARINT_FIELD ( height )
END_SERIALIZE ( )
} ;
// ref_by_id is used by txin_to_key to reference an output by source transaction hash and output's internal index,
// rather than amount and global output index (by default). Useful when output global index is unknown or may change.
struct ref_by_id
{
crypto : : hash tx_id ; // source transaction hash
uint32_t n ; // output index in source transaction
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( tx_id )
VARINT_FIELD ( n )
END_SERIALIZE ( )
} ;
2021-01-06 00:10:54 +01:00
typedef boost : : variant < uint64_t , ref_by_id > txout_ref_v ;
2018-12-27 18:50:45 +03:00
struct signed_parts
{
BEGIN_SERIALIZE_OBJECT ( )
VARINT_FIELD ( n_outs )
VARINT_FIELD ( n_extras )
END_SERIALIZE ( )
uint32_t n_outs ;
uint32_t n_extras ;
} ;
2022-09-21 22:35:24 +02:00
//!!!!this is temporary struct!!!
//needed only to hold asset_id of input/output while zarcanum extension being developed
struct open_asset_id
{
crypto : : hash asset_id ;
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( asset_id ) // referring_input
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( asset_id )
END_BOOST_SERIALIZATION ( )
} ;
2018-12-27 18:50:45 +03:00
2022-09-20 22:01:52 +02:00
typedef boost : : variant < signed_parts , extra_attachment_info , open_asset_id > txin_etc_details_v ;
2018-12-27 18:50:45 +03:00
2022-05-16 21:38:32 +02:00
struct referring_input
2018-12-27 18:50:45 +03:00
{
2021-01-06 00:10:54 +01:00
std : : vector < txout_ref_v > key_offsets ;
2022-05-16 21:38:32 +02:00
} ;
struct txin_to_key : public referring_input
{
uint64_t amount ;
2018-12-27 18:50:45 +03:00
crypto : : key_image k_image ; // double spending protection
2022-06-27 23:09:25 +02:00
std : : vector < txin_etc_details_v > etc_details ; // see also TX_FLAG_SIGNATURE_MODE_SEPARATE
2018-12-27 18:50:45 +03:00
BEGIN_SERIALIZE_OBJECT ( )
VARINT_FIELD ( amount )
2022-05-16 21:38:32 +02:00
FIELD ( key_offsets ) // from referring_input
2018-12-27 18:50:45 +03:00
FIELD ( k_image )
FIELD ( etc_details )
END_SERIALIZE ( )
} ;
2021-01-06 23:16:49 +01:00
struct txin_htlc : public txin_to_key
2020-12-28 23:45:16 +01:00
{
2020-12-30 23:58:03 +01:00
std : : string hltc_origin ;
2020-12-28 23:45:16 +01:00
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( hltc_origin )
2021-01-06 23:16:49 +01:00
FIELDS ( * static_cast < txin_to_key * > ( this ) )
END_SERIALIZE ( )
2020-12-28 23:45:16 +01:00
} ;
2018-12-27 18:50:45 +03:00
struct txin_multisig
{
uint64_t amount ;
crypto : : hash multisig_out_id ;
uint32_t sigs_count ; // actual number of signatures that are used to sign this input; needed to calculate tx blob size; must be equal to minimum_sigs of corresponding ms output
std : : vector < txin_etc_details_v > etc_details ;
BEGIN_SERIALIZE_OBJECT ( )
VARINT_FIELD ( amount )
FIELD ( multisig_out_id )
VARINT_FIELD ( sigs_count )
FIELD ( etc_details )
END_SERIALIZE ( )
} ;
2022-05-16 21:38:32 +02:00
2018-12-27 18:50:45 +03:00
struct txout_multisig
{
uint32_t minimum_sigs ;
std : : vector < crypto : : public_key > keys ;
BEGIN_SERIALIZE_OBJECT ( )
VARINT_FIELD ( minimum_sigs )
FIELD ( keys )
END_SERIALIZE ( )
} ;
2020-12-30 23:58:03 +01:00
# define CURRENCY_TXOUT_HTLC_FLAGS_HASH_TYPE_MASK 0x01 // 0 - SHA256, 1 - RIPEMD160
2020-12-28 23:45:16 +01:00
struct txout_htlc
{
crypto : : hash htlc_hash ;
uint8_t flags ; //select type of the hash, may be some extra info in future
uint64_t expiration ;
2021-01-24 21:00:43 +01:00
crypto : : public_key pkey_redeem ; //works before expiration
crypto : : public_key pkey_refund ; //works after expiration
2020-12-28 23:45:16 +01:00
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( htlc_hash )
FIELD ( flags )
VARINT_FIELD ( expiration )
2021-01-24 21:00:43 +01:00
FIELD ( pkey_redeem )
FIELD ( pkey_refund )
2020-12-28 23:45:16 +01:00
END_SERIALIZE ( )
} ;
2020-12-29 23:42:37 +01:00
typedef boost : : variant < txout_to_key , txout_multisig , txout_htlc > txout_target_v ;
2018-12-27 18:50:45 +03:00
//typedef std::pair<uint64_t, txout> out_t;
2022-05-17 17:32:53 +02:00
struct tx_out_bare
2018-12-27 18:50:45 +03:00
{
uint64_t amount ;
txout_target_v target ;
BEGIN_SERIALIZE_OBJECT ( )
VARINT_FIELD ( amount )
FIELD ( target )
END_SERIALIZE ( )
} ;
2022-06-27 23:09:25 +02:00
/////////////////////////////////////////////////////////////////////////////
// Zarcanum structures
//
//#pragma pack(push, 1)
2022-08-03 14:00:39 +02:00
/*
2022-06-27 23:09:25 +02:00
struct zarcanum_input : public referring_input
{
zarcanum_input ( ) { }
// Boost's Assignable concept
zarcanum_input ( const zarcanum_input & ) = default ;
zarcanum_input & operator = ( const zarcanum_input & ) = default ;
2022-06-28 22:27:36 +02:00
crypto : : key_image k_image ;
2022-06-27 23:09:25 +02:00
BEGIN_SERIALIZE_OBJECT ( )
2022-06-28 22:27:36 +02:00
FIELD ( k_image )
2022-06-27 23:09:25 +02:00
FIELD ( key_offsets ) // referring_input
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
2022-06-28 22:27:36 +02:00
BOOST_SERIALIZE ( k_image )
2022-06-27 23:09:25 +02:00
BOOST_SERIALIZE ( key_offsets ) // referring_input
END_BOOST_SERIALIZATION ( )
} ;
2022-07-22 05:39:54 +02:00
// txin_zarcanum_inputs contains several zarcanum_input instances and corresponds to one ZC_sig
2022-06-27 23:09:25 +02:00
struct txin_zarcanum_inputs
{
txin_zarcanum_inputs ( ) { }
// Boost's Assignable concept
txin_zarcanum_inputs ( const txin_zarcanum_inputs & ) = default ;
txin_zarcanum_inputs & operator = ( const txin_zarcanum_inputs & ) = default ;
std : : vector < zarcanum_input > elements ;
std : : vector < txin_etc_details_v > etc_details ;
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( elements )
FIELD ( etc_details )
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( elements )
BOOST_SERIALIZE ( etc_details )
END_BOOST_SERIALIZATION ( )
} ;
2022-08-03 14:00:39 +02:00
*/
struct txin_zc_input : public referring_input
{
txin_zc_input ( ) { }
// Boost's Assignable concept
txin_zc_input ( const txin_zc_input & ) = default ;
txin_zc_input & operator = ( const txin_zc_input & ) = default ;
crypto : : key_image k_image ;
std : : vector < txin_etc_details_v > etc_details ;
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( key_offsets ) // referring_input
FIELD ( k_image )
FIELD ( etc_details )
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( key_offsets ) // referring_input
BOOST_SERIALIZE ( k_image )
BOOST_SERIALIZE ( etc_details )
END_BOOST_SERIALIZATION ( )
} ;
2022-09-20 22:01:52 +02:00
typedef boost : : variant < open_asset_id > txout_etc_details_v ;
2022-06-27 23:09:25 +02:00
2022-05-09 17:29:25 +02:00
struct tx_out_zarcanum
{
tx_out_zarcanum ( ) { }
// Boost's Assignable concept
tx_out_zarcanum ( const tx_out_zarcanum & ) = default ;
tx_out_zarcanum & operator = ( const tx_out_zarcanum & ) = default ;
crypto : : public_key stealth_address ;
2022-07-26 06:44:19 +02:00
crypto : : public_key concealing_point ; // group element Q, see also Zarcanum paper, premultiplied by 1/8
crypto : : public_key amount_commitment ; // premultiplied by 1/8
2022-05-09 17:29:25 +02:00
uint64_t encrypted_amount ;
2022-06-30 18:42:13 +02:00
uint8_t mix_attr ;
2022-09-20 22:01:52 +02:00
std : : vector < txout_etc_details_v > etc_details ;
2022-06-27 23:09:25 +02:00
//crypto::public_key token_masked_generator;
2022-05-09 17:29:25 +02:00
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( stealth_address )
FIELD ( concealing_point )
2022-06-27 23:09:25 +02:00
FIELD ( amount_commitment )
2022-05-09 17:29:25 +02:00
FIELD ( encrypted_amount )
2022-06-30 18:42:13 +02:00
FIELD ( mix_attr )
2022-05-09 17:29:25 +02:00
END_SERIALIZE ( )
2022-05-16 21:38:32 +02:00
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( stealth_address )
BOOST_SERIALIZE ( concealing_point )
2022-06-27 23:09:25 +02:00
BOOST_SERIALIZE ( amount_commitment )
2022-05-16 21:38:32 +02:00
BOOST_SERIALIZE ( encrypted_amount )
2022-06-30 18:42:13 +02:00
BOOST_SERIALIZE ( mix_attr )
2022-05-16 21:38:32 +02:00
END_BOOST_SERIALIZATION ( )
2022-05-09 17:29:25 +02:00
} ;
2022-06-27 23:09:25 +02:00
struct zarcanum_tx_data_v1
{
uint64_t fee ;
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( fee )
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( fee )
END_BOOST_SERIALIZATION ( )
} ;
2022-07-06 03:01:53 +02:00
// non-consoditated txs must have one of this objects in the attachments (outputs_count == vout.size())
// consolidated -- one pre consolidated part (sum(outputs_count) == vout.size())
struct zarcanum_outs_range_proof
{
crypto : : bpp_signature_serialized bpp ;
uint8_t outputs_count ; // how many outputs are included in the proof
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( bpp )
FIELD ( outputs_count )
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( bpp )
BOOST_SERIALIZE ( outputs_count )
END_BOOST_SERIALIZATION ( )
} ;
2022-07-22 05:39:54 +02:00
// Zarcanum-aware CLSAG signature
struct ZC_sig
2022-06-27 23:09:25 +02:00
{
2022-08-25 04:28:34 +02:00
crypto : : public_key pseudo_out_amount_commitment ; // premultiplied by 1/8
2022-08-03 14:00:39 +02:00
crypto : : CLSAG_GG_signature_serialized clsags_gg ;
2022-06-27 23:09:25 +02:00
BEGIN_SERIALIZE_OBJECT ( )
2022-08-03 14:00:39 +02:00
FIELD ( pseudo_out_amount_commitment )
2022-07-13 04:37:37 +02:00
FIELD ( clsags_gg )
2022-06-27 23:09:25 +02:00
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
2022-08-03 14:00:39 +02:00
BOOST_SERIALIZE ( pseudo_out_amount_commitment )
2022-07-13 04:37:37 +02:00
BOOST_SERIALIZE ( clsags_gg )
2022-06-27 23:09:25 +02:00
END_BOOST_SERIALIZATION ( )
} ;
2022-08-25 04:28:34 +02:00
struct zc_balance_proof
{
crypto : : signature s ;
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( s )
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( s )
END_BOOST_SERIALIZATION ( )
} ;
2022-06-27 23:09:25 +02:00
//#pragma pack(pop)
2022-08-03 14:00:39 +02:00
typedef boost : : variant < txin_gen , txin_to_key , txin_multisig , txin_htlc , txin_zc_input > txin_v ;
2022-05-09 17:29:25 +02:00
2022-05-17 17:32:53 +02:00
typedef boost : : variant < tx_out_bare , tx_out_zarcanum > tx_out_v ;
2022-05-09 17:29:25 +02:00
2018-12-27 18:50:45 +03:00
struct tx_comment
{
std : : string comment ;
BEGIN_SERIALIZE ( )
FIELD ( comment )
END_SERIALIZE ( )
} ;
2020-04-27 14:52:31 +03:00
struct tx_payer_old
{
account_public_address_old acc_addr ;
BEGIN_SERIALIZE ( )
FIELD ( acc_addr )
END_SERIALIZE ( )
} ;
2018-12-27 18:50:45 +03:00
struct tx_payer
{
2020-04-27 14:52:31 +03:00
tx_payer ( ) = default ;
tx_payer ( const tx_payer_old & old ) : acc_addr ( account_public_address : : from_old ( old . acc_addr ) ) { }
account_public_address acc_addr { } ;
BEGIN_SERIALIZE ( )
FIELD ( acc_addr )
END_SERIALIZE ( )
} ;
struct tx_receiver_old
{
account_public_address_old acc_addr ;
2018-12-27 18:50:45 +03:00
BEGIN_SERIALIZE ( )
FIELD ( acc_addr )
END_SERIALIZE ( )
} ;
struct tx_receiver
{
2020-04-27 14:52:31 +03:00
tx_receiver ( ) = default ;
tx_receiver ( const tx_receiver_old & old ) : acc_addr ( account_public_address : : from_old ( old . acc_addr ) ) { }
account_public_address acc_addr { } ;
2018-12-27 18:50:45 +03:00
BEGIN_SERIALIZE ( )
FIELD ( acc_addr )
END_SERIALIZE ( )
} ;
struct tx_crypto_checksum
{
//we put tx encrypted key_derivation into tx attachment/extra, to let sender decrypt attachments that had been encrypted.
// key_derivation encrypted on sender private send address
crypto : : key_derivation encrypted_key_derivation ;
uint32_t derivation_hash ;
BEGIN_SERIALIZE ( )
FIELD ( encrypted_key_derivation )
FIELD ( derivation_hash )
END_SERIALIZE ( )
} ;
2019-09-27 17:16:18 +02:00
struct tx_derivation_hint
2018-12-27 18:50:45 +03:00
{
std : : string msg ;
BEGIN_SERIALIZE ( )
FIELD ( msg )
2019-09-27 17:16:18 +02:00
END_SERIALIZE ( )
2018-12-27 18:50:45 +03:00
} ;
struct tx_service_attachment
{
std : : string service_id ; //string identifying service which addressed this attachment
std : : string instruction ; //string identifying specific instructions for service/way to interpret data
std : : string body ; //any data identifying service, options etc
std : : vector < crypto : : public_key > security ; //some of commands need proof of owner
uint8_t flags ; //special flags (ex: TX_SERVICE_ATTACHMENT_ENCRYPT_BODY), see below
BEGIN_SERIALIZE ( )
FIELD ( service_id )
FIELD ( instruction )
FIELD ( body )
FIELD ( security )
FIELD ( flags )
END_SERIALIZE ( )
2021-06-26 02:40:41 +02:00
BEGIN_KV_SERIALIZE_MAP ( )
KV_SERIALIZE ( service_id )
KV_SERIALIZE ( instruction )
2021-07-17 00:05:41 +02:00
KV_SERIALIZE_BLOB_AS_HEX_STRING ( body )
2021-06-26 02:40:41 +02:00
KV_SERIALIZE_CONTAINER_POD_AS_BLOB ( security )
KV_SERIALIZE ( flags )
END_KV_SERIALIZE_MAP ( )
2018-12-27 18:50:45 +03:00
} ;
// applicable flags for tx_service_attachment::flags, can be combined using bitwise OR
2021-06-24 00:57:38 +02:00
# define TX_SERVICE_ATTACHMENT_ENCRYPT_BODY static_cast<uint8_t>(1 << 0)
# define TX_SERVICE_ATTACHMENT_DEFLATE_BODY static_cast<uint8_t>(1 << 1)
// with this flag enabled body encrypted/decrypted with the key created as a derivation from onetime key and "spend keys" of receiver
# define TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE static_cast<uint8_t>(1 << 2)
// add proof of content, without revealing secrete
# define TX_SERVICE_ATTACHMENT_ENCRYPT_ADD_PROOF static_cast<uint8_t>(1 << 3)
2018-12-27 18:50:45 +03:00
//,
struct extra_user_data
{
std : : string buff ;
BEGIN_SERIALIZE ( )
FIELD ( buff )
END_SERIALIZE ( )
} ;
2020-04-29 21:12:16 +03:00
struct extra_alias_entry_base_old
{
account_public_address_old m_address ;
std : : string m_text_comment ;
std : : vector < crypto : : secret_key > m_view_key ; // only one or zero elments expected (std::vector is using as memory efficient container for such a case)
std : : vector < crypto : : signature > m_sign ; // only one or zero elments expected (std::vector is using as memory efficient container for such a case)
BEGIN_SERIALIZE ( )
FIELD ( m_address )
FIELD ( m_text_comment )
FIELD ( m_view_key )
FIELD ( m_sign )
END_SERIALIZE ( )
} ;
struct extra_alias_entry_old : public extra_alias_entry_base_old
{
std : : string m_alias ;
BEGIN_SERIALIZE ( )
FIELD ( m_alias )
FIELDS ( * static_cast < extra_alias_entry_base_old * > ( this ) )
END_SERIALIZE ( )
} ;
2018-12-27 18:50:45 +03:00
struct extra_alias_entry_base
{
2020-05-01 12:56:09 +03:00
extra_alias_entry_base ( ) = default ;
extra_alias_entry_base ( const extra_alias_entry_base_old & old )
: m_address ( account_public_address : : from_old ( old . m_address ) )
, m_text_comment ( old . m_text_comment )
, m_view_key ( old . m_view_key )
, m_sign ( old . m_sign )
{
}
2018-12-27 18:50:45 +03:00
account_public_address m_address ;
std : : string m_text_comment ;
std : : vector < crypto : : secret_key > m_view_key ; // only one or zero elments expected (std::vector is using as memory efficient container for such a case)
std : : vector < crypto : : signature > m_sign ; // only one or zero elments expected (std::vector is using as memory efficient container for such a case)
BEGIN_SERIALIZE ( )
FIELD ( m_address )
FIELD ( m_text_comment )
FIELD ( m_view_key )
FIELD ( m_sign )
END_SERIALIZE ( )
} ;
2020-04-29 21:12:16 +03:00
struct extra_alias_entry : public extra_alias_entry_base
2018-12-27 18:50:45 +03:00
{
2020-05-01 12:56:09 +03:00
extra_alias_entry ( ) = default ;
extra_alias_entry ( const extra_alias_entry_old & old )
: extra_alias_entry_base ( old )
, m_alias ( old . m_alias )
2022-05-18 16:34:19 +02:00
{ }
2020-05-01 12:56:09 +03:00
2018-12-27 18:50:45 +03:00
std : : string m_alias ;
BEGIN_SERIALIZE ( )
FIELD ( m_alias )
2020-04-29 21:12:16 +03:00
FIELDS ( * static_cast < extra_alias_entry_base * > ( this ) )
2020-05-01 12:56:09 +03:00
END_SERIALIZE ( )
extra_alias_entry_old to_old ( ) const
{
extra_alias_entry_old result = AUTO_VAL_INIT ( result ) ;
result . m_address = m_address . to_old ( ) ;
result . m_text_comment = m_text_comment ;
result . m_view_key = m_view_key ;
result . m_sign = m_sign ;
result . m_alias = m_alias ;
return result ;
}
2018-12-27 18:50:45 +03:00
} ;
struct extra_padding
{
std : : vector < uint8_t > buff ; //stub
BEGIN_SERIALIZE ( )
FIELD ( buff )
END_SERIALIZE ( )
} ;
2019-07-22 13:04:01 +02:00
//number of block (or timestamp if v bigger then CURRENCY_MAX_BLOCK_NUMBER), used as a limitation: spend this tx not early then block/time
2018-12-27 18:50:45 +03:00
struct etc_tx_details_unlock_time
{
uint64_t v ;
BEGIN_SERIALIZE ( )
VARINT_FIELD ( v )
END_SERIALIZE ( )
} ;
2019-07-22 13:04:01 +02:00
//number of block (or timestamp if unlock_time_array[i] bigger then CURRENCY_MAX_BLOCK_NUMBER), used as a limitation: spend this tx not early then block/time
//unlock_time_array[i], i - index of output, unlock_time_array.size() == vout.size()
struct etc_tx_details_unlock_time2
{
std : : vector < uint64_t > unlock_time_array ;
BEGIN_SERIALIZE ( )
2019-07-24 00:37:24 +02:00
FIELD ( unlock_time_array )
2019-07-22 13:04:01 +02:00
END_SERIALIZE ( )
} ;
2018-12-27 18:50:45 +03:00
struct etc_tx_details_expiration_time
{
uint64_t v ;
BEGIN_SERIALIZE ( )
VARINT_FIELD ( v )
END_SERIALIZE ( )
} ;
/*
this structure used to put real time into PoS block ( or could be other meaning ) , to have more suitable dates in transactions
*/
struct etc_tx_time
{
uint64_t v ;
BEGIN_SERIALIZE ( )
VARINT_FIELD ( v )
2019-07-24 00:37:24 +02:00
END_SERIALIZE ( )
2018-12-27 18:50:45 +03:00
} ;
struct etc_tx_details_flags
{
uint64_t v ;
BEGIN_SERIALIZE ( )
VARINT_FIELD ( v )
END_SERIALIZE ( )
} ;
2020-08-29 01:14:26 +02:00
struct etc_tx_flags16_t
2018-12-27 18:50:45 +03:00
{
uint16_t v ;
BEGIN_SERIALIZE ( )
FIELD ( v )
END_SERIALIZE ( )
} ;
2022-08-25 04:28:34 +02:00
typedef boost : : mpl : : vector24 <
2020-04-27 14:52:31 +03:00
tx_service_attachment , tx_comment , tx_payer_old , tx_receiver_old , tx_derivation_hint , std : : string , tx_crypto_checksum , etc_tx_time , etc_tx_details_unlock_time , etc_tx_details_expiration_time ,
2020-08-29 01:14:26 +02:00
etc_tx_details_flags , crypto : : public_key , extra_attachment_info , extra_alias_entry_old , extra_user_data , extra_padding , etc_tx_flags16_t , etc_tx_details_unlock_time2 ,
2022-08-25 04:28:34 +02:00
tx_payer , tx_receiver , extra_alias_entry , zarcanum_tx_data_v1 , zarcanum_outs_range_proof , zc_balance_proof
2020-04-22 22:02:37 +03:00
> all_payload_types ;
2018-12-27 18:50:45 +03:00
typedef boost : : make_variant_over < all_payload_types > : : type payload_items_v ;
2020-04-22 22:02:37 +03:00
typedef payload_items_v extra_v ;
typedef payload_items_v attachment_v ;
2018-12-27 18:50:45 +03:00
2022-05-16 21:38:32 +02:00
2022-05-18 16:34:19 +02:00
//classic CryptoNote signature by Nicolas Van Saberhagen
struct NLSAG_sig
{
2022-06-19 19:47:43 +02:00
std : : vector < crypto : : signature > s ;
2022-05-24 00:46:44 +02:00
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( s )
END_SERIALIZE ( )
2022-05-25 22:31:23 +02:00
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( s )
END_BOOST_SERIALIZATION ( )
2022-05-18 16:34:19 +02:00
} ;
2022-06-19 19:47:43 +02:00
//TODO: @val, should we call it something like schnorr_sig ?
struct simple_sig
{
crypto : : signature s ;
BEGIN_SERIALIZE_OBJECT ( )
FIELD ( s )
END_SERIALIZE ( )
BEGIN_BOOST_SERIALIZATION ( )
BOOST_SERIALIZE ( s )
END_BOOST_SERIALIZATION ( )
} ;
2022-05-18 16:34:19 +02:00
struct void_sig
{
//TODO:
2022-05-24 00:46:44 +02:00
BEGIN_SERIALIZE_OBJECT ( )
END_SERIALIZE ( )
2022-05-25 22:31:23 +02:00
BEGIN_BOOST_SERIALIZATION ( )
END_BOOST_SERIALIZATION ( )
2022-05-18 16:34:19 +02:00
} ;
2022-06-19 19:47:43 +02:00
2022-07-22 05:39:54 +02:00
typedef boost : : variant < NLSAG_sig , void_sig , ZC_sig > signature_v ;
2022-05-18 16:34:19 +02:00
2022-05-17 16:19:55 +02:00
2022-05-16 23:32:28 +02:00
//include backward compatibility defintions
# include "currency_basic_backward_comp.inl"
2018-12-27 18:50:45 +03:00
class transaction_prefix
{
public :
// tx version information
2021-01-08 01:25:15 +01:00
uint64_t version { } ;
2018-12-27 18:50:45 +03:00
//extra
2022-05-16 23:32:28 +02:00
std : : vector < extra_v > extra ;
2018-12-27 18:50:45 +03:00
std : : vector < txin_v > vin ;
2022-05-18 16:34:19 +02:00
std : : vector < tx_out_v > vout ;
2018-12-27 18:50:45 +03:00
BEGIN_SERIALIZE ( )
VARINT_FIELD ( version )
2022-05-16 23:32:28 +02:00
CHAIN_TRANSITION_VER ( TRANSACTION_VERSION_INITAL , transaction_prefix_v1 )
CHAIN_TRANSITION_VER ( TRANSACTION_VERSION_PRE_HF4 , transaction_prefix_v1 )
2018-12-27 18:50:45 +03:00
if ( CURRENT_TRANSACTION_VERSION < version ) return false ;
FIELD ( vin )
FIELD ( vout )
FIELD ( extra )
END_SERIALIZE ( )
protected :
transaction_prefix ( ) { }
} ;
/*
TX_FLAG_SIGNATURE_MODE_SEPARATE - flag that set different signature validation mode .
With this mode each signature sign prefix with it ' s own txin entry only , that allow
construct transaction partially , supposed to be in use to construct multisig - based escrow transaction .
*/
# define TX_FLAG_SIGNATURE_MODE_SEPARATE 0x01
class transaction : public transaction_prefix
{
public :
2022-06-19 19:47:43 +02:00
std : : vector < signature_v > signatures ;
2018-12-27 18:50:45 +03:00
std : : vector < attachment_v > attachment ;
transaction ( ) ;
BEGIN_SERIALIZE_OBJECT ( )
FIELDS ( * static_cast < transaction_prefix * > ( this ) )
2022-05-18 16:34:19 +02:00
CHAIN_TRANSITION_VER ( TRANSACTION_VERSION_INITAL , transaction_v1 )
CHAIN_TRANSITION_VER ( TRANSACTION_VERSION_PRE_HF4 , transaction_v1 )
2022-06-23 16:22:55 +02:00
FIELD ( signatures )
2018-12-27 18:50:45 +03:00
FIELD ( attachment )
END_SERIALIZE ( )
} ;
inline
transaction : : transaction ( )
{
version = 0 ;
vin . clear ( ) ;
vout . clear ( ) ;
extra . clear ( ) ;
2022-06-23 16:22:55 +02:00
signatures . clear ( ) ;
2018-12-27 18:50:45 +03:00
attachment . clear ( ) ;
}
/*
inline
transaction : : ~ transaction ( )
{
//set_null();
}
inline
void transaction : : set_null ( )
{
version = 0 ;
unlock_time = 0 ;
vin . clear ( ) ;
vout . clear ( ) ;
extra . clear ( ) ;
signatures . clear ( ) ;
}
*/
/************************************************************************/
/* */
/************************************************************************/
struct block_header
{
uint8_t major_version ;
uint8_t minor_version ;
uint64_t timestamp ;
crypto : : hash prev_id ;
uint64_t nonce ;
uint8_t flags ;
BEGIN_SERIALIZE ( )
FIELD ( major_version )
2019-08-15 07:15:08 +03:00
if ( major_version > CURRENT_BLOCK_MAJOR_VERSION ) return false ;
2018-12-27 18:50:45 +03:00
FIELD ( nonce )
FIELD ( prev_id )
VARINT_FIELD ( minor_version )
VARINT_FIELD ( timestamp )
FIELD ( flags )
END_SERIALIZE ( )
} ;
struct block : public block_header
{
transaction miner_tx ;
std : : vector < crypto : : hash > tx_hashes ;
BEGIN_SERIALIZE_OBJECT ( )
FIELDS ( * static_cast < block_header * > ( this ) )
FIELD ( miner_tx )
FIELD ( tx_hashes )
END_SERIALIZE ( )
} ;
struct keypair
{
crypto : : public_key pub ;
crypto : : secret_key sec ;
static inline keypair generate ( )
{
keypair k ;
generate_keys ( k . pub , k . sec ) ;
return k ;
}
} ;
2021-06-24 20:34:13 +02:00
const static keypair null_keypair = AUTO_VAL_INIT ( null_keypair ) ;
2018-12-27 18:50:45 +03:00
//---------------------------------------------------------------
//PoS
//based from ppcoin/novacoin approach
/*
POS PROTOCOL , stake modifier
*/
//-------------------------------------------------------------------------------------------------------------------
# pragma pack(push, 1)
struct stake_modifier_type
{
crypto : : hash last_pow_id ;
crypto : : hash last_pos_kernel_id ;
} ;
struct stake_kernel
{
stake_modifier_type stake_modifier ;
uint64_t block_timestamp ; //this block timestamp
crypto : : key_image kimage ;
} ;
# pragma pack(pop)
struct pos_entry
{
uint64_t amount ;
2022-09-05 20:18:27 +02:00
uint64_t g_index ; // global output index. (could be WALLET_GLOBAL_OUTPUT_INDEX_UNDEFINED)
2018-12-27 18:50:45 +03:00
crypto : : key_image keyimage ;
uint64_t block_timestamp ;
2019-07-24 19:14:35 +02:00
uint64_t stake_unlock_time ;
2022-09-05 12:30:08 +02:00
crypto : : hash tx_id ; // stake output source tx id
uint64_t tx_out_index ; // stake output local index in its tx
2018-12-27 18:50:45 +03:00
//not for serialization
uint64_t wallet_index ;
BEGIN_KV_SERIALIZE_MAP ( )
KV_SERIALIZE ( amount )
2022-09-05 20:18:27 +02:00
KV_SERIALIZE ( g_index )
2019-07-24 19:14:35 +02:00
KV_SERIALIZE ( stake_unlock_time )
2018-12-27 18:50:45 +03:00
KV_SERIALIZE ( block_timestamp )
KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE ( keyimage )
2022-09-05 12:30:08 +02:00
KV_SERIALIZE ( tx_id )
KV_SERIALIZE ( tx_out_index )
2018-12-27 18:50:45 +03:00
END_KV_SERIALIZE_MAP ( )
} ;
2019-04-03 12:48:09 +03:00
} // namespace currency
2018-12-27 18:50:45 +03:00
POD_MAKE_HASHABLE ( currency , account_public_address ) ;
2020-07-13 14:54:32 +03:00
POD_MAKE_HASHABLE ( currency , account_public_address_old ) ;
2018-12-27 18:50:45 +03:00
BLOB_SERIALIZER ( currency : : txout_to_key ) ;
# define SET_VARIANT_TAGS(type_name, id, json_tag) \
VARIANT_TAG ( binary_archive , type_name , id ) ; \
VARIANT_TAG ( json_archive , type_name , json_tag )
// txin_v variant currency
SET_VARIANT_TAGS ( currency : : txin_gen , 0 , " gen " ) ;
SET_VARIANT_TAGS ( currency : : txin_to_key , 1 , " key " ) ;
SET_VARIANT_TAGS ( currency : : txin_multisig , 2 , " multisig " ) ;
// txout_target_v variant definitions
SET_VARIANT_TAGS ( currency : : txout_to_key , 3 , " key " ) ;
SET_VARIANT_TAGS ( currency : : txout_multisig , 4 , " multisig " ) ;
SET_VARIANT_TAGS ( currency : : transaction , 5 , " tx " ) ;
SET_VARIANT_TAGS ( currency : : block , 6 , " block " ) ;
//attachment_v definitions
SET_VARIANT_TAGS ( currency : : tx_comment , 7 , " comment " ) ;
2020-04-27 14:52:31 +03:00
SET_VARIANT_TAGS ( currency : : tx_payer_old , 8 , " payer " ) ;
2018-12-27 18:50:45 +03:00
SET_VARIANT_TAGS ( std : : string , 9 , " string " ) ;
SET_VARIANT_TAGS ( currency : : tx_crypto_checksum , 10 , " checksum " ) ;
2019-09-27 17:16:18 +02:00
SET_VARIANT_TAGS ( currency : : tx_derivation_hint , 11 , " derivation_hint " ) ;
2018-12-27 18:50:45 +03:00
SET_VARIANT_TAGS ( currency : : tx_service_attachment , 12 , " attachment " ) ;
//SET_VARIANT_TAGS(currency::tx_onetime_secret_key, 13, "sec_key");
SET_VARIANT_TAGS ( currency : : etc_tx_details_unlock_time , 14 , " unlock_time " ) ;
SET_VARIANT_TAGS ( currency : : etc_tx_details_expiration_time , 15 , " expiration_time " ) ;
SET_VARIANT_TAGS ( currency : : etc_tx_details_flags , 16 , " flags " ) ;
//txin_etc_details_v definitions
SET_VARIANT_TAGS ( currency : : signed_parts , 17 , " signed_outs " ) ;
//extra_v definitions
SET_VARIANT_TAGS ( currency : : extra_attachment_info , 18 , " extra_attach_info " ) ;
SET_VARIANT_TAGS ( currency : : extra_user_data , 19 , " user_data " ) ;
2020-04-29 21:12:16 +03:00
SET_VARIANT_TAGS ( currency : : extra_alias_entry_old , 20 , " alias_entry " ) ;
2018-12-27 18:50:45 +03:00
SET_VARIANT_TAGS ( currency : : extra_padding , 21 , " extra_padding " ) ;
SET_VARIANT_TAGS ( crypto : : public_key , 22 , " pub_key " ) ;
2020-08-29 01:14:26 +02:00
SET_VARIANT_TAGS ( currency : : etc_tx_flags16_t , 23 , " etc_tx_flags16 " ) ;
2018-12-27 18:50:45 +03:00
SET_VARIANT_TAGS ( uint16_t , 24 , " derive_xor " ) ;
//txout_v
SET_VARIANT_TAGS ( currency : : ref_by_id , 25 , " ref_by_id " ) ;
SET_VARIANT_TAGS ( uint64_t , 26 , " uint64_t " ) ;
//etc
SET_VARIANT_TAGS ( currency : : etc_tx_time , 27 , " etc_tx_time " ) ;
SET_VARIANT_TAGS ( uint32_t , 28 , " uint32_t " ) ;
2020-04-29 21:12:16 +03:00
SET_VARIANT_TAGS ( currency : : tx_receiver_old , 29 , " payer " ) ; // -- original
//SET_VARIANT_TAGS(currency::tx_receiver_old, 29, "receiver");
2019-07-22 13:04:01 +02:00
SET_VARIANT_TAGS ( currency : : etc_tx_details_unlock_time2 , 30 , " unlock_time2 " ) ;
2018-12-27 18:50:45 +03:00
2020-04-29 21:12:16 +03:00
SET_VARIANT_TAGS ( currency : : tx_payer , 31 , " payer2 " ) ;
SET_VARIANT_TAGS ( currency : : tx_receiver , 32 , " receiver2 " ) ;
// @#@ TODO @#@
SET_VARIANT_TAGS ( currency : : extra_alias_entry , 33 , " alias_entry2 " ) ;
2020-12-29 23:42:37 +01:00
//htlc
2021-01-06 05:15:01 +01:00
SET_VARIANT_TAGS ( currency : : txin_htlc , 34 , " txin_htlc " ) ;
2020-12-29 23:42:37 +01:00
SET_VARIANT_TAGS ( currency : : txout_htlc , 35 , " txout_htlc " ) ;
2022-05-17 17:32:53 +02:00
SET_VARIANT_TAGS ( currency : : tx_out_bare , 36 , " tx_out_bare " ) ;
2022-05-09 17:29:25 +02:00
// Zarcanum
2022-08-03 14:00:39 +02:00
SET_VARIANT_TAGS ( currency : : txin_zc_input , 37 , " txin_zc_input " ) ;
2022-05-17 17:32:53 +02:00
SET_VARIANT_TAGS ( currency : : tx_out_zarcanum , 38 , " tx_out_zarcanum " ) ;
SET_VARIANT_TAGS ( currency : : zarcanum_tx_data_v1 , 39 , " zarcanum_tx_data_v1 " ) ;
SET_VARIANT_TAGS ( crypto : : bpp_signature_serialized , 40 , " bpp_signature_serialized " ) ;
SET_VARIANT_TAGS ( crypto : : bppe_signature_serialized , 41 , " bppe_signature_serialized " ) ;
2022-05-18 16:34:19 +02:00
SET_VARIANT_TAGS ( currency : : NLSAG_sig , 42 , " NLSAG_sig " ) ;
2022-07-22 05:39:54 +02:00
SET_VARIANT_TAGS ( currency : : ZC_sig , 43 , " ZC_sig " ) ;
2022-05-26 19:55:41 +02:00
SET_VARIANT_TAGS ( currency : : void_sig , 44 , " void_sig " ) ;
2022-07-06 15:14:25 +02:00
SET_VARIANT_TAGS ( currency : : zarcanum_outs_range_proof , 45 , " zarcanum_outs_range_proof " ) ;
2022-08-25 04:28:34 +02:00
SET_VARIANT_TAGS ( currency : : zc_balance_proof , 46 , " zc_balance_proof " ) ;
2022-05-17 17:32:53 +02:00
2022-09-21 22:35:24 +02:00
SET_VARIANT_TAGS ( currency : : open_asset_id , 47 , " asset_id " ) ;
2022-05-17 17:32:53 +02:00
2020-04-29 21:12:16 +03:00
2018-12-27 18:50:45 +03:00
# undef SET_VARIANT_TAGS