Post
Topic
Board Announcements (Altcoins)
Re: [ANN][YAC] YACoin ongoing development
by
Joe_Bauers
on 26/06/2019, 20:28:00 UTC
I basically created the new version of Yacoin here but don't have time or interest to continue. Someone should take it from here.
https://github.com/joebauers/litecoin/releases/tag/vrandomnf1.0
Where is the windows wallet?

No wallet. You would have to compile. This is a proof of concept for a completely new scrypt-jane PoW only version of Yacoin based on Litecoin code.
Nfactor is randomly selected from previous hash. To work with Yacoin, someone would have to take on the extremely tedious task of including old YAC code and have a date based switch for hard fork.

The other (better) option would be to snapshot Yacoin as of a date and set up a redemption process YAC->NEWCOIN and start this new block-chain from scratch. 

Code:
int CBlockHeader::GetNfactor() const
{

    std::string spb = hashPrevBlock.ToString();
    std::string lasthashchar = spb.substr(block_length,1);

    unsigned char Nfactor = 19;
      if((spb == "0000000000000000000000000000000000000000000000000000000000000000")){
                  Nfactor = 4;}  // GENESIS

      else if((lasthashchar == "0") || (lasthashchar == "6") || (lasthashchar == "a")){
               Nfactor = 22;}
      else if((lasthashchar == "1") || (lasthashchar == "b")){
               Nfactor = 21;}
      else if((lasthashchar == "2") || (lasthashchar == "7") || (lasthashchar == "c")){
               Nfactor = 20;}
      else if((lasthashchar == "3") || (lasthashchar == "d")){
               Nfactor = 19;}
      else if((lasthashchar == "4") || (lasthashchar == "9") || (lasthashchar == "e")){
               Nfactor = 20;}
      else if((lasthashchar == "5") || (lasthashchar == "f")){
               Nfactor = 21;}
      else if((lasthashchar == "8")){
               Nfactor = 22;}

      return Nfactor;
}


uint256 CBlockHeader::GetPoWHash() const
{
 //   uint256 lhash;
    uint256 yhash;
 //   uint256 finalhash;

    std::string spb = hashPrevBlock.ToString();

      const char *salt(spb.c_str());
      size_t salt_len = block_length;
      unsigned char rfactor = 0;
      unsigned char pfactor = 0;
      size_t bytes = 32;

      CBlockHeader block_header;

//   scrypt_1024_1_1_256(BEGIN(nVersion), BEGIN(lhash));
    scrypt_jane(CVOIDBEGIN(nVersion), sizeof(block_header), salt, salt_len, GetNfactor(),  rfactor, pfactor,  UINTBEGIN(yhash), bytes);

//   arith_uint256 ArithLTCHash = UintToArith256(lhash);
//   arith_uint256 ArithYACHash = UintToArith256(yhash);
//   arith_uint256 CombinedHash = (ArithLTCHash + ArithYACHash);

//    finalhash = ArithToUint256(CombinedHash);   

//    return finalhash;  Another potential option scrypt-1024 + scrypt-jane

     return yhash;

}