NIKITONIUMという暗号通貨のソースを見よう

暗号通貨
スポンサーリンク

はじめに

先日、NIKITONIUM という 暗号通貨を見つけた
bitcointalkのトピックスは無くなっているようだが
2023年11月にリリースをしているみたい
現在(2024/02/27)のブロック高は 81,297 でした
アルゴリズムは GhostRider というもので、このアルゴリズムは Raptoreum で開発されたアルゴリズムだとか
基本CPUマイニング用ですが、現在ではGPUを使ってのマイニングも可能になっていますね

通貨のシンボルが「NIKI」
日本読みで「ニキ」ですね。「暗号通貨ニキ」
なんか素敵じゃないか!!

という事で、ちょっぴりソースを拝見してみよう

chainparams.cpp

まずは chainparams.cpp を見てみよう!
このソースでは暗号通貨の様々なパラメータを見る事が出来る場所。頭脳といった部分でしょうか(汗)

最初のコメント部

// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Copyright (c) 2014-2020 The Dash Core developers
// Copyright (c) 2020-2022 The Nikito developers

この流れですねぇ
私の好きな DASH の血を受け継いでいる
masternode ですね、最近だと、 smartnode と呼ばれているのかな
良く分からないが…

pszTimestampの値

ここも見ておきたい部分です

const char* pszTimestamp = "10/10/2023 finalization Nikitonium";

ここはもっと洒落た内容でも良いですよねぇ~
Bitcoinは、”The Times 03/Jan/2009 Chancellor on brink of second bailout for banks” 有名ですね
イギリスの新聞「The Times」の見出しだそうです

そしてUkkeyCoinは…無名ですね(汗)
“17/Feb/2019 Okinawan fisherman reel in two live oarfish, eat portion of one” としています
↓記事を見つけたので、刻んでみたw
沖縄タイムス

この pszTimestamp の文字列は長すぎるとダメみたいで、最大で91バイトでした(汗)

nPowTargetSpacingの値

ブロックの発生間隔はこちら

consensus.nPowTargetSpacing = 2 * 60; // Nikito: 2 minutes

2分に1度ブロックが発生ですねん

base58Prefixesの値

あとは、ここかな

// Nikito addresses start with 'N'
base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1,53);
// Nikito script addresses start with '7'
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1,16);
// Nikito private keys start with '7' or 'X'
base58Prefixes[SECRET_KEY] =     std::vector<unsigned char>(1,128);

[PUBKEY_ADDRESS] と [SECRET_KEY] に設定してある値に注目です
ここの値を使って好きなアドレスが作れるようになる

$ ./vanitygen -X 53 -Y 128 NiKiTo

こんな感じで、アドレスの先頭文字列を指定できる
指定文字列が長くなるほど、時間が掛かる
これは、秘密鍵をひたすら発行して、アドレスを算出し、そのアドレスの先頭文字列がマッチしたら終了って事かと(汗)
凄いマシンスペックだったり、運が良ければ直ぐに終わるかも

nCollaterals

あとは、こちら

consensus.nCollaterals = SmartnodeCollaterals(
	{ {88580, 900000 * COIN},
	{132580, 1100000 * COIN},
	{176580, 1350000 * COIN},
	{220580, 1600000 * COIN},
	{264580, 1900000 * COIN},
	{INT_MAX, 2100000 * COIN}
},
{ {5761, 0},
	{88580, 50},
	{132580, 45},
	{176580, 40},
	{220580, 35},
	{264580, 30},
	{INT_MAX, 20}
}
);

最近では、ブロック高によってsmartnodeの担保となるCOIN数が変動するみたいで、どんどんCOINが必要になっていくケースが多いようですね
ブロック高 88,580 までは、900,000NIKI 必要で、少し進み ブロック高 132,580 になると、1,100,000NIKI 必要になる
これは、900,000NIKIで作成したsmartnodeを解除して新たに+200,000NIKI足して合計 1,100,000NIKI 束ねて再作成する事になるハズ

あとここでは、smartnode報酬の割合が定義されているみたい

consensus.nSmartnodePaymentsStartBlock = 5761; //

という事で、ブロック高 5,761 (5,762?)から smartnodeに対しての報酬が発生するハズで、ブロック高 (多分)88,580まで50%になるのかな
その後 45%、40%と少しずつ smartnode の報酬が減るように設計されているね、ブロック高264,580超えると 以降は 20% になる
UkkeyCoinの場合は、徐々にmasternodeの割合を増やしています

validation.cpp

あと src/validation.cpp 内にある GetBlockSubsidy も拝見、こちらでブロック報酬が決められている

CAmount GetBlockSubsidy(int nPrevBits, int nPrevHeight, const Consensus::Params& consensusParams, bool fSuperblockPartOnly)
{
    // if (Params().NetworkIDString() == "main") {
    //     std::cout << "This is Testnet only build" << endl;
    //     exit(1);
    // }
    double nSubsidy = 5000;      // (declaring the reward variable and its original/default amount)
    const short owlings = 21262; // amount of blocks between 2 owlings
    int multiplier;              // integer number of owlings
    int tempHeight;              // number of blocks since last anchor
    if ((nPrevHeight > 553531) && (nPrevHeight < 2105657)) {
        tempHeight = nPrevHeight - 553532;
        multiplier = tempHeight / owlings;
        nSubsidy -= (multiplier * 10 + 10);
    } else if ((nPrevHeight >= 2105657) && (nPrevHeight < 5273695)) {
        tempHeight = nPrevHeight - 2105657;
        multiplier = tempHeight / owlings;
        nSubsidy -= (multiplier * 20 + 750);
    } else if ((nPrevHeight >= 5273695) && (nPrevHeight < 7378633)) {
        tempHeight = nPrevHeight - 5273695;
        multiplier = tempHeight / owlings;
        nSubsidy -= (multiplier * 10 + 3720);
    } else if ((nPrevHeight >= 7378633) && (nPrevHeight < 8399209)) {
        tempHeight = nPrevHeight - 7378633;
        multiplier = tempHeight / owlings;
        nSubsidy -= (multiplier * 5 + 4705);
    } else if ((nPrevHeight >= 8399209) && (nPrevHeight < 14735285)) {
        nSubsidy = 55;
    } else if ((nPrevHeight >= 14735285) && (nPrevHeight < 15798385)) {
        tempHeight = nPrevHeight - 14735285;
        multiplier = tempHeight / owlings;
        nSubsidy -= (multiplier + 4946);
    } else if ((nPrevHeight >= 15798385) && (nPrevHeight < 25844304)) {
        nSubsidy = 5;
    } else if (nPrevHeight >= 25844304) {
        nSubsidy = 0.001;
    }
    return nSubsidy * COIN;
}

デフォルトが5,000NIKIだが、if文で ブロック高に応じて 変化させているようだ
仮にブロック高が 600,000 だとすると
tempHeight が 600000 – 553532 = 46468
multiplier = tempHeight / owlings;
46468 / 21262 = 2.18549525 で int で丸められて 2
nSubsidy -= (multiplier * 10 + 10);
5000 – (2 * 10 + 10) = 4970
あまり変わらないですねぇ

ちなみに、ブロック高が 3,000,000 の時だと 3410になるようです(chatGPTで計算させた)

おわりに

という事で、今回は NIKITONIUM という暗号通貨のソースの一部分を見てきました
また機会があれば、別の暗号通貨を見ていきます

コメント