Nxt Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client 1.11.10 - NEW RELEASE: Ardor 2.0.5e TestNet - The Ignis ICO is over!! Ardor genesis snapshots will happen at Nxt block 1,630,000 (expected for 25th December)

Pages: [1] 2  All

Author Topic: Network analysis  (Read 3090 times)

benjyz

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 508
    • View Profile
  • Karma: +71/-4
Network analysis
June 17, 2014, 05:57:43 am

I'm writing doing some analysis of the network to understand the system better. One thing I did was count the number of unique keys per 5000 blocks generating the block. That number increased to 200 at the beginning and is now roughly stable. I would have expected a further increase overtime, but perhaps this is correlated with the demand for Nxt. More buyers coming in should diversify this number more.

Code: [Select]
/*
 Nxt block generation analysis, 2014-06-16

 startBlock  0 generated by # addresses : 52 (numBlocks: 5000)
 startBlock  5000 generated by # addresses : 70 (numBlocks: 5000)
 startBlock  10000 generated by # addresses : 101 (numBlocks: 5000)
 startBlock  15000 generated by # addresses : 110 (numBlocks: 5000)
 startBlock  20000 generated by # addresses : 153 (numBlocks: 5000)
 startBlock  25000 generated by # addresses : 213 (numBlocks: 5000)
 startBlock  30000 generated by # addresses : 218 (numBlocks: 5000)
 startBlock  35000 generated by # addresses : 174 (numBlocks: 5000)
 startBlock  40000 generated by # addresses : 189 (numBlocks: 5000)
 startBlock  45000 generated by # addresses : 206 (numBlocks: 5000)
 startBlock  50000 generated by # addresses : 194 (numBlocks: 5000)
 startBlock  55000 generated by # addresses : 200 (numBlocks: 5000)
 startBlock  60000 generated by # addresses : 208 (numBlocks: 5000)
 startBlock  65000 generated by # addresses : 191 (numBlocks: 5000)
 startBlock  70000 generated by # addresses : 196 (numBlocks: 5000)
 startBlock  75000 generated by # addresses : 208 (numBlocks: 5000)
 startBlock  80000 generated by # addresses : 199 (numBlocks: 5000)
 startBlock  85000 generated by # addresses : 199 (numBlocks: 5000)
 startBlock  90000 generated by # addresses : 203 (numBlocks: 5000)
 startBlock  95000 generated by # addresses : 226 (numBlocks: 5000)
 startBlock  100000 generated by # addresses : 209 (numBlocks: 5000)
 startBlock  105000 generated by # addresses : 227 (numBlocks: 5000)
 startBlock  110000 generated by # addresses : 210 (numBlocks: 5000)
 startBlock  115000 generated by # addresses : 209 (numBlocks: 5000)
 startBlock  120000 generated by # addresses : 207 (numBlocks: 5000)
 startBlock  125000 generated by # addresses : 224 (numBlocks: 5000)
 startBlock  130000 generated by # addresses : 230 (numBlocks: 5000)
 startBlock  135000 generated by # addresses : 272 (numBlocks: 5000)
 startBlock  140000 generated by # addresses : 256 (numBlocks: 5000)
 startBlock  145000 generated by # addresses : 230 (numBlocks: 5000)
 startBlock  150000 generated by # addresses : 253 (numBlocks: 5000)
 startBlock  155000 generated by # addresses : 251 (numBlocks: 5000)

 */

the code for generation this information.

Code: [Select]
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

