Dpowcore - Dualpowcoin
What is this ? Another Altcoin ? Maybe but read next.
Updated to v31.x ( v31.2 )
Old info
This is experemtal coin with dual pow , dual Pro of Work - not multi Prof of Work!
For each block, 2 proofs of work were used - first we verify the block with the first POW - Yespower, then we verify the same block in 2 rounds of SHA512 as salt and 2 rounds of Argond2id, and the block is valid if it passes both proofs of work
static bool CheckBlockHeader(const CBlockHeader& block, BlockValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true)
{
// Check proof of work's matches claimed amount (dual pow logic)
bool powResult1 = fCheckPOW ? CheckProofOfWork(block.GetYespowerPoWHash(), block.nBits, consensusParams) : true;
bool powResult2 = fCheckPOW ? CheckProofOfWork(block.GetArgon2idPoWHash(), block.nBits, consensusParams) : true;
// Checking if both POW's are valid
if (!powResult1 || !powResult2) {
return state.Invalid(BlockValidationResult::BLOCK_INVALID_HEADER, "high-hash", "proof of work's failed");
}
return true;
}
Get PoW Logic/* Yespower */
uint256 CBlockHeader::GetYespowerPoWHash() const
{
static const yespower_params_t yespower_1_0_dpowcoin = {
.version = YESPOWER_1_0,
.N = 2048,
.r = 8,
.pers = (const uint8_t *)"One POW? Why not two? 17/04/2024",
.perslen = 32
};
uint256 hash;
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss << *this;
if (yespower_tls((const uint8_t *)&ss[0], ss.size(), &yespower_1_0_dpowcoin, (yespower_binary_t *)&hash)) {
tfm::format(std::cerr, "Error: CBlockHeader::GetYespowerPoWHash(): failed to compute PoW hash (out of memory?)\n");
exit(1);
}
return hash;
}
// CBlockHeader::GetArgon2idPoWHash() instance
// -> Serialize Block Header using CDataStream
// -> Compute SHA-512 hash of serialized data (Two Rounds)
// -> Use the computed hash as the salt for argon2id_hash_raw function for the first round
// -> Call argon2id_hash_raw function for the first round using the serialized data as password and SHA-512 hash as salt
// -> Use the hash obtained from the first round as the salt for the second round
// -> Call argon2id_hash_raw function for the second round using the serialized data as password and the hash from the first round as salt
// -> Return the hash computed in the second round (hash2)
uint256 CBlockHeader::GetArgon2idPoWHash() const
{
uint256 hash;
uint256 hash2;
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss << *this;
// Hashing the data using SHA-512 (two rounds)
std::vector<unsigned char> salt_sha512(CSHA512::OUTPUT_SIZE);
CSHA512 sha512;
sha512.Write((unsigned char*)&ss[0], ss.size()).Finalize(salt_sha512.data());
sha512.Reset().Write(salt_sha512.data(), salt_sha512.size()).Finalize(salt_sha512.data());
// Preparing data for hashing
const void* pwd = &ss[0];
size_t pwdlen = ss.size();
const void* salt = salt_sha512.data();
size_t saltlen = salt_sha512.size();
// Calling the argon2id_hash_raw function for the first round
int rc = argon2id_hash_raw(2, 4096, 2, pwd, pwdlen, salt, saltlen, &hash, 32);
if (rc != ARGON2_OK) {
printf("Error: Failed to compute Argon2id hash for the first round\n");
exit(1);
}
// Using the hash from the first round as the salt for the second round
salt = &hash;
saltlen = 32;
// Calling the argon2id_hash_raw function for the second round
rc = argon2id_hash_raw(2, 32768, 2, pwd, pwdlen, salt, saltlen, &hash2, 32);
if (rc != ARGON2_OK) {
printf("Error: Failed to compute Argon2id hash for the second round\n");
exit(1);
}
// Return the result of the second round of Argon2id
return hash2;
}
As example for Light SPV wallets can be used only one of that POWS for verify ( sha512+argon2id best in that cases as libs available almost at all plaforms)
[/hide]
Actual Info
Yespower was droped due causing sync and speed problems.
/* Dpowcoin Params */
/*
* Compute the two-round Argon2id proof-of-work hash of this block header.
*
* Salt derivation
* ---------------
* The 64-byte salt fed into round 1 is obtained by applying SHA-512 twice
* to the serialized header:
* salt = SHA-512( SHA-512( header ) )
*
* Round 1 (consensus-critical parameters, must not be changed)
* -------
* password = serialized 80-byte block header
* salt = SHA-512 x2 (header) [64 bytes]
* t_cost = 2
* m_cost = 4096 KiB
* lanes = 2
* output = 32 bytes > used as salt for round 2
*
* Round 2 (consensus-critical parameters, must not be changed)
* -------
* password = serialized 80-byte block header (same as round 1)
* salt = output of round 1 [32 bytes]
* t_cost = 2
* m_cost = 32768 KiB
* lanes = 2
* output = 32 bytes > final PoW hash
*/
uint256 CBlockHeader::GetArgon2idPoWHash() const
{
uint256 hash;
uint256 hash2;
DataStream ss{};
ss << *this;
assert(ss.size() == 80);
// Hashing the data using SHA-512 (two rounds)
std::vector<unsigned char> salt_sha512(CSHA512::OUTPUT_SIZE);
CSHA512 sha512;
sha512.Write((unsigned char*)ss.data(), ss.size()).Finalize(salt_sha512.data());
sha512.Reset().Write(salt_sha512.data(), salt_sha512.size()).Finalize(salt_sha512.data());
// Preparing data for hashing
uint8_t* const pwd = const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(ss.data()));
const uint32_t pwdlen = static_cast<uint32_t>(ss.size()); // 80
// Round 1: t=2, m=4096 KiB, lanes=2; salt = SHA-512 x2 (header).
{
argon2_context ctx;
ctx.out = hash.begin();
ctx.outlen = 32;
ctx.pwd = pwd;
ctx.pwdlen = pwdlen;
ctx.salt = salt_sha512.data();
ctx.saltlen = static_cast<uint32_t>(salt_sha512.size()); // 64
ctx.secret = nullptr; ctx.secretlen = 0;
ctx.ad = nullptr; ctx.adlen = 0;
ctx.allocate_cbk = nullptr;
ctx.free_cbk = nullptr;
ctx.flags = ARGON2_DEFAULT_FLAGS;
ctx.t_cost = 2;
ctx.m_cost = 4096;
ctx.lanes = 2;
ctx.threads = 1;
ctx.version = ARGON2_VERSION_NUMBER;
const int rc = argon2_ctx(&ctx, Argon2_id);
assert(rc == ARGON2_OK);
}
// Round 2: t=2, m=32768 KiB, lanes=2; salt = output of round 1.
{
argon2_context ctx;
ctx.out = hash2.begin();
ctx.outlen = 32;
ctx.pwd = pwd;
ctx.pwdlen = pwdlen;
ctx.salt = hash.begin();
ctx.saltlen = 32;
ctx.secret = nullptr; ctx.secretlen = 0;
ctx.ad = nullptr; ctx.adlen = 0;
ctx.allocate_cbk = nullptr;
ctx.free_cbk = nullptr;
ctx.flags = ARGON2_DEFAULT_FLAGS;
ctx.t_cost = 2;
ctx.m_cost = 32768;
ctx.lanes = 2;
ctx.threads = 1;
ctx.version = ARGON2_VERSION_NUMBER;
const int rc = argon2_ctx(&ctx, Argon2_id);
assert(rc == ARGON2_OK);
}
return hash2;
}
How much Premine have ? the first 3 blocks with a 50 reward for creating a checkpoint after force BIP's activations . (so there is no premine, no development fee, no delayed mining or whatever they like to call it)
Miners can simple donate some part of mined coins to dev's if they want - you can find donate addreses at website.Source codehttps://github.com/dpowcore-project/dpowcoinReleases precompled wallets for all platforms.https://github.com/dpowcore-project/dpowcoin/releaseshttps://dpowcore.org/en/download/Websitehttps://dpowcore.orgDisscordhttps://discord.gg/b9zkzAgUpHTelegram for discusionshttps://t.me/dpowcoinTelegram devshttps://t.me/dpowcoreTelegram news channelhttps://t.me/dpowcoinnewsTwitterhttps://twitter.com/dpowcoinExplorerhttps://explorer.dpowcore.orgExhangershttps://dex.gleec.com/https://komodoplatform.com/en/DesctriptionBased at Bitcoin 31.x branch..
Coin Name Dpowcoin
Short Name DPC
Block Time 5m or 300s
Diff Retargeting LWMA3 with N 576
Reward 50 coins
Subsidy Halving Interval Every 420 000 blocks
Proof Type Dual POW ( not multi pow!)
Algo Dual POW - by Yespower and Argon2id 0x13 + SHA512 - Old
Algo New - Argon2id 0x13 + SHA512
POW check like at LTC Using sha256d in headers indexing
Legacy Address Prefix P - 55 - 0x37
P2SH-SegWit Address Prefix C - 28 - 0x1c
Bech32-SegWit Prefix dpc1
Default p2p port 42003
Default rpc port 42002
powLimit 001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
BIPs activated Block 2
Network Magic 0xf29f4afb
bip324 Salt dpowcoin_v2_shared_secret
COINBASE MATURITY 100
MAX SUPPLY 42 000 000
Pre Mine None if not count 3 blocks for activate "BIP" rules.
Dev Fees None
How to mine ?
go to debug console and put command
generatetoaddress nblocks "address" ( maxtries )
Example for infine try
generatetoaddress 10000 "Myaddress" -1
nblocks must be positive value , sorry.
The project was largely created in response to the increasing spam of sha256 coins and a scrypt with abnormal premine.
IMPORTANT !We do not use "delayed POW" technology and are not related to komodo projects! We was use double PoW before block 225,000 or Dual POW!