Bitcoin Forum
February 07, 2026, 07:50:52 PM *
News: Latest Bitcoin Core release: 30.2 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 ... 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 [1935] 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 ... 2548 »
  Print  
Author Topic: NXT :: descendant of Bitcoin - Updated Information  (Read 2761763 times)
ZeroTheGreat
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
February 28, 2014, 07:35:39 AM
 #38681

Sorry, BTT's actually more comfortable for reading. At least for me.
wakasaki808
Sr. Member
****
Offline Offline

Activity: 476
Merit: 500



View Profile
February 28, 2014, 07:41:12 AM
 #38682

Sorry, BTT's actually more comfortable for reading. At least for me.

did you try all the different board themes with nxtcrypto?
abctc
Legendary
*
Offline Offline

Activity: 1820
Merit: 1040



View Profile
February 28, 2014, 07:43:02 AM
 #38683

Hey I have a question with transaction malleability.  From the NXT Wiki:
Quote
Transaction malleability is an issue with Nxt, as it is with all cryptocurrencies. Do not rely on a transaction ID alone to verify transactions!
...  So if an exchange should not rely on just looking for a transactionID, what is the proper method?  Do they have to attempt to track sendingAccountID, receivingAccountId, and amount?
- there was the CfB's answer:
It's a problem only for exchanges that rely solely on transaction id. It doesn't need to be fixed. An exchange is supposed to pay attention to timestamp and other parameters of a transaction.
what parameters ,except timestamp?
Amount or ReferencedTransaction.

█████████████████████████████████████████████████
███████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
██████████████████████████████████████████████████████
█████
█████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████
███████████████████████████████████████████████████████
█████████████████████████████████████████████████████████████
███████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████
   
, the Next platform.  Magis quam Moneta (More than a Coin)
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1131


Ian Knowles - CIYAM Lead Developer


View Profile WWW
February 28, 2014, 07:50:12 AM
 #38684

I would think ReferencedTransaction would be the most convenient (perhaps being always a previous one that has already confirmed although better not to be hard-coded otherwise it might fail after blockchain pruning).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
2Kool4Skewl (OP)
Sr. Member
****
Offline Offline

Activity: 644
Merit: 250



View Profile WWW
February 28, 2014, 08:16:30 AM
 #38685

I'm trying to simulate TF using Ian's program if we limit all accounts to a 1% forge balance.  Using 100 accounts holding 1% of the currency over a ten year period, I'm getting a combined best streak of ~23.  This is combining the first 50 accounts.  (These are the accounts assumed to be under the same control.)

Code:
// Copyright (c) 2014 CIYAM Developers
//
// Distributed under the MIT/X11 software license, please refer to the file license.txt
// in the root project directory or http://www.opensource.org/licenses/mit-license.php.

#include <ctime>
#include <cmath>
#include <cstdlib>

#include <string>
#include <vector>
#include <sstream>
#include <iostream>

//#define NUM_DAYS 1
#define NUM_YEARS 10

#define PENALISE_HIGHER_STAKE
//#define PREVENT_IMMEDIATE_REPEAT

//#define SHOW_WINNERS
//#define SHOW_WINNERS_WEIGHT

using namespace std;

const int c_combined_proportion = 2;

#ifndef NUM_YEARS
const size_t c_num_blocks = 1440 * NUM_DAYS;
#else
const size_t c_num_blocks = 1440 * 365 * NUM_YEARS;
#endif