public class inspectDB {

public static void runQuery(int startHeight, int endHeight) {

Connection conn = null;

String dbUrl = "jdbc:h2:nxt_db/nxt;DB_CLOSE_ON_EXIT=FALSE";
dbUrl += ";DB_CLOSE_ON_EXIT=FALSE";

try {

Class.forName("org.h2.Driver");

conn = DriverManager.getConnection(dbUrl, "sa", "sa");

Statement stmt = conn.createStatement();
// generator_public_key
ArrayList<String> pubgenkeys = new ArrayList<String>();
String stmtStr = "SELECT generator_public_key, height, timestamp, total_amount FROM block where total_amount >= 0 and height > "
+ startHeight + " and height < " + endHeight;
ResultSet selectRS = stmt.executeQuery(stmtStr);// total_amount
while (selectRS.next()) {
String a = selectRS.getString(1);
pubgenkeys.add(a);

}

Iterator<String> it = pubgenkeys.iterator();
HashMap<String, Integer> occ = new HashMap<String, Integer>();
while (it.hasNext()) {
String cur = it.next();
// System.out.println(cur);
if (occ.containsKey(cur)) {
int last = occ.get(cur).intValue();
occ.remove(cur);
occ.put(cur, new Integer(last + 1));
} else
occ.put(cur, 1);
}

int numBlocks = endHeight - startHeight;
int numAddr = occ.values().size();

System.out.println("startBlock  " + startHeight
+ " generated by # addresses : " + numAddr
+ " (numBlocks: " + numBlocks + ")");

conn.close();

} catch (SQLException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {

e.printStackTrace();
} finally {
if (conn != null)
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}

}

public static void main(String[] args) {
int maxh = 160000;
int step = 5000;
for (int bh = 0; bh < maxh; bh += step) {
runQuery(bh, bh + step);
}
}
}

benjyz

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 508
    • View Profile
  • Karma: +71/-4
Re: Network analysis
June 17, 2014, 06:04:20 am

here the same for 10'000 intervals.

Code: [Select]
startBlock  0 generated by # addresses : 87 (numBlocks: 10000)
startBlock  10000 generated by # addresses : 147 (numBlocks: 10000)
startBlock  20000 generated by # addresses : 274 (numBlocks: 10000)
startBlock  30000 generated by # addresses : 291 (numBlocks: 10000)
startBlock  40000 generated by # addresses : 270 (numBlocks: 10000)
startBlock  50000 generated by # addresses : 269 (numBlocks: 10000)
startBlock  60000 generated by # addresses : 284 (numBlocks: 10000)
startBlock  70000 generated by # addresses : 276 (numBlocks: 10000)
startBlock  80000 generated by # addresses : 261 (numBlocks: 10000)
startBlock  90000 generated by # addresses : 291 (numBlocks: 10000)
startBlock  100000 generated by # addresses : 284 (numBlocks: 10000)
startBlock  110000 generated by # addresses : 271 (numBlocks: 10000)
startBlock  120000 generated by # addresses : 277 (numBlocks: 10000)
startBlock  130000 generated by # addresses : 341 (numBlocks: 10000)
startBlock  140000 generated by # addresses : 322 (numBlocks: 10000)
startBlock  150000 generated by # addresses : 336 (numBlocks: 10000)

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
June 17, 2014, 06:44:38 am

That's a good script.
« Last Edit: August 04, 2014, 10:07:06 am by devphp »

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
August 04, 2014, 10:08:03 am

Latest data, I see a correlation between the price and the number of successful forgers (directly related to total number of forgers):

« Last Edit: August 04, 2014, 10:57:29 am by devphp »

semibaron

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 333
    • View Profile
  • Karma: +16/-7
Re: Network analysis
August 04, 2014, 10:15:52 am

you posted a blank page

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14

semibaron

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 333
    • View Profile
  • Karma: +16/-7
Re: Network analysis
August 04, 2014, 10:49:52 am

No. Using Chrome

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
August 04, 2014, 10:55:33 am

semibaron

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 333
    • View Profile
  • Karma: +16/-7
Re: Network analysis
August 04, 2014, 11:48:08 am

No. Using Chrome

Uploaded elsewhere.

can see it now, thx.
What is the value of 1 time unit?

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
August 04, 2014, 11:58:59 am

can see it now, thx.
What is the value of 1 time unit?

Each bar is 10k blocks (~12 days).

ChuckOne

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3438
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
  • Karma: +291/-17
Re: Network analysis
August 04, 2014, 03:02:10 pm

Latest data, I see a correlation between the price and the number of successful forgers (directly related to total number of forgers):



Interesting. Could you provide the correlation via a chart?

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
August 04, 2014, 03:22:40 pm

Interesting. Could you provide the correlation via a chart?

Well,

https://dgex.com/
or
https://bter.com/trade/NXT_BTC   (daily bars).

Price movement from April to today.
It's not a 100% correlation, but it's noticeable.
Price moves higher (after AE was launched), more accounts forge. Price corrected in July, the number of forging accounts dropped. Which could be predicted and quite natural.
Let's see what happens in the next few weeks and months, when price hopefully goes up again, I'll remember to post an update.

frmelin

