a16z: Crypto Applications
3
This means machines
can now hold & send
money.
A program can now have custody of
funds so long as it has possession of
private keys.
The internet allowed programs to
autonomously communicate.
Blockchain allows them to
autonomously transact. A fundamental
prerequisite for intelligent agents.
Ⓒ2020 Andreessen Horowitz. All rights reserved worldwide.
Sending a transaction: tx
I sent the transaction into the peer-to-peer network with the stripped-down Python script below. The script sends a version message, receives (and
ignores) the peer's version and verack messages, and then sends the transaction as a tx message. The hex string is the transaction that I created
earlier.
2
def getTxMsg (payload):
return makeMessage (magic, 'tx', payload)
3
4
sock = socket.socket (socket.AF_INET, socket. SOCK_STREAM)
5 sock.connect(("97.88.151.164", 8333))
6
7 sock.send(msgUtils.getVersionMsg())
8 sock. recv (1000) # receive version
9
sock. recv (1000) # receive verack
10
sock. send (msgUtils.getTxMsg("0100000001484d40d45b9ea0d652fca8258ab7caa42541eb52975857f96fb50cd732c8b481000000008a47304402202cb265bf1070
11
minimalSendTxn.py hosted with by GitHub
view raw
a16zView entire presentation