int main( )
{
#ifdef SHOW_WINNERS
   string winners;
#endif
   vector< int > wins;
   vector< int > streaks;
   vector< int > balances;
   vector< int > penalised;
   vector< int > penalising;
   vector< int > best_streak;

   vector< int > combined;
   vector< long > weights;

   long total_balance = 0;

   int combined_streak = 0;
   int best_combined_streak = 0;

   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );
   balances.push_back( 1 );

   srand( ( unsigned int )time( 0 ) );

   for( size_t i = 0; i < balances.size( ); i++ )
   {
      total_balance += balances[ i ];

      wins.push_back( 0 );
      weights.push_back( 0 );
      streaks.push_back( 0 );
      combined.push_back( 0 );
      penalised.push_back( 0 );
      penalising.push_back( 0 );
      best_streak.push_back( 0 );
   }

   size_t last_winner = 0;
   for( size_t blocks = 0; blocks < c_num_blocks; blocks++ )
   {
      long total_weight = 0;
      for( size_t i = 0; i < weights.size( ); i++ )
      {
         if( penalising[ i ] )
         {
            --penalising[ i ];
            weights[ i ] = 0;
         }
         else
         {
            int divisor = rand( ) % 10;

            if( divisor == 0 )
               ++divisor;

            weights[ i ] = ( rand( ) % 10000 ) * ( balances[ i ] / divisor );

            if( weights[ i ] == 0 )
               ++weights[ i ];

            total_weight += weights[ i ];
         }
      }

      if( total_weight == 0 )
         ++total_weight;

      size_t winner = 0;
      size_t runner_up = 0;
      long best_target = 0;
      long second_best_target = 0;

      for( size_t i = 0; i < balances.size( ); i++ )
      {
         long adjusted_weight = weights[ i ] * 1000 / total_weight;

         if( adjusted_weight > best_target )
         {
            winner = i;
            best_target = adjusted_weight;
         }
         else if( adjusted_weight > second_best_target )
         {
            runner_up = i;
            second_best_target = adjusted_weight;
         }
      }

#ifdef PENALISE_HIGHER_STAKE
      if( best_target == 350 ) // an above median value
      {
         ++penalised[ winner ];
         penalising[ winner ] = 1440;
      }
#endif

#ifdef PREVENT_IMMEDIATE_REPEAT
      if( winner == last_winner )
         winner = runner_up;
#endif

#ifdef SHOW_WINNERS
      winners += ( char )( 'a' + winner );
#  ifdef SHOW_WINNERS_WEIGHT
      ostringstream osstr;
      osstr << best_target;
      winners += "(" + osstr.str( ) + ")";
#  endif
#endif
      ++wins[ winner ];

      if( winner < balances.size( ) / c_combined_proportion )
      {
         ++combined_streak;
         if( combined_streak > best_combined_streak )
            best_combined_streak = combined_streak;
      }
      else
         combined_streak = 0;

      if( winner == last_winner )
      {
         ++streaks[ winner ];
         if( streaks[ winner ] > best_streak[ winner ] )
            best_streak[ winner ] = streaks[ winner ];
      }
      else
         streaks[ winner ] = 0;

      last_winner = winner;
   }

   cout << "blocks = " << c_num_blocks << endl;

   for( size_t i = 0; i < balances.size( ); i++ )
      cout << ( char )( 'a' + i ) << " = " << balances[ i ] << endl;

#ifdef SHOW_WINNERS
   cout << winners << endl;
#endif
   for( size_t i = 0; i < wins.size( ); i++ )
      cout << "wins( " << ( char )( 'a' + i ) << " ) = " << wins[ i ] << endl;

#ifdef PENALISE_HIGHER_STAKE
   for( size_t i = 0; i < penalised.size( ); i++ )
      cout << "penalised( " << ( char )( 'a' + i ) << " ) = " << penalised[ i ] << endl;
#endif

   for( size_t i = 0; i < best_streak.size( ); i++ )
      cout << "best_streak( " << ( char )( 'a' + i ) << " ) = " << ( best_streak[ i ] + 1 ) << endl;

   cout << "best_combined_streak = " << best_combined_streak << endl;
   cout << "(combined the first " << ( balances.size( ) / c_combined_proportion ) << " accounts)" << endl;
   cout << balances.size() << endl;
}


                      ▄████████▄
                  ▄████████████████▄
             ▄██████████████████████████▄
      ▄███████████████████████████████████████▄
 ███████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
 ███████████████████████████████████████████████████
 ███████████████████████████████████████████████████
 ███████████████████████████████████████████████████
  █████████████████████████████████████████████████
   ███████████████████████████████████████████████
   ███████████████████████████████████████████████
    █████████████████████████████████████████████
     ███████████████████████████████████████████
      █████████████████████████████████████████
       ███████████████████████████████████████
        █████████████████████████████████████
         ███████████████████████████████████
          █████████████████████████████████
           ▀█████████████████████████████▀
             ▀█████████████████████████▀
               ▀█████████████████████▀
                 ▀█████████████████▀
                   ▀█████████████▀
                      ▀███████▀
