Bitcoin Forum
December 14, 2024, 12:08:37 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 ... 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 1986 1987 1988 1989 1990 1991 1992 ... 2557 »
  Print  
Author Topic: NXT :: descendant of Bitcoin - Updated Information  (Read 2761621 times)
2Kool4Skewl (OP)
Sr. Member
****
Offline Offline

Activity: 644
Merit: 250



View Profile WWW
February 28, 2014, 07:27:44 AM
 #38821

lock the posts at 2100 pages Grin


lol   Grin


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

Activity: 476
Merit: 500



View Profile
February 28, 2014, 07:28:53 AM
 #38822

lock the posts at 2100 pages Grin


lol   Grin

dooooo ittttttt! Tongue
ZeroTheGreat
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
February 28, 2014, 07:31:15 AM
 #38823

That's a BS answer. According to Ripple Labs they will be just as decentralized as NXT is in the future.
Mmm, big amount of (less and less interdependant) validators'll destroy your precious 3 sec. Sad, but true. Low amount of validators - no decentralization at all.
ZeroTheGreat
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


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

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
 #38825

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: 1806
Merit: 1038



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

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: 1086


Ian Knowles - CIYAM Lead Developer


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

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
 #38828

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
 #38829

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
 #38830

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
 #38831

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: 1086


Ian Knowles - CIYAM Lead Developer


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

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
 #38833

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
 #38834

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
 #38835

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
 #38836

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
 #38837

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
 #38838

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
 #38839

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: 1086


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
 #38840

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
Pages: « 1 ... 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 1986 1987 1988 1989 1990 1991 1992 ... 2557 »
  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!