veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
consts.hpp
Go to the documentation of this file.
1// Copyright (c) 2019-2022 Xenios SEZC
2// https://www.veriblock.org
3// Distributed under the MIT software license, see the accompanying
4// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef ALT_INTEGRATION_VERIBLOCK_CONSTS_HPP
7#define ALT_INTEGRATION_VERIBLOCK_CONSTS_HPP
8
9#include <cstdint>
10#include <vector>
11
18namespace altintegration {
19
20// If you will change some values, do not forget update the same values in the
21// bindigs implementation
22
26enum class TxType {
28 VBK_TX = 0x01,
30 VBK_POP_TX = 0x02,
31};
32
36constexpr const auto ADDRESS_POP_DATA_SIZE_PROGPOW = 15;
37
39constexpr const auto SHA256_HASH_SIZE = 32;
40
42constexpr const auto BTC_TX_MAX_RAW_SIZE = 4 * 1000 * 1000;
43
45constexpr const uint32_t BTC_HEADER_SIZE = 80;
47constexpr const auto HISTORY_FOR_TIMESTAMP_AVERAGE = 20;
49constexpr const auto VBK_MINIMUM_TIMESTAMP_ONSET_BLOCK_HEIGHT = 110000;
51constexpr const auto MAX_BTC_BLOCKS_IN_VBKPOPTX = 65535;
53constexpr const auto BTC_BLOCK_HASH_SIZE = 32;
55constexpr const auto VBK_BLOCK_HASH_SIZE = 24;
57constexpr const auto VBK_MERKLE_ROOT_HASH_SIZE = 16;
59constexpr const auto VBK_PREVIOUS_BLOCK_HASH_SIZE = 12;
61constexpr const auto VBK_PREVIOUS_KEYSTONE_HASH_SIZE = 9;
62
65constexpr const auto MAX_PAYOUT_INFO_SIZE = 10000;
67constexpr const auto MAX_HEADER_SIZE_PUBLICATION_DATA = 1024;
69constexpr const auto MAX_CONTEXT_SIZE_PUBLICATION_DATA = 10000;
71constexpr const auto MAX_PUBLICATIONDATA_SIZE =
72 1 + sizeof(int64_t) + 1 + MAX_HEADER_SIZE_PUBLICATION_DATA + 1 +
76constexpr const auto MAX_POPDATA_SIZE = 5500000;
78constexpr const auto MAX_POPDATA_VBK = 50000;
80constexpr const auto MAX_POPDATA_VTB = 50000;
82constexpr const auto MAX_POPDATA_ATV = 50000;
84constexpr const auto MAX_PAYOUT = 50000;
86constexpr const auto MIN_ALT_HASH_SIZE = 0;
88constexpr const auto MAX_ALT_HASH_SIZE = 1024;
90constexpr const auto MAX_BTCADDON_REFS = 65536;
92constexpr const auto MAX_VBKPOPTX_PER_VBK_BLOCK = 1024;
94constexpr const auto VTB_ID_SIZE = 32;
96constexpr const auto ATV_ID_SIZE = 32;
98constexpr const auto VBK_ID_SIZE = 12;
100constexpr const auto VBK_PUBLICATIONDATA_SIZE = 80;
102constexpr const uint32_t VBK_HEADER_SIZE_VBLAKE = 64;
104constexpr const uint32_t VBK_HEADER_SIZE_PROGPOW = 65;
106constexpr const auto MAX_LAYER_COUNT_MERKLE = 40;
108constexpr const auto MAX_OUTPUTS_COUNT = 255;
110constexpr const auto MAX_SIGNATURE_SIZE = 72;
112constexpr const auto MAX_PUBLIC_KEY_SIZE = 88;
114constexpr const auto VBK_ADDRESS_SIZE = 30;
115
117constexpr const auto VBK_MAX_CALCULATED_EPOCHS_SIZE = 4096U;
119constexpr const auto VBK_ETHASH_EPOCH_LENGTH = 8000U;
121constexpr const auto VBK_ETHASH_EPOCH_OFFSET = 323U;
122
124constexpr const auto VBK_MAXIMUM_DIFFICULTY =
125 "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";
126
128const static int32_t ALT_MAX_REORG_BLOCKS_MIN_VALUE = 10000;
130const static int32_t VBK_MAX_REORG_BLOCKS_MIN_VALUE = 20000;
132const static int32_t BTC_MAX_REORG_BLOCKS_MIN_VALUE = 10000;
133
134} // namespace altintegration
135
136#endif // ALT_INTEGRATION_INCLUDE_VERIBLOCK_CONSTS_HPP_
Defines logging helpers.
Definition: block.hpp:14
constexpr const auto MAX_BTCADDON_REFS
absolute maximum of 'refs' for BTC addon
Definition: consts.hpp:90
constexpr const auto MAX_POPDATA_ATV
absolute maximum number of ATV blocks per ALT block
Definition: consts.hpp:82
constexpr const auto MAX_LAYER_COUNT_MERKLE
max total layers in merkle paths
Definition: consts.hpp:106
constexpr const auto MAX_OUTPUTS_COUNT
NodeCore is using byte value when serializing outputs so we limit to 255.
Definition: consts.hpp:108
constexpr const auto ATV_ID_SIZE
size of ATV id
Definition: consts.hpp:96
static const int32_t ALT_MAX_REORG_BLOCKS_MIN_VALUE
minimum number of blocks in ALT tree
Definition: consts.hpp:128
static const int32_t BTC_MAX_REORG_BLOCKS_MIN_VALUE
minimum number of blocks in BTC tree
Definition: consts.hpp:132
constexpr const auto VBK_PREVIOUS_KEYSTONE_HASH_SIZE
size of VBK previous keystone hash size
Definition: consts.hpp:61
constexpr const auto VBK_PREVIOUS_BLOCK_HASH_SIZE
size of VBK previous block hash size
Definition: consts.hpp:59
constexpr const auto VBK_PUBLICATIONDATA_SIZE
65 VBK header + 15 POP bytes of Address
Definition: consts.hpp:100
constexpr const auto SHA256_HASH_SIZE
sha256 hash size
Definition: consts.hpp:39
constexpr const auto MAX_POPDATA_VBK
absolute maximum number of VBK blocks per ALT block
Definition: consts.hpp:78
constexpr const auto VBK_ETHASH_EPOCH_LENGTH
size of 1 ethash epoch in progpow
Definition: consts.hpp:119
constexpr const auto MAX_CONTEXT_SIZE_PUBLICATION_DATA
maximum context size in PublicationData
Definition: consts.hpp:69
constexpr const uint32_t BTC_HEADER_SIZE
Bitcoin header size.
Definition: consts.hpp:45
constexpr const auto ADDRESS_POP_DATA_SIZE_PROGPOW
VTB contains BtcTx, which contains POP-miner's address and endorsed VBK header.
Definition: consts.hpp:36
constexpr const auto MAX_PUBLICATIONDATA_SIZE
absolute maximum size for PublicationData
Definition: consts.hpp:71
constexpr const auto VBK_MAX_CALCULATED_EPOCHS_SIZE
maximum number of Ethash cache sizes stored in this library.
Definition: consts.hpp:117
TxType
Veriblock transaction type.
Definition: consts.hpp:26
@ VBK_POP_TX
pop transaction
@ VBK_TX
regular transaction
constexpr const uint32_t VBK_HEADER_SIZE_VBLAKE
pre-progpow VBK header size
Definition: consts.hpp:102
constexpr const auto BTC_BLOCK_HASH_SIZE
size of BTC block hash
Definition: consts.hpp:53
constexpr const auto MAX_HEADER_SIZE_PUBLICATION_DATA
maximum header size in PublicationData
Definition: consts.hpp:67
constexpr const auto MAX_SIGNATURE_SIZE
ASN.1/DER ECDSA encoding max value.
Definition: consts.hpp:110
constexpr const auto MAX_ALT_HASH_SIZE
absolute maximum allowed size for altchain hash
Definition: consts.hpp:88
constexpr const auto MAX_VBKPOPTX_PER_VBK_BLOCK
absolute maximum number of PopTxes (VTBs) per VBK block
Definition: consts.hpp:92
constexpr const auto MAX_PAYOUT_INFO_SIZE
max payout info size.
Definition: consts.hpp:65
constexpr const auto VBK_ID_SIZE
size of VbkBlock id
Definition: consts.hpp:98
constexpr const auto VTB_ID_SIZE
size of VTB id
Definition: consts.hpp:94
constexpr const auto MAX_PUBLIC_KEY_SIZE
X509 encoding. Max value is based on experimental data.
Definition: consts.hpp:112
constexpr const auto MAX_PAYOUT
absolute maximum number of pauouts per ALT block
Definition: consts.hpp:84
constexpr const uint32_t VBK_HEADER_SIZE_PROGPOW
post-progpow VBK header size
Definition: consts.hpp:104
constexpr const auto VBK_ADDRESS_SIZE
VBK address size in bytes.
Definition: consts.hpp:114
constexpr const auto MAX_BTC_BLOCKS_IN_VBKPOPTX
maximum total BTC blocks in VTB blockOfProofContext
Definition: consts.hpp:51
constexpr const auto BTC_TX_MAX_RAW_SIZE
maximum possible BTC TX serialized size.
Definition: consts.hpp:42
constexpr const auto MIN_ALT_HASH_SIZE
minimum allowed size of altchain hash
Definition: consts.hpp:86
constexpr const auto MAX_POPDATA_SIZE
maximum size of single PopData in a single ALT block, in bytes.
Definition: consts.hpp:76
constexpr const auto MAX_POPDATA_VTB
absolute maximum number of VTB blocks per ALT block
Definition: consts.hpp:80
constexpr const auto VBK_MERKLE_ROOT_HASH_SIZE
size of VBK merkle root
Definition: consts.hpp:57
static const int32_t VBK_MAX_REORG_BLOCKS_MIN_VALUE
minimum number of blocks in VBK tree
Definition: consts.hpp:130
constexpr const auto VBK_ETHASH_EPOCH_OFFSET
we start at this epoch
Definition: consts.hpp:121
constexpr const auto VBK_BLOCK_HASH_SIZE
size of VBK block hash
Definition: consts.hpp:55