TRUSTEE 
ChuckOne
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250

☕ NXT-4BTE-8Y4K-CDS2-6TB82


View Profile
February 28, 2014, 08:18:33 AM
 #38686

Just a reminder: BCNext don't want NXT to be a currency. Coins on top of Nxt should be. Does this change anything?

Does this change anything regarding instant confirmation discussion?

No.
ZeroTheGreat
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
February 28, 2014, 08:19:45 AM
 #38687

did you try all the different board themes with nxtcrypto?
Maybe I'll look for it and'll try it someday. I like use things "as is" very often.
Damelon
Legendary
*
Offline Offline

Activity: 1092
Merit: 1010



View Profile
February 28, 2014, 08:21:25 AM
 #38688

did you try all the different board themes with nxtcrypto?
Maybe I'll look for it and'll try it someday. I like use things "as is" very often.

Please try out the "prosilver" theme at least, before making a judgement.

It is SO much better and will probably be a mind-changer Smiley

Member of the Nxt Foundation | Donations: NXT-D6K7-MLY6-98FM-FLL5T
Join Nxt Slack! https://nxtchat.herokuapp.com/
Founder of Blockchain Workspace | Personal Site & Blog
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1131


Ian Knowles - CIYAM Lead Developer


View Profile WWW
February 28, 2014, 08:26:11 AM
 #38689

I'm trying to simulate TF using Ian's program if we limit all accounts to a 1% forge balance.  Using 100 accounts holding 1% of the currency over a ten year period, I'm getting a combined best streak of ~23.  This is combining the first 50 accounts.  (These are the accounts assumed to be under the same control.)

That's not too bad at all really - it basically gives us a rough idea that for huge transfer amounts (where you might be concerned with such a possible attack) you would want to require 30+ confirmations (around half the time of the average 6 confirmations for Bitcoin).

You might also want to experiment with different amounts of collusion (there should be a constant in the code that is used to determine the proportion of that).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
leetrump
Full Member
***
Offline Offline

Activity: 162
Merit: 100

hehe


View Profile
February 28, 2014, 08:26:24 AM
 #38690

When the test is completed AE? Roll Eyes
ChuckOne
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250

☕ NXT-4BTE-8Y4K-CDS2-6TB82


View Profile
February 28, 2014, 08:28:01 AM
 #38691

Any luck with the decentralized exchange? Seems like a hot buzz word across the crypto community, but not much content.

We are testing it.
ChuckOne
Sr. Member
****
Offline Offline

Activity: 364
Merit: 250

☕ NXT-4BTE-8Y4K-CDS2-6TB82


View Profile
February 28, 2014, 08:32:24 AM
 #38692

When the test is completed AE? Roll Eyes

When we are confident that it is secure?
wakasaki808
Sr. Member
****
Offline Offline

Activity: 476
Merit: 500



View Profile
February 28, 2014, 08:34:46 AM
 #38693

did you try all the different board themes with nxtcrypto?
Maybe I'll look for it and'll try it someday. I like use things "as is" very often.

well if you ever decide to and have an account there.

Its https://forums.nxtcrypto.org/ucp.php -> "Board Preferences" -> "My board style:" -> Then just look through the 5 different styles available.
2Kool4Skewl (OP)
Sr. Member
****
Offline Offline

Activity: 644
Merit: 250



View Profile WWW
February 28, 2014, 08:47:37 AM
 #38694

I'm trying to simulate TF using Ian's program if we limit all accounts to a 1% forge balance.  Using 100 accounts holding 1% of the currency over a ten year period, I'm getting a combined best streak of ~23.  This is combining the first 50 accounts.  (These are the accounts assumed to be under the same control.)

That's not too bad at all really - it basically gives us a rough idea that for huge transfer amounts (where you might be concerned with such a possible attack) you would want to require 30+ confirmations (around half the time of the average 6 confirmations for Bitcoin).

You might also want to experiment with different amounts of collusion (there should be a constant in the code that is used to determine the proportion of that).


I edited the code and added a constant, c_combined_percent, to determine the proportion of accounts in collusion.  Assuming all nodes are limited to 1% forge power over a ten year period and a ninety percent collusion rate, I'm getting a combined best streak of 151, 137 and 136 from three runs.