  • Jr. Member
  • **
  • Offline Offline
  • Posts: 45
    • View Profile
  • Karma: +1/-0
Re: Network analysis
August 04, 2014, 03:58:46 pm

Would be nice to check for a correlation with the volume of transactions (with fees) as well

Could it be that number of sucessfull forgers is low when only few transactions with fees are initiated (low volume)?
It wouldn't be the price increase explaining the increase in number of forgers, but rather the number of transactions with fees.

Price & volume being linked as well I guess

Logical? :-)
NXT-DNEE-TZ9V-EW7E-C64UY

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
August 04, 2014, 04:35:08 pm

You're right, it's correlated with volume of txs too.

https://nxtblocks.info/#section/blockexplorer_charts

the volume of txs peaked on June 9, a lot of txs are related to AE, now it's stabilized at a lower level, down to 1500-2000 daily txs, in April before AE launched it was less than 1000 txs per day.

So yeah, price and volume of txs do matter :)

mczarnek

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 898
    • View Profile
    • Nxt Place - Craigslist for Nxt
  • Karma: +68/-4
Re: Network analysis
August 12, 2014, 03:32:10 am

Interesting.. would also be interesting to know what percentage of the network is forging in terms of percentage of all Nxt.  Did that greatly increase after leasing for example?

Seems like it would be a similar script.
NXT Organization: Tech
Donations greatly appreciated: NXT-DWVJ-G89C-RHNL-6QW6Q

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
August 28, 2014, 10:46:54 am

Latest data. The spike to successful 304 forgers in the last 10k blocks is due to the Bter hack (at block 209886), after that forgers were involved in two competing forks? This time this is the only explanation, for price has been sliding downhill or sideways at best. 1/6 of accounts are lazy to forge during quiet times or when price is going down? :)

« Last Edit: August 28, 2014, 10:50:45 am by devphp »

ChuckOne

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 3438
  • ☕ NXT-4BTE-8Y4K-CDS2-6TB82
    • View Profile
  • Karma: +291/-17
Re: Network analysis
August 30, 2014, 10:56:43 am

Nice chart.

Sebastien256

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 2787
  • ^LOOK UP^ = Nxt community!
    • View Profile
  • Karma: +168/-24
Re: Network analysis
August 30, 2014, 11:25:15 am

Latest data. The spike to successful 304 forgers in the last 10k blocks is due to the Bter hack (at block 209886), after that forgers were involved in two competing forks? This time this is the only explanation, for price has been sliding downhill or sideways at best. 1/6 of accounts are lazy to forge during quiet times or when price is going down? :)



That is an interesting chart, +1.
Please drop your ideas concerning Nxt and/or NRS in this topic -> List of feature request for Nxt and/or NRS (with the full list in OP).

devphp

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1229
    • View Profile
  • Karma: +87/-14
Re: Network analysis
October 03, 2014, 12:18:21 pm

nxtrules

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 254
    • View Profile
  • Karma: +15/-1
Re: Network analysis
October 03, 2014, 12:33:31 pm

How so you guys post pics? Looks like the forum has disallowed it? Using tapatalk & desktop to access forum

Cool chart :-)
http://nxtrules.mooo.com {NXT investment tracking with multiple account support}
Pages: [1] 2  All