Bitcoin Core is the only software that saves the blocks in the blk*.dat format. This format is not standardized and internal (i.e. not exposed to users). The contents of, for example, blk2342.dat can differ between multiple instances of Bitcoin Core.
The only option is to run Bitcoin Core yourself, or to find somebody who runs Bitcoin Core and can provide ...
While I'm not sure of the technical requirements or limitations you have around building you platform. It sounds to me like your best option is simply running your own Bitcoin node itself. There are lots of online examples that could help you get started. I found bitcoin.org's guides particularly useful:
No sane application should EVER attempt to validate a private key by attempting to pass it to an external API. That's a ridiculously easy way to lose all your funds if the API operator is malicious, compromised, or someone is eavesdropping on your communication with said API.
You should do this yourself, preferably using a well tested, community supported, ...
Based on the address the binance gave you, after they sweep the funds into their hotwallet, you can run common-input heuristic on this deposit address (assuming it was swept in with other inputs). The more addresses and sweeps, the better the accuracy and amount of addresses in the final (result) set.
script.py of the Bitcoin Core functional test framework contains a comment that it was initially modified from python-bitcoinlib.
There doesn't appear to have been any code sharing beyond that and certainly not any later changes pushed up/downstream.
I asked Kanzure (previous maintainer of python-bitcoinlib) on IRC about it and he said:
python-bitcoinlib is ...
The data in blk.dat files is stored in binary, and each new block gets appended to the end of the file. Blocks are not downloaded in order always.
So you can write python code to read files, convert to hex, check if it has one of the blocks mined between 446032- 473593 and save the required information.
I would ...
The base58.b58decode and base58.b58encode functions only do the Base 58 decode/encode. However xpubs are encoded with Base 58 Check encoding. The difference is that Base 58 Check encoding computes a checksum of the payload and appends the first 4 bytes of that to the payload before the base 58 encoding.
You need to be using base58.b58decode_check and base58....
As @hamita pointed out you need to set server=1 in your bitcoin.conf file then you can use python-bitcoinrpc library to communicate with your bitcoin node.
Here's a short script to get all transactions of an address:
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from pprint import pprint
# rpc_user and rpc_password are set in the ...
I had named my script bitcoinrpc.py and had the import bitcoinrpc. Naturally it couldn't find the package. Renamed the script and it works.
Lesson: DO NOT have a file of the same name as the package you are trying to import.
I think this video will explain it in details (python):
Using the code from video, pip packages ecdsa , hashlib and base58:
# WIF to private key by https://en.bitcoin.it/wiki/Wallet_import_format
Private_key = base58.b58decode_check("5JYJWrRd7sbqEzL9KR9dYTGrxyLqZEhPtnCtcvhC5t8ZvWgS9iC")...
Note: WIF is a format for private keys, not addresses. There are multiple address formats, but the most common is P2PKH (hash of a public key).
I recommend looking that the code for Electrum to learn about how to work with public keys and addresses in Python, (check out bitcoin.py). It contains everything you need and is reliable code used by many ...
As chytrik said, a better way of generating new addresses on a remote server would be to export an extended public key (xpub) from your wallet and put only the xpub online. Then your private key material would remain offline, and you could generate new child addresses from the xpub using BIP32.
If you still want to execute getnewaddress on your node, you ...
For one, there is no JSON block format - different APIs have different ways of interpreting and displaying a block in a JSON response, and none of them will ever match the block size.
Your mistake appears to be saving the actual hex block as text.
1996396 = 2 * 998198
You must write the data as an actual binary file. i.e., write 12 as the byte 0x12, ...
Some usage examples are now available in the repository.
This example demonstrates how to generate a key pair, and create a transaction paying to the public key hash (P2WPKH).
There is also the legacy version (P2PKH).
This example demonstrates how to use more complex Bitcoin Script with P2WSH.
There is also the legacy version (P2SH).