Code:
// Copyright (c) 2014 CIYAM Developers
//
// Distributed under the MIT/X11 software license, please refer to the file license.txt
// in the root project directory or http://www.opensource.org/licenses/mit-license.php.

#include <ctime>
#include <cmath>
#include <cstdlib>

#include <string>
#include <vector>
#include <sstream>
#include <iostream>

//#define NUM_DAYS 1
#define NUM_YEARS 10

#define PENALISE_HIGHER_STAKE
//#define PREVENT_IMMEDIATE_REPEAT

//#define SHOW_WINNERS
//#define SHOW_WINNERS_WEIGHT

using namespace std;

const int c_combined_proportion = 10;
const double c_combined_percent = 90;

#ifndef NUM_YEARS
const size_t c_num_blocks = 1440 * NUM_DAYS;
#else
const size_t c_num_blocks = 1440 * 365 * NUM_YEARS;
#endif

int main( )
{
#ifdef SHOW_WINNERS
   string winners;
#endif
   vector< int > wins;
   vector< int > streaks;
   vector< int > balances;
   vector< int > penalised;
   vector< int > penalising;
   vector< int > best_streak;

   vector< int > combined;
   vector< long > weights;

   long total_balance = 0;

   int combined_streak = 0;
   int best_combined_streak = 0;

   for(int a=0;a<100;a++){
   balances.push_back( 1 );
   }

   srand( ( unsigned int )time( 0 ) );

   for( size_t i = 0; i < balances.size( ); i++ )
   {
      total_balance += balances[ i ];

      wins.push_back( 0 );
      weights.push_back( 0 );
      streaks.push_back( 0 );
      combined.push_back( 0 );
      penalised.push_back( 0 );
      penalising.push_back( 0 );
      best_streak.push_back( 0 );
   }

   size_t last_winner = 0;
   for( size_t blocks = 0; blocks < c_num_blocks; blocks++ )
   {
      long total_weight = 0;
      for( size_t i = 0; i < weights.size( ); i++ )
      {
         if( penalising[ i ] )
         {
            --penalising[ i ];
            weights[ i ] = 0;
         }
         else
         {
            int divisor = rand( ) % 10;

            if( divisor == 0 )
               ++divisor;

            weights[ i ] = ( rand( ) % 10000 ) * ( balances[ i ] / divisor );

            if( weights[ i ] == 0 )
               ++weights[ i ];

            total_weight += weights[ i ];
         }
      }

      if( total_weight == 0 )
         ++total_weight;

      size_t winner = 0;
      size_t runner_up = 0;
      long best_target = 0;
      long second_best_target = 0;

      for( size_t i = 0; i < balances.size( ); i++ )
      {
         long adjusted_weight = weights[ i ] * 1000 / total_weight;

         if( adjusted_weight > best_target )
         {
            winner = i;
            best_target = adjusted_weight;
         }
         else if( adjusted_weight > second_best_target )
         {
            runner_up = i;
            second_best_target = adjusted_weight;
         }
      }

#ifdef PENALISE_HIGHER_STAKE
      if( best_target == 350 ) // an above median value
      {
         ++penalised[ winner ];
         penalising[ winner ] = 1440;
      }
#endif

#ifdef PREVENT_IMMEDIATE_REPEAT
      if( winner == last_winner )
         winner = runner_up;
#endif

#ifdef SHOW_WINNERS
      winners += ( char )( 'a' + winner );
#  ifdef SHOW_WINNERS_WEIGHT
      ostringstream osstr;
      osstr << best_target;
      winners += "(" + osstr.str( ) + ")";
#  endif
#endif
      ++wins[ winner ];

      if( winner < (int)((double)balances.size( ) * c_combined_percent / 100.0) )
      {
         ++combined_streak;
         if( combined_streak > best_combined_streak )
            best_combined_streak = combined_streak;
      }
      else
         combined_streak = 0;

      if( winner == last_winner )
      {
         ++streaks[ winner ];
         if( streaks[ winner ] > best_streak[ winner ] )
            best_streak[ winner ] = streaks[ winner ];
      }
      else
         streaks[ winner ] = 0;

      last_winner = winner;
   }

   cout << "blocks = " << c_num_blocks << endl;

   for( size_t i = 0; i < balances.size( ); i++ )
      cout << ( char )( 'a' + i ) << " = " << balances[ i ] << endl;

#ifdef SHOW_WINNERS
   cout << winners << endl;
#endif
   for( size_t i = 0; i < wins.size( ); i++ )
      cout << "wins( " << ( char )( 'a' + i ) << " ) = " << wins[ i ] << endl;

#ifdef PENALISE_HIGHER_STAKE
   for( size_t i = 0; i < penalised.size( ); i++ )
      cout << "penalised( " << ( char )( 'a' + i ) << " ) = " << penalised[ i ] << endl;
#endif

   for( size_t i = 0; i < best_streak.size( ); i++ )
      cout << "best_streak( " << ( char )( 'a' + i ) << " ) = " << ( best_streak[ i ] + 1 ) << endl;

   cout << "best_combined_streak = " << best_combined_streak << endl;
   cout << "(combined the first " << ( (double)balances.size( ) * c_combined_percent / 100.0 ) << " accounts)" << endl;
   cout << balances.size() << endl;
}



                      ▄████████▄
                  ▄████████████████▄
             ▄██████████████████████████▄
      ▄███████████████████████████████████████▄
 ███████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
 ███████████████████████████████████████████████████
 ███████████████████████████████████████████████████
 ███████████████████████████████████████████████████
  █████████████████████████████████████████████████
   ███████████████████████████████████████████████
   ███████████████████████████████████████████████
    █████████████████████████████████████████████
     ███████████████████████████████████████████
      █████████████████████████████████████████
       ███████████████████████████████████████
        █████████████████████████████████████
         ███████████████████████████████████
          █████████████████████████████████
           ▀█████████████████████████████▀
             ▀█████████████████████████▀
               ▀█████████████████████▀
                 ▀█████████████████▀
                   ▀█████████████▀
                      ▀███████▀
