How to get private key and Bitcoin address in pure Python – without modules?

How to make a pure Python code for Bitcoin address and private key without modules? For now I learn only how from decimal to get a hex. How from hex to private key WIF and than Bitcoin address? bits = 115792089237316195423570985008687907852837564279074904382605163141518111494336 bits_hex = hex(bits) private_key = bits_hex[2:] print(private_key) With this code I get this fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8ccd3b50c0…

Order of transactions in the same block

I am writing a Medium blog post about front-running and can’t seem to find information about the order of the transactions in the same block. I have executed two trades, one with the lower fee, call it A: https://etherscan.io/tx/0x7332ec032bcd421e8137a623c542f38448bd7860b4b310acf4aef940dae85778, and one with the higher gasPrice and the same amount of gas, B: https://etherscan.io/tx/0x422d289768ce4fd6a7acf15dad9326ac80aaf0dcda696c306da69d5e83bfeb9b. They were…

Gas required exceedes allowance when invoking a pure function

So, I got a problem when interacting with a smart contract in geth. I have this very simple contract: pragma solidity^0.6.1; contract Simple{ uint256 public number = 1; constructor() public { } function setNumber(uint256 another) public { number = another; } function getNumber() public view returns (uint256){ return number; } function add(uint256 x, uint256 y)…

Unable to render inside (callback function) using react for web3.eth.subscribe

import React from ‘react’; import ReactDOM from ‘react-dom’; import Web3 from ‘web3’; class App extends React.Component { componentWillMount() { this.loadBlockchainData() } async loadBlockchainData() { var web3 = new Web3(Web3.givenProvider || ‘http://127.0.0.1:7545’) var network = await web3.eth.net.getNetworkType() var accounts = await web3.eth.getAccounts() var balances = await web3.eth.getBalance(accounts[0]) var block = await web3.eth.getBlockNumber() var blockHash = await…

Unable to render inside (callback function) using react for web3.eth.subscribe

import React from ‘react’; import ReactDOM from ‘react-dom’; import Web3 from ‘web3’; class App extends React.Component { componentWillMount() { this.loadBlockchainData() } async loadBlockchainData() { var web3 = new Web3(Web3.givenProvider || ‘http://127.0.0.1:7545’) var network = await web3.eth.net.getNetworkType() var accounts = await web3.eth.getAccounts() var balances = await web3.eth.getBalance(accounts[0]) var block = await web3.eth.getBlockNumber() var blockHash = await…