Talk:How block generation works

From Nxt Wiki
Jump to: navigation, search

How detailed do we want this wiki page to be? Should it target developers only or be more for a lay audience?

The following are from the released source at https://bitbucket.org/JeanLucPicard/nxt-public/src/4073c21098076d3469b3f74d49e73ffabe3a2001/Nxt.java?at=master

1 Transactions

static class Transaction implements Comparable<Transaction>, Serializable {
		
	static final long serialVersionUID = 0;
		
	static final byte TYPE_PAYMENT = 0;
		
	static final byte SUBTYPE_PAYMENT_ORDINARY_PAYMENT = 0;
		
	byte type, subtype;
	int timestamp;
	short deadline;
	byte[] senderPublicKey;
	long recipient;
	int amount, fee;
	long referencedTransaction;
	byte[] signature;
	Attachment attachment;
		
	int index;
	long block;
	int height;

2 Blocks

static class Block implements Serializable {
		
	static final long serialVersionUID = 0;
		
	int version;
	int timestamp;
	long previousBlock;
	int numberOfTransactions;
	int totalAmount, totalFee;
	int payloadLength;
	byte[] payloadHash;
	byte[] generatorPublicKey;
	byte[] generationSignature;
	byte[] blockSignature;
		
	int index;
	long[] transactions;
	long baseTarget;
	int height;
	long nextBlock;
	BigInteger cumulativeDifficulty;
	long prevBlockPtr;

-- Xyzzyx (talk) 23:06, 18 February 2014 (MST)