TRUSTEE 
Labteck
Sr. Member
****
Offline Offline

Activity: 311
Merit: 250


View Profile
February 28, 2014, 08:57:37 AM
 #38695

This 2000 post thrad is madness...please consider to CLOSE IT, with a last message like "go to forum nxccrypto" or something like that.

▄████████████████████████████████████████████████████████▄
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
████████████████████  █████████████████████████████████████
███████████████████  ██████████████████████████████████████
██████████████████  ███████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
 ▀███████████████████████████████████████████████████████▀
       VIORCOIN[by_conty] ▄████████████████████████████████████████████████████████▄
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
████████████████████  █████████████████████████████████████
███████████████████  ██████████████████████████████████████
██████████████████  ███████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████
 ▀███████████████████████████████████████████████████████▀
        Make International Calls
      Cheap and More Secure
2Kool4Skewl (OP)
Sr. Member
****
Offline Offline

Activity: 644
Merit: 250



View Profile WWW
February 28, 2014, 08:59:21 AM
 #38696

I'm trying to simulate TF using Ian's program if we limit all accounts to a 1% forge balance.  Using 100 accounts holding 1% of the currency over a ten year period, I'm getting a combined best streak of ~23.  This is combining the first 50 accounts.  (These are the accounts assumed to be under the same control.)

That's not too bad at all really - it basically gives us a rough idea that for huge transfer amounts (where you might be concerned with such a possible attack) you would want to require 30+ confirmations (around half the time of the average 6 confirmations for Bitcoin).

You might also want to experiment with different amounts of collusion (there should be a constant in the code that is used to determine the proportion of that).


I edited the code and added a constant, c_combined_percent, to determine the proportion of accounts in collusion.  Assuming all nodes are limited to 1% forge power over a ten year period and a ninety percent collusion rate, I'm getting a combined best streak of 151, 137 and 136 from three runs.

Compare this to allowing an unlimited amount of forging power per account.  If you assign ninety-one percent of the currency to one account and run the test over a ten year period, the account with 91% of the currency gets best streak of 468, 419, 415.  These streaks are three times longer than if you limit accounts to 1% forging power.

Code:
// Copyright (c) 2014 CIYAM Developers
//
// Distributed under the MIT/X11 software license, please refer to the file license.txt
// in the root project directory or http://www.opensource.org/licenses/mit-license.php.

#include <ctime>
#include <cmath>
#include <cstdlib>

