stake static method
A blockchain stake refers to the amount of cryptocurrency a person holds and is willing to pledge as collateral in order to participate in the consensus process of a specific blockchain network. The term is most commonly used in the context of proof-of-stake (PoS) blockchain systems, where individuals can stake their coins to validate transactions and secure the network, rather than using computer power to solve complex mathematical puzzles (as in proof-of-work systems). The more coins a person stakes, the greater their chances of being selected to validate a block of transactions and earn a reward.
Implementation
static InternalTransactionBean stake(String from, String to, BigInt greenValue, message, DateTime notBefore) {
final BigInt minimumStake = BigInt.from(200)*BigInt.from(10).pow(9);
if(greenValue < minimumStake){
throw Exception("The minimum stake fee is 200 TKG");
}else {
InternalTransactionBean result = common(TransactionType.STAKE, notBefore);
result.from = from;
result.to = to;
result.greenValue = greenValue;
result.message = message;
result.transactionHash =
StringUtilities.internalTransactionBeanHash(result);
return result;
}
}