Simulating the first Bitcoin transaction
class BitcoinTransaction:
def init(self, sender, recipient, amount):
self.sender = sender
self.recipient = recipient
self.amount = amount
def __str__(self):
return f"{self.sender} sent {self.amount} BTC to {self.recipient}"
Create a transaction
satoshi = "Satoshi Nakamoto"
hal = "Hal Finney"
btc_amount = 10
first_transaction = BitcoinTransaction(sender=satoshi, recipient=hal, amount=btc_amount)
Display [...]
Python by patoshi in Bitcoin
[–]patoshi[S] 0 points1 point2 points · (0 children)