#include <string>
#include <vector>
#include <sstream>
#include <iostream>

//#define NUM_DAYS 1
#define NUM_YEARS 10

#define PENALISE_HIGHER_STAKE
//#define PREVENT_IMMEDIATE_REPEAT

//#define SHOW_WINNERS
//#define SHOW_WINNERS_WEIGHT

using namespace std;

const int c_combined_proportion = 10;

#ifndef NUM_YEARS
const size_t c_num_blocks = 1440 * NUM_DAYS;
#else
const size_t c_num_blocks = 1440 * 365 * NUM_YEARS;
#endif

int main( )
{
#ifdef SHOW_WINNERS
   string winners;
#endif
   vector< int > wins;
   vector< int > streaks;
   vector< int > balances;
   vector< int > penalised;
   vector< int > penalising;
   vector< int > best_streak;

   vector< int > combined;
   vector< long > weights;

   long total_balance = 0;

   int combined_streak = 0;
   int best_combined_streak = 0;

   for(int a=0;a<9;a++){
   balances.push_back( 1 );
   }
   balances.push_back(91);

   srand( ( unsigned int )time( 0 ) );

   for( size_t i = 0; i < balances.size( ); i++ )
   {
      total_balance += balances[ i ];

      wins.push_back( 0 );
      weights.push_back( 0 );
      streaks.push_back( 0 );
      combined.push_back( 0 );
      penalised.push_back( 0 );
      penalising.push_back( 0 );
      best_streak.push_back( 0 );
   }

   size_t last_winner = 0;
   for( size_t blocks = 0; blocks < c_num_blocks; blocks++ )
   {
      long total_weight = 0;
      for( size_t i = 0; i < weights.size( ); i++ )
      {
         if( penalising[ i ] )
         {
            --penalising[ i ];
            weights[ i ] = 0;
         }
         else
         {
            int divisor = rand( ) % 10;

            if( divisor == 0 )
               ++divisor;

            weights[ i ] = ( rand( ) % 10000 ) * ( balances[ i ] / divisor );

            if( weights[ i ] == 0 )
               ++weights[ i ];

            total_weight += weights[ i ];
         }
      }

      if( total_weight == 0 )
         ++total_weight;

      size_t winner = 0;
      size_t runner_up = 0;
      long best_target = 0;
      long second_best_target = 0;

      for( size_t i = 0; i < balances.size( ); i++ )
      {
         long adjusted_weight = weights[ i ] * 1000 / total_weight;

         if( adjusted_weight > best_target )
         {
            winner = i;
            best_target = adjusted_weight;
         }
         else if( adjusted_weight > second_best_target )
         {
            runner_up = i;
            second_best_target = adjusted_weight;
         }
      }

#ifdef PENALISE_HIGHER_STAKE
      if( best_target == 350 ) // an above median value
      {
         ++penalised[ winner ];
         penalising[ winner ] = 1440;
      }
#endif

#ifdef PREVENT_IMMEDIATE_REPEAT
      if( winner == last_winner )
         winner = runner_up;
#endif

#ifdef SHOW_WINNERS
      winners += ( char )( 'a' + winner );
#  ifdef SHOW_WINNERS_WEIGHT
      ostringstream osstr;
      osstr << best_target;
      winners += "(" + osstr.str( ) + ")";
#  endif
#endif
      ++wins[ winner ];

      if( winner < balances.size( ) / c_combined_proportion )
      {
         ++combined_streak;
         if( combined_streak > best_combined_streak )
            best_combined_streak = combined_streak;
      }
      else
         combined_streak = 0;

      if( winner == last_winner )
      {
         ++streaks[ winner ];
         if( streaks[ winner ] > best_streak[ winner ] )
            best_streak[ winner ] = streaks[ winner ];
      }
      else
         streaks[ winner ] = 0;

      last_winner = winner;
   }

   cout << "blocks = " << c_num_blocks << endl;

   for( size_t i = 0; i < balances.size( ); i++ )
      cout << ( char )( 'a' + i ) << " = " << balances[ i ] << endl;

#ifdef SHOW_WINNERS
   cout << winners << endl;
#endif
   for( size_t i = 0; i < wins.size( ); i++ )
      cout << "wins( " << ( char )( 'a' + i ) << " ) = " << wins[ i ] << endl;

#ifdef PENALISE_HIGHER_STAKE
   for( size_t i = 0; i < penalised.size( ); i++ )
      cout << "penalised( " << ( char )( 'a' + i ) << " ) = " << penalised[ i ] << endl;
#endif

   for( size_t i = 0; i < best_streak.size( ); i++ )
      cout << "best_streak( " << ( char )( 'a' + i ) << " ) = " << ( best_streak[ i ] + 1 ) << endl;

   cout << "best_combined_streak = " << best_combined_streak << endl;
   cout << "(combined the first " << ( balances.size( ) / c_combined_proportion ) << " accounts)" << endl;
   cout << balances.size() << endl;
}


                      ▄████████▄
                  ▄████████████████▄
             ▄██████████████████████████▄
      ▄███████████████████████████████████████▄
 ███████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
