Plan the carrotcoin launch

This commit is contained in:
2024-03-16 15:56:52 +01:00
parent 53e659fc9d
commit 9204f87c56
2 changed files with 10 additions and 3 deletions

View File

@@ -68,8 +68,13 @@ class Block:
return False return False
if not self.transaction.is_valid_after_block(prev_block): if not self.transaction.is_valid_after_block(prev_block):
return False return False
elif self.transaction is not None: else:
return False if self.transaction is not None:
return False
# check for the correct miner pubkey - which will become public at launch day
h = hashlib.sha256(self.miner_pubkey).hexdigest()
if h != "88023d392db35f2d3936abd0532003ae0a38b4d35e4d123a0fa28c568c7e3e2f":
return False
B_1_difficulty_sum, B_1_timestamp = self.get_difficulty_info(1, blockchain) B_1_difficulty_sum, B_1_timestamp = self.get_difficulty_info(1, blockchain)
B_10_difficulty_sum, B_10_timestamp = self.get_difficulty_info(10, blockchain) B_10_difficulty_sum, B_10_timestamp = self.get_difficulty_info(10, blockchain)
D = B_1_difficulty_sum - B_10_difficulty_sum D = B_1_difficulty_sum - B_10_difficulty_sum

View File

@@ -6,7 +6,7 @@ The carrotcoin cryptocurrency is a bitcoin-like currency with proof-of-work, cre
The network should stabilize at around 1 block every 5 minutes. The network should stabilize at around 1 block every 5 minutes.
Blocks are hashed with SHA256 and need to start with a certain number of zeros (or, more precise, be below a given value depending on the difficulty) Blocks are hashed with SHA256 and this hash needs to start with a certain number of zeros (or, more precise, be below a given value depending on the difficulty)
ed25519 keys are used to validate transactions. ed25519 keys are used to validate transactions.
@@ -100,6 +100,8 @@ A transaction that is stored in a block must fulfill the following criteria (in
A block is valid if all of the following criteria are fulfilled: A block is valid if all of the following criteria are fulfilled:
- The "previous hash" field contains a SHA256 hash value of a previous valid block. (Or is completely filled with nullbytes, in case of the first block.) - The "previous hash" field contains a SHA256 hash value of a previous valid block. (Or is completely filled with nullbytes, in case of the first block.)
- The first block has a public key with the following SHA256 hash value:
88023d392db35f2d3936abd0532003ae0a38b4d35e4d123a0fa28c568c7e3e2f
- The "timestamp" field is greater than the timestamp of the previous block (if there is any). Equal timestamps are not allowed. - The "timestamp" field is greater than the timestamp of the previous block (if there is any). Equal timestamps are not allowed.
- The "timestamp" field is less than or equal to the current time. This needs to be decided by each node based on the local clock. - The "timestamp" field is less than or equal to the current time. This needs to be decided by each node based on the local clock.
- The "difficulty sum" must be precisely calculated, as specified in `calculating difficulty` - The "difficulty sum" must be precisely calculated, as specified in `calculating difficulty`