Team members: @Picha, @Thang Long VU @Mamoune Mouchtaki @Timothe
This team's objective will be to establish what the actual currency's operating model will actually be. How will people obtain a coin? Will there be an initial offering? How do people spend it? Then, the second part will consist in coding up the methods required to exchange coins.
(to do)
Transactions consist of two components: inputs and outputs. Outputs specify where the coins are sent and inputs give a proof that the coins that are actually sent exists in the first place and are owned by the “sender”. Inputs always refer to an existing (unspent) output.
Transaction outputs (txOut) consists of an address and an amount of coins. The address is an ECDSA public-key. This means that the user having the private-key of the referenced public-key (=address) will be able to access the coins.
class TxOut {
public address: string;
public amount: number;
constructor(address: string, amount: number) {
this.address = address;
this.amount = amount;
}
}
Transaction inputs (txIn) provide the information “where” the coins are coming from. Each txIn refer to an earlier output, from which the coins are ‘unlocked’, with the signature. These unlocked coins are now ‘available’ for the txOuts. The signature gives proof that only the user, that has the private-key of the referred public-key ( =address) could have created the transaction.
class TxIn {
public txOutId: string;
public txOutIndex: number;
public signature: string;
}
It should be noted that the txIn contains only the signature (created by the private-key), never the private-key itself. The blockchain contains public-keys and signatures, never private-keys.
As a conclusion, it can also be thought that the txIns unlock the coins and the txOuts ‘relock’ the coins:
For a complete breakdown, read https://naivecoinstake.learn.uno/03-Transactions/