A crypto wallet is created using python in the file: wallet.py and Jupyter notebook version of wallet.py.
Get BTC testcoins and transaction details on Bitcoin Testnet
Transaction Confirmation on BTC testcoin
Ethereum Transaction Confirmation on Running Python in a Terminal Window Interactively
To run wallet.py:
- Open a terminal window on the wallet folder
code .
- Access functions in wallet.py interactively, run on the terminal window:
from wallet import *
- Run the
priv_key_to_account
function to connect to account information via Web3 on localhost:8545
- Create and send transactions via
create_tx
andsend_tx
functions
Transaction View on Python Notebook
-
Outputs produced by wallet.py in the terminal include:
- Private keys and addresses for BTCTEST and ETH coins
- transaction details on
create_tx(BTCTEST, btc_0, btc_1.address, 0.0001)
in a dictionary
Terminal View of details on Accounts and BTCTEST coin transactions
"txid":"d742d8a9c7fe5b8afc5f2a1c862568bb511a61760eb03175f422c0b096722bf2"
First Attempt:
Need to set up local testnet using ./puppeth
and ./geth
- Derived information on the first couple of ethereum accounts
- key for first ethereum account to send coins,
eth_0
- address for the second ethereum account to receive coins,
eth_1.address
- key for first ethereum account to send coins,
>>> # Initiate a transaction of 0.01 ethereum on testnet
>>> create_tx(ETH, eth_0, eth_1.address, 0.01)
Second Attempt:
>>> create_tx(ETH, '0xf0a03ce2448ac74a409a0d0f837fb993774e1aa700906d854cefd0e3150ff35e', '0xBf2CEa365Fa098bBABDd11b0ecbD9462595612e5', 0.01)
Third Attempt:
>>> create_tx(ETH, priv_key_to_account(ETH,'0xf0a03ce2448ac74a409a0d0f837fb993774e1aa700906d854cefd0e3150ff35e'), priv_key_to_account(ETH,'0x202bcf2d6ee314ca4593a0edc6f39d19a27c2d4b503c26c3d1637d2338de014c').address, 0.01)
Note: Error messages on all three attempts.
Previously, it was in trouble-shooting stage. A bitcoin transaction is generated via this "get_balance" notebook file.
Screenshots of the transaction confirmation is provided here:
BTCTEST transaction confirmation
For crypto transaction on localhost http://127.0.0.1:8545
Ethereum transaction confirmation
Mining is initiated on ethereum proof-of-authority testnet called txs
. It is placed under zbank node in MyCrypto Wallet. Please see details below.
In Mac Terminal
- Create a wallet by
mkdir wallet
touch wallet.py
to generate a python file for crypto transaction functions- Install
hd-wallet-derive
by typing
ln -s hd-wallet-derive/hd-wallet-derive.php
- Set up environment requirements in a file by
touch requirements.txt
- Set up constants.py file for
BTCTEST
,ETH
andBTC
by typing
nano constants.py
-
Trouble shooting on ethereum transactions
-
Add support for
BTC
. -
Add support for
LTC
using the sister library,lit
. -
Add a function to track transaction status by
txid
.
- CU Gitlab Repository
- https://github.com/rhahn28/cryptowallet
- https://web3py.readthedocs.io/en/latest/overview.html#Web3.toHex
- https://web3py.readthedocs.io/en/latest/web3.eth.account.html#web3.account.Account.signTransaction
- https://live.blockcypher.com/btc-testnet
- https://github.com/blockterms/lit
- https://coinfaucet.eu/en/btc-testnet/
- https://iancoleman.io/bip39/#english
- https://tbtc.bitaps.com
- https://faucet.ropsten.be/
- https://tbtc.bitaps.com/
- https://web3js.readthedocs.io/en/v1.2.0/web3-utils.html#sha3
- https://ethereum.stackexchange.com/questions/23058/how-to-convert-string-to-bytes32-in-web3js