Figured out the reward scheme

This commit is contained in:
2026-04-01 11:56:09 +02:00
parent 075793c24c
commit 06e6f02b86
6 changed files with 172 additions and 56 deletions

View File

@@ -20,26 +20,25 @@ static inline bool Address_IsCoinbase(const uint8_t address[32]) {
return true;
}
// 178 bytes total for v1
// 160 bytes total for v1
typedef struct {
uint8_t version;
uint64_t fee; // Rewarded to the miner; can be zero, but the miner may choose to ignore transactions with very low fees
uint64_t amount1;
uint64_t amount2;
// Only one "input" sender address
uint8_t senderAddress[32];
// The "main" recepient address and amount. This is the only required output, and is used for calculating the transaction hash and signature.
uint8_t recipientAddress1[32];
uint64_t amount1;
// The "extra" recepient address and amount. This can safely be NULL/0 if not used and has multiple uses:
// - Sending zero: parital spend, sender keeps coins on the same address
// - Sending to a different address: normal spend, sender's coins move to a new address, e.g. change address
// - Private Transactions: Can nullify the whole original stealth address input (sender) and send change to a new stealth address (recipient 2) to obfuscate the transaction graph.
// Note that coinbase will have this as NULL/0 (for now, but we could have multiple payouts in the future)
uint8_t recipientAddress2[32];
uint64_t amount2;
uint64_t fee; // Rewarded to the miner; can be zero, but the miner may choose to ignore transactions with very low fees
uint8_t compressedPublicKey[33];
// Timestamp is dictated by the block
uint8_t compressedPublicKey[33];
uint8_t version;
uint8_t reserved[6]; // 6 bytes (Explicit padding for 8-byte alignment)
} transaction_t;
typedef struct {