█████████████████████████████████████████████████████
 ███████████████████████████████████████████████████
 ███████████████████████████████████████████████████
 ███████████████████████████████████████████████████
  █████████████████████████████████████████████████
   ███████████████████████████████████████████████
   ███████████████████████████████████████████████
    █████████████████████████████████████████████
     ███████████████████████████████████████████
      █████████████████████████████████████████
       ███████████████████████████████████████
        █████████████████████████████████████
         ███████████████████████████████████
          █████████████████████████████████
           ▀█████████████████████████████▀
             ▀█████████████████████████▀
               ▀█████████████████████▀
                 ▀█████████████████▀
                   ▀█████████████▀
                      ▀███████▀
TRUSTEE 
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1131


Ian Knowles - CIYAM Lead Developer


View Profile WWW
February 28, 2014, 09:02:08 AM
Last edit: February 28, 2014, 09:13:22 AM by CIYAM Open
 #38697

I edited the code and added a constant, c_combined_percent, to determine the proportion of accounts in collusion.  Assuming all nodes are limited to 1% forge power over a ten year period and a ninety percent collusion rate, I'm getting a combined best streak of 151, 137 and 136 from three runs.

That's really not too bad either - less than the time it takes to watch a LOTR film to be able to safely buy a house or other big investment even if 90% of the forging power is trying to secretly forge a replacement blockchain!

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
zorke
Full Member
***
Offline Offline

Activity: 238
Merit: 100


View Profile
February 28, 2014, 09:16:56 AM
 #38698

The two top 50M accounts!! What is their deal? Why are they not sharing their wealth or participating in the progress of their investment. I mean if we consider that the account No. 3 and No. 4 are DGEX and BTER that means they have almost double amount of coins compared to account No. 5 which has about 29M. That is a huge difference. Honestly I would be really ashamed if I was them and I am sure these two 50M amounts are poke in the eye to any new investor that looks our distribution just like they are poking my eye.

Heck, to start at least get your accounts under 50M so they are in the 40s or divide this 50M into two accounts of 25M, it will definitely look better for newcomers.
I really don't understand this!!
ShroomsKit_Disgrace
Legendary
*
Offline Offline

Activity: 952
Merit: 1000

Yeah! I hate ShroomsKit!


View Profile
February 28, 2014, 09:23:47 AM
 #38699

The two top 50M accounts!! What is their deal? Why are they not sharing their wealth or participating in the progress of their investment. I mean if we consider that the account No. 3 and No. 4 are DGEX and BTER that means they have almost double amount of coins compared to account No. 5 which has about 29M. That is a huge difference. Honestly I would be really ashamed if I was them and I am sure these two 50M amounts are poke in the eye to any new investor that looks our distribution just like they are poking my eye.

Heck, to start at least get your accounts under 50M so they are in the 40s or divide this 50M into two accounts of 25M, it will definitely look better for newcomers.
I really don't understand this!!

+ 1
swartzfeger
Full Member
***
Offline Offline

Activity: 350
Merit: 100


View Profile
February 28, 2014, 09:28:30 AM
 #38700

This 2000 post thrad is madness...please consider to CLOSE IT, with a last message like "go to forum nxccrypto" or something like that.

No. Nostalgie de la boue. It's messy and fine just like it is. You organized neat freaks can admire your manicured threads over at nxtcrypto Tongue
Pages: « 1 ... 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 [1935] 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 ... 2548 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!