Title: Nxt source code Post by: Come-from-Beyond on November 29, 2013, 08:01:53 PM I wrote this a couple of times but noone seems to paid attention.
BCNext offered to reveal any part of the code for review. He doesn't want to publish the complete code till the 3rd of January to protect Nxt against copycats. So, if there are Java programmers who would like to view (and possibly improve) the source code, please, post ur requests here. Title: Re: Nxt source code Post by: bybitcoin on November 29, 2013, 08:09:52 PM I wrote this a couple of times but noone seems to paid attention. Good clever move!BCNext offered to reveal any part of the code for review. He doesn't want to publish the complete code till the 3rd of January to protect Nxt against copycats. So, if there are Java programmers who would like to view (and possibly improve) the source code, please, post ur requests here. Perhaps you can post it on the announcement board too, for getting wider attention. Title: Re: Nxt source code Post by: arafel71 on November 29, 2013, 08:17:26 PM Hi come-from-beyond
That's interesting, can you ''package'' and share an Eclipse workspace with somes java source ? we don't need all source from now because we need to protect nxt coin but some java source can help us for understanding algorithm. A Java J2EE project director. Title: Re: Nxt source code Post by: Come-from-Beyond on November 29, 2013, 08:20:07 PM Hi come-from-beyond That's interesting, can you ''package'' and share an Eclipse workspace with somes java source ? we don't need all source from now because we need to protect nxt coin but some java source can help us for understanding algorithm. A Java J2EE project director. I can't do it. Post here what part (mining algo, crypto, peer connection, etc.) u need and I'll post it here after I get it from BCNext. Title: Re: Nxt source code Post by: arafel71 on November 29, 2013, 08:27:42 PM I see many question on forum about mining process, maybe you can post some part of this code if BCnext allow it.
I let other java developper ask other part (crypto, etc...) , many thanks for help us see ''threw the fog'' . Title: Re: Nxt source code Post by: Jean-Luc on November 29, 2013, 10:34:59 PM Post here what part (mining algo, crypto, peer connection, etc.) u need and I'll post it here after I get it from BCNext. The part that seems to need most work at the moment is the networking and the loading of the block chain, which is still not stable, isn't it? It is also probably not Nxt specific, so disclosing it is not likely to help someone clone Nxt. I could try to help debugging it. Title: Re: Nxt source code Post by: kwest on November 29, 2013, 10:54:35 PM I really like this move. A little community help never hurt.
Title: Re: Nxt source code Post by: bob131313 on November 30, 2013, 03:16:25 AM I would like to review the peer connection code.
Thanks Title: Re: Nxt source code Post by: Come-from-Beyond on November 30, 2013, 07:33:29 AM I see many question on forum about mining process, maybe you can post some part of this code if BCnext allow it. Part of main() method: Code: (new Thread() { @Override public void run() { HashMap<Account, Block> lastBlocks = new HashMap<>(); HashMap<Account, BigInteger> hits = new HashMap<>(); while (state == 0) { try { if (bootstrappingState >= 0) { HashMap<Account, User> unlockedAccounts = new HashMap<>(); for (User user : users.values()) { if (user.secretPhrase != null) { Account account = accounts.get(Account.getId(Crypto.getPublicKey(user.secretPhrase))); if (account != null && account.getEffectiveBalance() > 0) { unlockedAccounts.put(account, user); } } } for (Map.Entry<Account, User> unlockedAccountEntry : unlockedAccounts.entrySet()) { Account account = unlockedAccountEntry.getKey(); User user = unlockedAccountEntry.getValue(); Block lastBlock = Block.getLastBlock(); if (lastBlocks.get(account) != lastBlock) { byte[] generationSignature = Crypto.sign(lastBlock.generationSignature, user.secretPhrase); byte[] generationSignatureHash = MessageDigest.getInstance("SHA-256").digest(generationSignature); BigInteger hit = new BigInteger(1, new byte[] {generationSignatureHash[7], generationSignatureHash[6], generationSignatureHash[5], generationSignatureHash[4], generationSignatureHash[3], generationSignatureHash[2], generationSignatureHash[1], generationSignatureHash[0]}); lastBlocks.put(account, lastBlock); hits.put(account, hit); JSONObject response = new JSONObject(); response.put("response", "setBlockGenerationDeadline"); response.put("deadline", hit.divide(BigInteger.valueOf(Block.getBaseTarget()).multiply(BigInteger.valueOf(account.getEffectiveBalance()))).longValue() - (getEpochTime(System.currentTimeMillis()) - lastBlock.timestamp)); user.send(response); } int elapsedTime = getEpochTime(System.currentTimeMillis()) - lastBlock.timestamp; if (elapsedTime > 0) { BigInteger target = BigInteger.valueOf(Block.getBaseTarget()).multiply(BigInteger.valueOf(account.getEffectiveBalance())).multiply(BigInteger.valueOf(elapsedTime)); if (hits.get(account).compareTo(target) < 0) { account.generateBlock(user.secretPhrase); } } } } Thread.sleep(1000); } catch (Exception e) { log("9: " + e.toString()); } } } }).start(); Part of Account class: Code: int getEffectiveBalance() { if (height == 0) { return (int)(balance / 100); } if (Block.getLastBlock().height - height < 1440) { return 0; } int amount = 0; for (long transactionId : Block.getLastBlock().transactions) { Transaction transaction = transactions.get(transactionId); if (transaction.recipient == id) { amount += transaction.amount; } } return (int)(balance / 100) - amount; } Part of Account class: Code: void generateBlock(String secretPhrase) throws Exception { HashMap<Long, Transaction> newTransactions; synchronized (transactions) { Transaction[] sortedTransactions = unconfirmedTransactions.values().toArray(new Transaction[0]); while (sortedTransactions.length > 0) { int i; for (i = 0; i < sortedTransactions.length; i++) { Transaction transaction = sortedTransactions[i]; if (transaction.referencedTransaction != 0 && transactions.get(transaction.referencedTransaction) == null) { sortedTransactions[i] = sortedTransactions[sortedTransactions.length - 1]; Transaction[] tmp = new Transaction[sortedTransactions.length - 1]; System.arraycopy(sortedTransactions, 0, tmp, 0, tmp.length); sortedTransactions = tmp; break; } } if (i == sortedTransactions.length) { break; } } Arrays.sort(sortedTransactions); newTransactions = new HashMap<>(); for (int i = 0; i < 255 && i < sortedTransactions.length; i++) { long id = sortedTransactions[i].getId(); newTransactions.put(id, sortedTransactions[i]); } } Block block = new Block(1, getEpochTime(System.currentTimeMillis()), lastBlock, newTransactions.size(), 0, 0, 0, null, Crypto.getPublicKey(secretPhrase), null, new byte[64]); block.transactions = new long[block.numberOfTransactions]; int i = 0; for (Map.Entry<Long, Transaction> transactionEntry : newTransactions.entrySet()) { Transaction transaction = transactionEntry.getValue(); if (transaction.type == Transaction.TYPE_PAYMENT && transaction.subtype == Transaction.SUBTYPE_PAYMENT_ORDINARY_PAYMENT) { block.totalAmount += transaction.amount; } block.totalFee += transaction.fee; block.payloadLength += transaction.getBytes().length; block.transactions[i++] = transactionEntry.getKey(); } Arrays.sort(block.transactions); MessageDigest digest = MessageDigest.getInstance("SHA-256"); for (i = 0; i < block.numberOfTransactions; i++) { digest.update(newTransactions.get(block.transactions[i]).getBytes()); } block.payloadHash = digest.digest(); block.generationSignature = Crypto.sign(Block.getLastBlock().generationSignature, secretPhrase); byte[] data = block.getBytes(); byte[] data2 = new byte[data.length - 64]; System.arraycopy(data, 0, data2, 0, data2.length); block.blockSignature = Crypto.sign(data2, secretPhrase); ByteBuffer outputBuffer = Peer.getOutputBuffer(224 + block.payloadLength, Peer.PACKET_TYPE_NEW_BLOCK_REQUEST); outputBuffer.put(block.getBytes()); for (i = 0; i < block.numberOfTransactions; i++) { Transaction transaction = newTransactions.get(block.transactions[i]); outputBuffer.put(transaction.getBytes()); } Peer.sendToAllPeers(outputBuffer); } Part of Transaction class (used by Arrays.sort()): Code: public int compareTo(Transaction o) { if (height < o.height) { return -1; } else if (height > o.height) { return 1; } else { if (fee * 32768L / getBytes().length > o.fee * 32768L / o.getBytes().length) { return -1; } else if (fee * 32768L / getBytes().length < o.fee * 32768L / o.getBytes().length) { return 1; } else { if (timestamp < o.timestamp) { return -1; } else if (timestamp > o.timestamp) { return 1; } else { if (index < o.index) { return -1; } else if (index > o.index) { return 1; } else { return 0; } } } } } Title: Re: Nxt source code Post by: Come-from-Beyond on November 30, 2013, 07:41:59 AM The part that seems to need most work at the moment is the networking and the loading of the block chain, which is still not stable, isn't it? It is also probably not Nxt specific, so disclosing it is not likely to help someone clone Nxt. I could try to help debugging it. Networking is being fixed now, it will be published later. Loading the blockchain Part of main() method: Code: if (bootstrappingState >= 0) { peer = Peer.getAnyConnectedPeer(); if (peer != null) { setBootstrappingState(0); ByteBuffer outputBuffer = Peer.getOutputBuffer(0, Peer.PACKET_TYPE_CUMULATIVE_DIFFICULTY_REQUEST); peer.send(outputBuffer); } } Part of Peer class: Code: case PACKET_TYPE_CUMULATIVE_DIFFICULTY_REQUEST: { byte[] cumulativeDifficulty = Block.getLastBlock().cumulativeDifficulty.toByteArray(); ByteBuffer outputBuffer = getOutputBuffer(2 + cumulativeDifficulty.length, PACKET_TYPE_CUMULATIVE_DIFFICULTY_RESPONSE); outputBuffer.putShort((short)cumulativeDifficulty.length); outputBuffer.put(cumulativeDifficulty); send(outputBuffer); } break; case PACKET_TYPE_CUMULATIVE_DIFFICULTY_RESPONSE: { if (bootstrappingState == 0) { int cumulativeDifficultyLength = inputBuffer.getShort(); byte[] cumulativeDifficulty = new byte[cumulativeDifficultyLength]; inputBuffer.get(cumulativeDifficulty); betterCumulativeDifficulty = new BigInteger(cumulativeDifficulty); synchronized (blocks) { if (betterCumulativeDifficulty.compareTo(Block.getLastBlock().cumulativeDifficulty) > 0) { setBootstrappingState(-1); bootstrappingPeer = this; ByteBuffer outputBuffer = Peer.getOutputBuffer(0, PACKET_TYPE_MILESTONE_BLOCKS_REQUEST); send(outputBuffer); } else { setBootstrappingState(1); } } } } break; case PACKET_TYPE_MILESTONE_BLOCKS_REQUEST: { try { LinkedList<Long> milestoneBlocks = new LinkedList<>(); Block block = Block.getLastBlock(); int jumpLength = block.height / 4093 + 1; while (block.height > 0) { milestoneBlocks.add(block.getId()); for (int i = 0; i < jumpLength && block.height > 0; i++) { block = blocks.get(block.previousBlock); } } ByteBuffer outputBuffer = Peer.getOutputBuffer(2 + milestoneBlocks.size() * 8, PACKET_TYPE_MILESTONE_BLOCKS_RESPONSE); outputBuffer.putShort((short)milestoneBlocks.size()); for (int i = 0; i < milestoneBlocks.size(); i++) { outputBuffer.putLong(milestoneBlocks.get(i)); } send(outputBuffer); } catch (Exception e) { log("12: " + e.toString()); } } break; case PACKET_TYPE_MILESTONE_BLOCKS_RESPONSE: { if (bootstrappingState < 0) { Block commonBlock = blocks.get(genesisBlock); int numberOfBlocks = inputBuffer.getShort(); while (numberOfBlocks-- > 0) { long blockId = inputBuffer.getLong(); Block block = blocks.get(blockId); if (block != null) { commonBlock = block; break; } } try { ByteBuffer outputBuffer = Peer.getOutputBuffer(8, PACKET_TYPE_NEXT_BLOCK_IDS_REQUEST); lastCommonBlock = commonBlock.getId(); outputBuffer.putLong(lastCommonBlock); send(outputBuffer); } catch (Exception e) { log("13: " + e.toString()); } } } break; case PACKET_TYPE_NEXT_BLOCK_IDS_REQUEST: { try { LinkedList<Long> nextBlocks = new LinkedList<>(); Block block = blocks.get(inputBuffer.getLong()); while (block != null && nextBlocks.size() < 4093) { block = blocks.get(block.nextBlock); if (block != null) { nextBlocks.add(block.getId()); } } ByteBuffer outputBuffer = Peer.getOutputBuffer(2 + nextBlocks.size() * 8, PACKET_TYPE_NEXT_BLOCK_IDS_RESPONSE); outputBuffer.putShort((short)nextBlocks.size()); for (int i = 0; i < nextBlocks.size(); i++) { outputBuffer.putLong(nextBlocks.get(i)); } send(outputBuffer); } catch (Exception e) { log("14: " + e.toString()); } } break; case PACKET_TYPE_NEXT_BLOCK_IDS_RESPONSE: { if (bootstrappingState < 0) { int numberOfBlocks = inputBuffer.getShort(); if (numberOfBlocks == 0) { setBootstrappingState(1); break; } long blockId; while (numberOfBlocks-- > 0) { blockId = inputBuffer.getLong(); if (blocks.get(blockId) == null) { break; } lastCommonBlock = blockId; } if (numberOfBlocks < 0) { ByteBuffer outputBuffer = Peer.getOutputBuffer(8, PACKET_TYPE_NEXT_BLOCK_IDS_REQUEST); outputBuffer.putLong(lastCommonBlock); send(outputBuffer); } else { if (Block.getLastBlock().height - blocks.get(lastCommonBlock).height > 720) { setBootstrappingState(1); } else { while (lastBlock != lastCommonBlock && Block.popLastBlock()) { } if (lastBlock == lastCommonBlock) { ByteBuffer outputBuffer = Peer.getOutputBuffer(8, PACKET_TYPE_NEXT_BLOCKS_REQUEST); outputBuffer.putLong(lastBlock); send(outputBuffer); } else { setBootstrappingState(1); } } } } } break; case PACKET_TYPE_NEXT_BLOCKS_REQUEST: { LinkedList<Block> nextBlocks = new LinkedList<>(); int totalLength = 0; Block block = blocks.get(inputBuffer.getLong()); while (block != null) { block = blocks.get(block.nextBlock); if (block != null) { int length = 224 + block.payloadLength; if (totalLength + length > 32768 - (8 + 2)) { break; } nextBlocks.add(block); totalLength += length; } } ByteBuffer outputBuffer = Peer.getOutputBuffer(2 + totalLength, PACKET_TYPE_NEXT_BLOCKS_RESPONSE); outputBuffer.putShort((short)nextBlocks.size()); for (int i = 0; i < nextBlocks.size(); i++) { block = nextBlocks.get(i); outputBuffer.put(block.getBytes()); for (int j = 0; j < block.numberOfTransactions; j++) { outputBuffer.put(transactions.get(block.transactions[j]).getBytes()); } } send(outputBuffer); } break; case PACKET_TYPE_NEXT_BLOCKS_RESPONSE: { if (bootstrappingState < 0) { int numberOfBlocks = inputBuffer.getShort(); if (numberOfBlocks == 0) { setBootstrappingState(1); break; } while (numberOfBlocks-- > 0) { if (!Block.pushBlock(inputBuffer)) { break; } } ByteBuffer outputBuffer = Peer.getOutputBuffer(8, PACKET_TYPE_NEXT_BLOCKS_REQUEST); outputBuffer.putLong(lastBlock); send(outputBuffer); } } break; Title: Re: Nxt source code Post by: Come-from-Beyond on November 30, 2013, 07:44:51 AM I would like to review the peer connection code. Thanks Yesterday I found a problem related to peer connection implementation - https://bitcointalk.org/index.php?topic=345619.msg3771678#msg3771678 BCNext is working on fixing the issue. Updated code will be published later. Title: Re: Nxt source code Post by: arafel71 on November 30, 2013, 07:49:16 AM I see many question on forum about mining process, maybe you can post some part of this code if BCnext allow it. thanks Title: Re: Nxt source code Post by: inkadnb on December 01, 2013, 10:15:09 AM Where is the block and transaction verification done?
This is the part I'm most interested in. For example, I could, in theory have a few NXT coins, and simply by changing my clock ahead a several days, could I not in theory generate a new block? As per, Code: int elapsedTime = getEpochTime(System.currentTimeMillis()) - lastBlock.timestamp; if (elapsedTime > 0) { BigInteger target = BigInteger.valueOf(Block.getBaseTarget()).multiply(BigInteger.valueOf(account.getEffectiveBalance())).multiply(BigInteger.valueOf(elapsedTime)); if (hits.get(account).compareTo(target) < 0) { account.generateBlock(user.secretPhrase); } } you need at least one coin, but the entire value of the base target and balance is multiplied by the difference between the current time (in milliseconds) and the lastBlock. How is this enforced on other clients? How do they know that the time I'm generating is in fact valid? I realize there's time synchronization/rejection going on, but I'd like some clarification. Is the time verification done separately from transaction and block verification? Title: Re: Nxt source code Post by: Come-from-Beyond on December 01, 2013, 10:28:32 AM Where is the block and transaction verification done? Asked for that code. For example, I could, in theory have a few NXT coins, and simply by changing my clock ahead a several days, could I not in theory generate a new block? All blocks with timestamps in the future r ignored. Title: Re: Nxt source code Post by: inkadnb on December 01, 2013, 10:53:04 AM Where is the block and transaction verification done? Asked for that code. For example, I could, in theory have a few NXT coins, and simply by changing my clock ahead a several days, could I not in theory generate a new block? All blocks with timestamps in the future r ignored. Right, I was implying that you set the time ahead enough so that generateBlock() is called, however, once in this method, revert the time back so when Code: Block block = new Block(1, getEpochTime(System.currentTimeMillis()), lastBlock, newTransactions.size(), 0, 0, 0, null, Crypto.getPublicKey(secretPhrase), null, new byte[64]); This would be trivial to do in any modern debugger. Title: Re: Nxt source code Post by: Come-from-Beyond on December 01, 2013, 10:58:17 AM Right, I was implying that you set the time ahead enough so that generateBlock() is called, however, once in this method, revert the time back so when Code: Block block = new Block(1, getEpochTime(System.currentTimeMillis()), lastBlock, newTransactions.size(), 0, 0, 0, null, Crypto.getPublicKey(secretPhrase), null, new byte[64]); This would be trivial to do in any modern debugger. Such a block won't pass validation. Title: Re: Nxt source code Post by: SlyWax on December 02, 2013, 01:46:10 AM There is not a single comment in the code,
this is very bad for the future ... Title: Re: Nxt source code Post by: extortion on December 02, 2013, 04:11:26 AM non existent cryptocurrencies, because hey, why not?
Title: Re: Nxt source code Post by: Come-from-Beyond on December 02, 2013, 07:54:02 AM There is not a single comment in the code, this is very bad for the future ... Hardcore programmers don't bother with commenting. ;D Title: Re: Nxt source code Post by: klee on December 02, 2013, 08:44:41 AM There is not a single comment in the code, this is very bad for the future ... Hardcore programmers don't bother with commenting. ;D Title: Re: Nxt source code Post by: SlyWax on December 02, 2013, 01:42:28 PM There is not a single comment in the code, this is very bad for the future ... Hardcore programmers don't bother with commenting. ;D Only beginner think not commenting is hardcore programming. Sustainable software need comment, and open source one need even more ! Title: Re: Nxt source code Post by: Come-from-Beyond on December 02, 2013, 01:44:23 PM Only beginner think not commenting is hardcore programming. Sustainable software need comment, and open source one need even more ! Agree. That was just a sarcasm. Title: Re: Nxt source code Post by: SlyWax on December 02, 2013, 02:15:18 PM Only beginner think not commenting is hardcore programming. Sustainable software need comment, and open source one need even more ! Agree. That was just a sarcasm. Ok, sorry, wasn't sure :) Title: Re: Nxt source code Post by: techguy on December 03, 2013, 12:19:58 PM There is not a single comment in the code, this is very bad for the future ... All constant values are hardcoded. Its better to segregate them into a separate class (or) define them at class level. Title: Re: Nxt source code Post by: Come-from-Beyond on December 03, 2013, 12:57:13 PM There is not a single comment in the code, this is very bad for the future ... All constant values are hardcoded. Its better to segregate them into a separate class (or) define them at class level. R u talking about values like 1440, 720, 60? They r set in stone. Title: Re: Nxt source code Post by: inkadnb on December 03, 2013, 01:12:51 PM There is not a single comment in the code, this is very bad for the future ... All constant values are hardcoded. Its better to segregate them into a separate class (or) define them at class level. R u talking about values like 1440, 720, 60? They r set in stone. I think he meant more using enums or constants so they have more meaningful context. The number 1440 by itself doesn't really have any meaning but if it's labeled BLOCK_NUMBER or something it's easier to understand it's purpose. Title: Re: Nxt source code Post by: Come-from-Beyond on December 03, 2013, 01:19:34 PM I think he meant more using enums or constants so they have more meaningful context. The number 1440 by itself doesn't really have any meaning but if it's labeled BLOCK_NUMBER or something it's easier to understand it's purpose. Ah, I see. Title: Re: Nxt source code Post by: arafel71 on December 03, 2013, 09:16:19 PM hi cfb
that is the meaning of variables height ? is it : for the blockchain : the last block actually ''mining'' or compute for the whole blockchain and for a personal account : the number of block compute since the account unlocked for the first time ? By example : Nxt start on 24 november : Hypothesis : 1440 block compute per day Suppose we are now 28 november midnight and i unlocked my account for the first time on 27 november at 0 am after midnight: height of blockchain is 1440 * 4 days = 5760 (blocks since the start of nxt currency) height of my account is 1440 * 2 days = 2880 (block since the first unlocked of my account) I hope i'm clear .... thanks Title: Re: Nxt source code Post by: Come-from-Beyond on December 03, 2013, 09:19:13 PM hi cfb that is the meaning of variables height ? is it : for the blockchain : the last block actually ''mining'' or compute for the whole blockchain and for a personal account : the number of block compute since the account unlocked for the first time ? By example : Nxt start on 24 november : Hypothesis : 1440 block compute per day Suppose we are now 28 november midnight and i unlocked my account for the first time on 27 november at 0 am after midnight: height of blockchain is 1440 * 4 days = 5760 (blocks since the start of nxt currency) height of my account is 1440 * 2 days = 2880 (block since the first unlocked of my account) I hope i'm clear .... thanks Height = number of a block counting Genesis block as Height 0. Accounts have nothing to do with block height. Title: Re: Nxt source code Post by: PGPpfKkx on December 05, 2013, 03:21:02 PM Im a java dev (not too proficient , mainly php but java too).
im a little bit surprised about the choice to make a web application with localhost browser connectivity and not some desktop application. the java language i think its a good choice cause clients can go native in android too. Title: Re: Nxt source code Post by: lophie on December 06, 2013, 12:05:31 PM If possible I want to review address generation algo, I find the domain of 10^20 is way less secure than 34 char in Base58 encoding.... I started to think I can bruteforce wallets....
Title: Re: Nxt source code Post by: Come-from-Beyond on December 06, 2013, 12:17:19 PM If possible I want to review address generation algo, I find the domain of 10^20 is way less secure than 34 char in Base58 encoding.... I started to think I can bruteforce wallets.... https://bitcointalk.org/index.php?topic=345619.msg3759147#msg3759147 Title: Re: Nxt source code Post by: lophie on December 06, 2013, 02:32:43 PM If possible I want to review address generation algo, I find the domain of 10^20 is way less secure than 34 char in Base58 encoding.... I started to think I can bruteforce wallets.... https://bitcointalk.org/index.php?topic=345619.msg3759147#msg3759147 Cool, thnx Title: Re: Nxt source code Post by: FrictionlessCoin on December 24, 2013, 08:38:16 PM WTF?
It's a webapp with a bit of code that appears to manage the block chain. What is the P2P protocol used? What is on the payload? How are peers discovered? Are people actually investing real money on this prototype? Too many open questions. Well, lucky for the folks who invested 21 BTC to own all of the coin! Code like bitcoinj (written in java) doesn't even cover wallets and mining and its like 20 times bigger than the code we find here for NXT. Is this a complete joke? I don't see any specialized libraries for networking (i.e. Protobuf etc). Title: Re: Nxt source code Post by: Come-from-Beyond on December 24, 2013, 08:53:16 PM WTF? Hi It's a webapp with a bit of code that appears to manage the block chain. It's a Java servlet that runs in a servlet container What is the P2P protocol used? What is on the payload? JSON over HTTP with custom protocol. Set "communicationLoggingMask" to "7" in nxt/webapps/root/WEB-INF/web.xml to see all the payload. How are peers discovered? Each node has a set of well-known peers (listed in web.xml and easily changed by a user). Upon a launch a node connects to these peers and gets other peers via "getPeers" request. Are people actually investing real money on this prototype? Yes, but this is not a prototype. Too many open questions. Feel free to ask all of them. Well, lucky for the folks who invested 21 BTC to own all of the coin! This is impossible to launch a secure 100% PoS currency without distribution of all coins at once. Code like bitcoinj (written in java) doesn't even cover wallets and mining and its like 20 times bigger than the code we find here for NXT. Coz bitcoinj is an application, in Nxt most of the work is done by the container (Jetty) Is this a complete joke? No. This is an innovative cryptoplatform where payment transactions is just 1% of all the features. I don't see any specialized libraries for networking (i.e. Protobuf etc). Coz most of the work is done by the container (Jetty) and Java Virtual Machine. Title: Re: Nxt source code Post by: FrictionlessCoin on December 24, 2013, 09:01:07 PM WTF? Hi It's a webapp with a bit of code that appears to manage the block chain. It's a Java servlet that runs in a servlet container What is the P2P protocol used? What is on the payload? JSON over HTTP with custom protocol. Set "communicationLoggingMask" to "7" in nxt/webapps/root/WEB-INF/web.xml to see all the payload. How are peers discovered? Each node has a set of well-known peers (listed in web.xml and easily changed by a user). Upon a launch a node connects to these peers and gets other peers via "getPeers" request. Are people actually investing real money on this prototype? Yes, but this is not a prototype. Too many open questions. Feel free to ask all of them. Well, lucky for the folks who invested 21 BTC to own all of the coin! This is impossible to launch a secure 100% PoS currency without distribution of all coins at once. Code like bitcoinj (written in java) doesn't even cover wallets and mining and its like 20 times bigger than the code we find here for NXT. Coz bitcoinj is an application, in Nxt most of the work is done by the container (Jetty) Is this a complete joke? No. This is an innovative cryptoplatform where payment transactions is just 1% of all the features. I don't see any specialized libraries for networking (i.e. Protobuf etc). Coz most of the work is done by the container (Jetty) and Java Virtual Machine. So it actually is a centralized currency? What is the distributed consensus mechanism? What prevents attack? I mean, anyone can implement similar by grabbing a open transaction server and issuing 100 million coins. Oh well!!! Suckers born every minute. Title: Re: Nxt source code Post by: klee on December 24, 2013, 09:08:06 PM WTF? Hi It's a webapp with a bit of code that appears to manage the block chain. It's a Java servlet that runs in a servlet container What is the P2P protocol used? What is on the payload? JSON over HTTP with custom protocol. Set "communicationLoggingMask" to "7" in nxt/webapps/root/WEB-INF/web.xml to see all the payload. How are peers discovered? Each node has a set of well-known peers (listed in web.xml and easily changed by a user). Upon a launch a node connects to these peers and gets other peers via "getPeers" request. Are people actually investing real money on this prototype? Yes, but this is not a prototype. Too many open questions. Feel free to ask all of them. Well, lucky for the folks who invested 21 BTC to own all of the coin! This is impossible to launch a secure 100% PoS currency without distribution of all coins at once. Code like bitcoinj (written in java) doesn't even cover wallets and mining and its like 20 times bigger than the code we find here for NXT. Coz bitcoinj is an application, in Nxt most of the work is done by the container (Jetty) Is this a complete joke? No. This is an innovative cryptoplatform where payment transactions is just 1% of all the features. I don't see any specialized libraries for networking (i.e. Protobuf etc). Coz most of the work is done by the container (Jetty) and Java Virtual Machine. So it actually is a centralized currency? What is the distributed consensus mechanism? What prevents attack? I mean, anyone can implement similar by grabbing a open transaction server and issuing 100 million coins. Oh well!!! Suckers born every minute. Ignore <- Ignore + 1 Title: Re: Nxt source code Post by: Come-from-Beyond on December 24, 2013, 09:34:09 PM So it actually is a centralized currency? No. It's decentralized cryptoplatform where currency is only 1% of its features. What is the distributed consensus mechanism? What prevents attack? The same as in Bitcoin. Replace coins with ASICs and think of Bitcoin. I mean, anyone can implement similar by grabbing a open transaction server and issuing 100 million coins. I think u r wrong. Oh well!!! ... Suckers born every minute. Thank u for ur competent opinion. |