text:
How is the Bitcoin Public Ledger stored?
I'm trying to create a functional replica of the Bitcoin protocol, albeit at a smaller scale, for an academic project. As far as I'm aware, the Bitcoin Public Ledger is a list of all BTC transactions ever made. But how is it stored?
How is the ledger stored on every node?
Is this the ledger?
Where is the data stored in Bitcoin?
After reading these 3 posts, what I understand is that every node (with a few exceptions) stores the entire transaction history, and the way the protocol works ensures that it is very difficult and impractical to introduce fake transactions into the blockchain.
However, if, somehow, there are 2 nodes whose ledgers have conflicting transaction histories, how is it decided on which version all the users must go by? (Because according to this answer, there is no official/centralised copy of the ledger, and all copies are equally valid.)

if, somehow, there are 2 nodes whose ledgers have conflicting transaction histories, how is it decided on which version all the users must go by?

Each node decides for itself. Each node makes these sorts of decisions independently. No node trusts any other node to make these decisions for it.
Each node independently examines all the data in all the alternative chains it creates as it receives data, including conflicting data. Each node independently calculates the amount of "work" represented by each chain and selects the chain with the highest amount of work as its active chain. This decision is re-examined every time the node receives data that alters the amount of work represented in any of the chains it knows about.
Because all Bitcoin nodes follow the same rules for this, they all independently select the same chain. They naturally achieve consensus without any explicit collaboration, voting or central direction.
Most chains have a common ancestry and only the last block or so vary. This means that keeping track of multiple chains can be done relatively efficiently without duplicating the common portion.
The measure named "Work" is based on an estimate of the average number of hashing attempts that would be needed to find an arrangement of data that produces a block with a hash less than the target applicable at the relevant block height.

Footnote on terminology
Although many people describe the Bitcoin blockchain as a ledger, that is misleading. Accounting ledgers have accounts and balances. The Bitcoin blockchain is a simple transaction journal not a ledger. It contains no accounts and no explicit balances.

Questions with relevant information in answers

Why is number of downloaded block files far fewer than current block height?


text:
How do HD wallets store the keys and addresses?
As far as I'm aware, the recovery code is presented to the user once and then not stored at all by the wallet, in which case, it has to store at least the master private key, and would also probably store all the addresses (as it would be inefficient to regenerate them each time they are needed)
How exactly is all this stored?
From here, I see that all addresses are identified using a path naming convention.
Does that mean that all the paths are stored, and in a scenario where an address needs to be reused, it is regenerated each time?

This question is similar to: How are derivation paths stored and regenerated for HD wallets?. If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.

1. Storage of Keys, Addresses etc

How exactly is all this stored?

In General
Any way that the developers of a particular wallet want. It is likely that different wallets store their data differently.

In Bitcoin core, for example.
The wallet software named "Bitcoin core" will store the private keys in the wallet.dat file in the specified or default data directory. The default is %APPDATA%/Bitcoin/ or ~/.bitcoin/ depending on platform. If a wallet password is provided, the key data is stored in encrypted form with the password being the encryption key (possibly indirectly and probably using AES IIRC).
The addresses generated are stored in the same file but need not be encrypted.
I don't know if the full derivation paths are explicitly stored.  I imagine that at least the least significant digits ought to be stored along with each derived address. Maybe someone can comment.
BDB vs SQLite wallets
The overall organisation of this file has changed and is based on simple key-value database libraries, initially Berkeley-DB (BDB) and more recently SQLite AFAIK.
Descriptor vs non-Descriptor wallets
The keys and values have changed from the original form to a "descriptor" form. So there are non-descriptor wallets and descriptor wallets.
HD vs non-HD wallets
There was also a change to Hierarchical Deterministic (HD) wallets from the original non-HD wallet.

2. Derivation Paths

I see that all addresses are identified using a path naming convention. Does that mean that all the paths are stored, and in a scenario where an address needs to be reused, it is regenerated each time?

Those are implementation details. I don't know how Bitcoin core or other wallets handle this and I believe anyone writing a wallet should make their own decisions.
If writing a wallet app, I would probably explicitly store all generated addresses and paths. Some other people would do something very different.

3. Further reading:

What information does a wallet contain?
View backed up wallet.dat using sqlite browser
What do the different .dat files contain?

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Is mempool.space Legit or scam
I've been contacted by mempool.space telling me I have a dormant account in their system with 0.91btc and how to reactivate it. They want me to open a crypto wallet such as Coinbase, Binance to transfer the BTC.
My problem is I don't know anything about this account and can't find contact details to varify this company, is it a scam?

This is highly suspicious and very likely a scam. Reputable services like mempool.space do not reach out to individuals about dormant accounts. Do Not Engage.

So to be clear: mempool.space itself appears legitimate, but you were almost certainly not contacted by the real mempool.space.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
SCAMMED and LOST 5000 DOGE COIN! Please HELP!
I was scammed, all my DOGE was taken. I had a stuck pending transaction, I reached out to trust wallet support, they cancelled the pending and then sent the DOGE to a DIFFERENT ADDRESS and not my DOGE address. Is there anything I can do? Its confirmed, but unspent.  Can I track it down somehow or ask for it back? or cancel the sent?

This is a Bitcoin Q&A website so Doge is off-topic. It sounds like you were tricked by an imposter. I expect there is no way to get your money back.


text:
I bought bitcoin years ago and now the website that I bought from is unavailable!
I bought bitcoin years ago and now the website that I bought from is unavailable!
I only have a key that I don't even know whether it's a public key or a private key or some useless key generated by the website. Plus I'm not sure that the website bought actual bitcoin or other cryptos for me.
How can I know if I have it on the blockchain?

Do not post the actual key here! But can you describe what it looks like? Eg how long is it, what characters does it contain, and what character does it start with? That’ll help determine what sort of key it is. If it isn’t a private key, then your bitcoins are likely gone (and perhaps, were never yours in the first place)

Sure, It has 34 characters and starts with A, it has many different letters (both uppercase and lowercase) and 4 numbers(all lower than 10).

That doesn't sound to me like a 12 word phrase and so you might be out of luck without having your 12 secret words.

You can try to import the wallet using the key you have (assuming it is a private key) through wallet software such as bluewallet.io, which supports importing of wallets via private keys.
Otherwise, if that key is not your private key, you are a little screwed, sorry.


text:
Why exchanges show Bitcoin price higher than actual value?
I trade crypto on indian platform WazirX and CoinSwitch. Both are currently showing price of 1 Bitcoin to be 44,78,353 Indian Rupees ($ 60,605.51) while the price shown on google as well as Binance right now is only 41,37,198.19 Indian Rupees ($ 56,000.78) . Same for other crypto. Could someone please explain this huge difference in pricing, I would really appreciate it ?

to always remain profitable and also to charge fees.


text:
aftet sending btc with bitcoin core can i exit after wards?
I have bitcoin core installed on windows with full node running.
If I send bitcoin do I need to wait its confirmation before exiting bitcoin core ? can I exit in seconds afterward will it be confirmed ?

Once successfully broadcast, your transaction will be entered into the mempools of other nodes on the network, and it will eventually be confirmed in a block when it's fee-rate becomes competitive. This will occur whether or not you keep your wallet/node online in the meantime. So once your transaction is broadcast to the network you can exit the program without any issue.

Thank you for reply. how long broadcasting transaction takes ? and how can i confirm it ?

confirm that it was broadcasted how can i check.


text:
How transaction happen in blockchain?
Suppose there is a cryptocurrency with a chain of 5 blocks. When users trading with this cryptocurrency, then:-
how the buy and sell will be going to happen i.e. Which block will make the transaction happen and is there an automated process for it?
How many transactions each block can do? Is there some rule for it?
I'm very new to blockchain, please help me out on this. If you need more clarification on the question then please comment it out. Thanks

Does this answer your question? I am new to Bitcoin, how can I get started?

Thanks chytrik for your comment. But unfortunately it's not the answer. To clarify the question further, suppose you purchase a one Bitcoin on any platform(in Exchange of money) . So when to buy that what are the process happens internally ?

how the buy and sell will be going to happen

The canonical process for buying Bitcoin with a different currency is

The buyer uses their Bitcoin wallet to create a receiving address.
The buyer communicates this address to the seller.
For example the buyer's wallet creates a QR-code (2d barcode) from the
address and the seller scans the barcode.
The seller uses their wallet to create a draft Bitcoin transaction that
sends an
amount of Bitcoin using unspent coins from their wallet to the Bitcoin-address
provided by the buyer. This involves a cryptographic signature made by the
seller that proves they have the right to spend those coins. It also locks the
output amount with a Bitcoin script that similarly requires
the use of recipient's private-key to spend.
The seller's wallet transmits the draft transaction to a few nearby
Bitcoin nodes
(e.g. other wallets, etc)
Other nodes pass the draft transaction to other nodes.
Eventually the draft transaction reaches miners who each add it to their
pool of draft transactions.
Eventually one of the miners, adds that draft transaction to a block template,
usually along with a lot of other unrelated draft transactions
from their pool. The miner starts mining the block.
eventually a miner succeeds in mining a block that includes the
draft transaction.
The miner transmits the new block to nearby nodes
Other nodes see the block is valid (matches Bitcoin's rules) and pass it on
Eventually the buyer's wallet sees the new block,
adds it to their copy of the blockchain and
adds the value to the wallet's "balance".
Over time, other unrelated blocks are added to the blockchain.
each of these subsequent blocks counts as one confirmation of the
transaction. Six confirmations is generally taken as certain.
Some people choose to accept fewer confirmations as certain.

i.e. Which block will make the transaction happen

Any subsequent valid block which contains the transaction.

and is there an automated process for it?

The first three steps described above normally involve some human interaction (but can be automated using software APIs). The remaining steps are fully automatic.

Thankyou for your detailed answer. Does a new block gets added everytime when anyone makes a transaction? I mean there a lot of transaction going on in any Cryptocurrency platform(trading). And mining is really time consuming task as miners have to find a new hash everytime for proof of work so how they add block everytime?

@Thunder, there are typically a large number of transactions in a block. Sometimes there are none (other than the miner's one "coinbase" transaction which is how the miner gets paid).

Thanks for your comment.  For the sake of simplicity, assume I go to binance.com( A Cryptocurrency platform) and purchase a bitcoin in exchange of USD. So you meant to say my transaction will be put on pending until the miner( who will be making my transaction) add the block in the blockchain. If so, then how I get bitcoins instantly in those platforms?   And miner can take a year also to get the hash for proof of work, does it mean ny transaction will be hold for a year?

@Thunder: businesses like Binance internally trade IOUs, they don't actually trade Bitcoins using the bitcoin network unless you want to trade the IOU for real money (e.g. for real Bitcoin). They just disguise the IOU and pretend it's real money. An account is not a wallet (even if some businesses pretend it is). An account holds an IOU. Hence the saying: Not your keys, not your Bitcoin.

Thanks buddy. You just fixed my confusion of which I was striving to find the solution. Can you tell me some good resources for Cryptocurrency working? Having code as well about how to create own platform


text:
Understanding how initializing the Ledger Bitcoin hardware wallet works
One can find the Ledger Bitcoin source code here:
https://github.com/LedgerHQ/app-bitcoin
I am trying to understand how a Ledger app account is initialized or restored.
Can someone point me to another 'official' project, which is communicating with this Ledger firmware?
Wallets typically have user functionality to initialize or restore a wallet. I am interested in how this is mapped or delegated to the hardware device.
I am interested in the parts where APDU commands are sent to the device to initialize or restore the device.
Sorry if this question is vague, or contains factual errors.

Ledger provides a python library which also links to some limited documentation of the API: https://github.com/ledgerhq/btchip-python


text:
Trying to recover BTC after being in prison since it started
I had gotten BTC when it first started. I went to prison and lost everything. I did receive paperwork in the mail when I got them this is how long ago this was.
It wasn'tuch than but today this could changey life completely if I recover this.
Any help would be appreciated.
What do I do? Please lmk


text:
Wallet and network selection for bitcoin URI BIP21 payment invoked through QR Code
I'm building an application to generate a payment link to be provided as a QR code.
The encoded string is a Bitcoin URI scheme as defined in BIP21.
bitcoin:?amount=1
For me, this opens a default wallet to populate the transaction. I do not know how this default it calculated.
I'd like to give a user options. Maybe they have multiple wallets, maybe they want to use a testnet.
I can't find any documentation on how to allow for these things.
Are they possible?


text:
I have the backup wallet but I forgot the password or password
I have a friend who has a backup wallet of bitcoin core, but she has forgotten her password, the password you use to transfer bitcoins.

This question is similar to: Are there Bitcoin password crackers I can use to recover forgotten passwords?. If you believe it’s different, please [edit] the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem.  See also Who maintains btcrecover?


text:
How does a constant opcode become negative in Script
I am doing some tutorial and in this chapter we are suppose to reproduce the Script scripting language
I am struggling to understand one of the exercises, here it is:
Create a ScriptSig that can unlock this ScriptPubKey:
767695935687

and the answer is 0x52 so that :
>>> from script import Script
>>> script_pubkey = Script([0x76, 0x76, 0x95, 0x93, 0x56, 0x87])
>>> script_sig = Script([0x52])
>>> combined_script = script_sig + script_pubkey
>>> print(combined_script.evaluate(0))

and that OP_2 or 52 will satisfy the equation x² + x – 6 = 0.
I guess I get the whole part execution except when the OP_6 is pushed on the stack, how does it become negative ?

It doesn't. The script implements "x^2 + x = 6". The last opcode is OP_EQUAL. Of course, the script cannot work because it uses the disabled opcode OP_MUL.

I was not sure how it would work there but it is in fact basic arithmetic, we have this x^2 + x = 6 then we substract 6 from both sides x^2 + x - 6 = 6 - 6 then we simplify x^2 + x - 6 = 0


text:
Meaning of this part of the Bitcoin Ticker Display?
When looking at the Bitcoin Ticker site: https://bitcointicker.co/stamp/btc/usd/1hr/
I see the part of the screen pictured below.  I'm having trouble understanding what this is presenting.  Can someone please help me understand it?

That’s the market depth and it’s not related to bitcoin, any exchange of any asset provides this information. One way to interpret it is if someone sent a big market sell order of 22.542 BTC to this exchange, the price would drop to $52554.


text:
generating a zprv from a base58 rootKey with bitcoinjs-lib
var bitcoin = require('bitcoinjs-lib');
let bip32 = require('bip32');

let rootKey = 'xprv9s21ZrQH143K32CfqoCQHtbKiEb5BqFazXX6jCtNCnuty3gUjxS4CsXWi9rcNyHdjDVPiC6P1bnyEZr2ioouRq56h6HAdwejeTty1BsSEtL'
const node = bip32.fromBase58(rootKey, bitcoin.networks.bitcoin);

//legacy account extended private key
console.log("LEGACY: " + node.derivePath("m/44'/0'/0").toBase58())
//xprv9y7nL2k2diLdA9bmop94K8Pec2WdL998PLdvTraxj5jiQ36gnLmhVJG4bY8FzgqZPaBM5HDBi9sgRK1ZCi14n5j4Pk1o6d3j4Y6T9NS4nA6
(works as expected)

//segwit account extended private key
//trying to get a segwit extended private key (zprv) using the same inputs as above.

I want to get a segwit/bech32 extended private key using the same root key as above. How can I do this using bitcoinjs-lib? BIP84 only works for mnemonics IIRC.

Your xprv already has the derivation path "baked in" so even if you were to just convert to zprv it will still be under the old m44/ deriv path. Also you can't go from xprv to HD seed. So to change from an xprv to a zprv or yprv you need to start with the HD seed, then declare your derivePath("m84'/...","m49/'/... etc), then you can create an extended public key. Then you'll have to convert to yprv, zprv, ypub, etc...
Example uses bitcoinjs-lib v3.3.2
function seedToXpub(seed, deriv, account){
   var root = bitcoin.HDNode.fromSeedHex(seed);
   var acct = root.derivePath("m/"+deriv+"'/0'/"+account+"'");
   var xpub = acct.neutered().toBase58();
   return{
       xpub
   }
}

function seedToXprv(seed, deriv, account){
   var root = bitcoin.HDNode.fromSeedHex(seed);
   var acct = root.derivePath("m/"+deriv+"'/0'/"+account+"'");
   var xprv = acct.toBase58();
   return{
       xprv
   }
}

function convertXpub(xpub,target){
    //source script for converter https://github.com/jlopp/xpub-converter/blob/master/js/xpubConvert.js
    const prefixes = new Map(
  [
    ['xpub', '0488b21e'],
    ['ypub', '049d7cb2'],
    ['Ypub', '0295b43f'],
    ['zpub', '04b24746'],
    ['Zpub', '02aa7ed3'],
      ['xprv', '0488ade4'],
      ['yprv', '049d7878'],
      ['zprv', '04b2430c']
  ]
  );

  xpub = xpub.trim();

  try {
    var data = b58.decode(xpub);
    data = data.slice(4);
    data = Buffer.concat([Buffer.from(prefixes.get(target),'hex'), data]);
    return b58.encode(data);
  } catch (err) {
    return "Invalid extended public key! Please double check that you didn't accidentally paste extra data.";
  }
}

var mySeed = "114259550292e14ca462e5202875f987fa3c93300306417c8b62de591710e4b34340a9bcdf8241ebbe83cf3cdf428c2f32973c9db68e247ce623fd73b9bd1fb2";
var extPriv = seedToXprv(mySeed,84,0);
var zprv = convertXpub(extPriv,"zprv");

//zprvAcihK1ERNzUfX6zh3v8weMVw5s8Y2xkmjdEfeFF3v9X2jbDf9iJ4vS5t4Po6Jhwsjkzjz1TddTENc5dPVsVFyMZPzWz8Kskci6wkYSmuhup

If my xprv has the right derivation path baked in, how do I convert it to zprv?


text:
Using Javascript, I want to generate a segwit private key (zprv) similarly to how I am generating my legacy base58 extended private key. How?
let bip32 = require('bip32');
let bip39 = require('bip39');
let { bech32, bech32m } = require('bech32')

const seed = bip39.mnemonicToSeedSync('rural catch say tooth tell soul road pilot fee board goose wedding');
// ^randomly generated for this question

const node = bip32.fromSeed(seed, bitcoin.networks.testnet);

//legacy account extended private key
console.log("LEGACY: " + node.derivePath("m/44'/0/0").toBase58());
//tprv8giQNMeV5drQbXzAxSaVDj5Q1rAuTDZdGWoSx5oaLfuk9rupqVZXoziLgJSpkuauCToZw7BepygJjJaDBWKx5xQLimyg4KFtKnU2E7b99YH

//segwit account extended private key
//how do I take the same inputs, and get a segwit extended private key / zprv

This is how I'm getting my xprv, I'd like to also test out getting a zprv but I'm having trouble finding the documentation for this. I'm assuming it's going to be something using bech32.

Key derivation for P2WPKH using the zpub/zprv version bytes is defined in BIP 84. So you can use bip84 library.
let bip84 = require('bip84');

const root = new bip84.fromSeed('rural catch say tooth tell soul road pilot fee board goose wedding')
const child0 = root.deriveAccount(0) // m/84'/0'/0'
console.log(child0)
// zprvAce8anvk7mGXLFgryEKx2b8tETAKuJRFXM1SRN4wuZDw2cwzxYuJ9PJdecA9MJAuAuchhh3cfLfN3SSL8agTL3tJARw6TmgvAKVgcfVcANm

Thanks!
What if instead of a mnemonic, I had a base58 private key? I thought bip84.fromBase58 might work, but no luck.


text:
Deriving children of a 2-of-3 multisig address with 3 xpubs as the starting point
I want to derive the children of a HD Multisig address using each of the xpubs following BitGo specs,
currently, I have 3 xpubs and can get to the point where I can derive main address very similar to this test from bitcoinjs lib:
    const pubkeys = [ // b58 encoded xpubs
      '026477115981fe981a6918a6297d9803c4dc04f328f22041bedff886bbc2962e01',
      '02c96db2302d19b43d4c69368babace7854cc84eb9e061cde51cfa77ca4a22b8b9',
      '03c6103b3b83e4a24a0e33a4df246ef11772f9992663db0c35759a5e2ebf68d8e9',
    ].map(hex => Buffer.from(hex, 'hex'));
    const { address } = bitcoin.payments.p2sh({
      redeem: bitcoin.payments.p2ms({ m: 2, pubkeys }),
    });

    >>> '36NUkt6FWUi3LAWBqWRdDmdTWbt91Yvfu7'

My question is - if I wanted to derive children from a setup like this using CKD, how would I do that? Where do I get my HDNode to start deriving? I want to do address discovery to find all addresses where funds may live.

This question is more about the library you are using than Bitcoin or BIP32 itself.


text:
I have the phrase words but I donot know which words shall i insert to get my wallet back , what shall I do?
Trust wallet
I have my 12 phrase but I am not able to get my trust wallet back

I do not know what which word shall insert first

We're going to need some more information. What site/software? What are you trying to do? What have you tried so far?

the phrase has the words in the correct order already

You insert all of them in the order you wrote them down - assuming that is the same as the order they were shown to you by the wallet when you wrote them down.
See https://community.trustwallet.com/t/how-to-restore-a-multi-coin-wallet/43

Step 1 - Launch Trust Wallet
Open Trust Wallet and then tap on Settings.
Step 2 - Access Wallets
In the Settings screen, you will find here Wallets. Tap on it to display the wallets that you currently have. Tap on the “+” sign on the upper right to access the Import Screen.
Step 3 - Access Wallet Import Screen
Since we are trying to restore a wallet, select I already have a wallet. Then, tap on Multi-Coin Wallet.

If you don't want a multi-coin wallet it appears you can just select Bitcoin.

Step 4 - Input the Recovery Phrase
Almost done. Carefully type the recovery phrase, put in the name of the wallet. Tap on Import.


text:
How to transfer Bitcoin from CEX to a personal wallet without paying huge fees?
 I am new to the world of cryptocurrency, so I apologize in advance if my questions seem basic or silly.
Recently, I purchased approximately 0.02 BTC (Bitcoin) using my savings. However, I discovered that the CEX I used is overselling their services. They charge me a fee of 0.0005 BTC just to withdraw my funds to the Bitcoin network, and I find this fee to be too high for my preferences (for comprising, Binance charges a fifth of this amount for the same service). Unfortuantely, for geopolitical reasons, my choices are limited to not-very-good CEXs.
My primary goal is to store my Bitcoin in a non-custodial wallet. Given the high withdrawal fees from the CEX, I believe that utilizing the Lightning Network might be a better solution for me. However, I am facing two main issues:
1. Finding an Affordable and safe Wallet
I am currently searching for a wallet that has low fees, both for depositing my Bitcoin and for making future withdrawals or transactions. I understand that opening a Lightning channel often requires an initial deposit, which can be costly. Here are some wallets I’ve explored so far:

Electrum: I initially considered using Electrum, but to open a channel, I need to make a prior deposit. This means I would have to transfer Bitcoin from my CEX to Electrum, which is problematic because of the high withdrawal fees I mentioned. I don't know if there is a workaround to deposit some BTC there.

Muun: I used Muun and found that they charged me no fees when I deposited 10,000 Sats from the CEX. However, sending Bitcoin from Muun is quite expensive. For instance, sending around 10,000 Sats incurs a fee of 1,000 Sats (10%), which I find to be excessive. Additionally, I’ve come across a lot of skepticism regarding Muun’s safety and transparency for storing large amounts of Bitcoin.

Phoenix: I also tried Phoenix, but the initial deposit fee is quite steep at around 1%. I’m not sure if incurring such a high fee at the beginning is worth it, especially since subsequent transactions still have significant fees.

Wallet of Satoshi: I have tried this wallet as well and found that it has the lowest fees and it worked great (at least with 10,000 Sats). However, it is a custodial wallet, and I am not comfortable risking my savings with them.

Zeus: I am currently considering Zeus as an option, but I have concerns. It appears that Zeus requires a substantial initial deposit (at least 100,000 Sats). Additionally, I’ve heard that you might need to run your own node, which I am unable to do. I am also confused by the information on their website and worry that if I pay 10,000 Sats to open a channel, it may not be the best choice for me. I want to avoid losing money or facing high fees later on.

Blixt: Lastly, I’ve experimented with Blixt, which seems to have a low fee for opening a channel (520 Sats). However, since it operates differently from other wallets, I am unsure if it is the right decision. Other resources indicate that to securely store a significant amount of money, I should open a channel with a substantial initial deposit. However, I do not see a warning about this on Blixt, which raises my doubts further. It also warns of loosing all my assets because is still in beta, which is frightening.

Breez: Breez seems to be underdeveloped. I read somewhere that its developer just gave up!

For now, I am thinking of using a wallet to withdraw from CEX with low costs and then transfer assets to a physical wallet. Although, I'm not sure if this is the best!
2. Closing the Channel Safely
If I manage to transfer my assets using a Lightning wallet, I am uncertain about how to properly close the channel in order to return my funds to layer 1 (the Bitcoin main network). I believe this process might vary based on the wallet I choose to use.
Could anyone please provide guidance or resources about these wallets and the Lightning Network? I am worried about moving all my Bitcoin into a wallet and later regretting my decisions.
I am aware that I need to educate myself further about cryptocurrency, and I am committed to becoming an advanced user eventually. However, I am currently pressed for time and feeling a bit overwhelmed. Thank you in advance for your help!


text:
How to fix this error on Electrum personal server?
I try to setup Electrum Personal Server between my Bitcoin code node and electrum wallet on Mac OS.
I configured files as found in various tutorials, and when I launch EPS I have these messages :
INFO:2024-12-23 18:10:15,987: Starting Electrum Personal Server 0.2.4
INFO:2024-12-23 18:10:15,987: Logging to /var/folders/6j/hmnxd9w94zn1s4zd35gz35km0000gn/T/electrumpersonalserver.log
INFO:2024-12-23 18:10:15,993: Displaying first 3 addresses of each master public key:
INFO:2024-12-23 18:10:15,996:
default_wallet =>
    1Q6HK8akN2Bex1Vw6eXeSa575czMUkmGRr
    1QCGbjW5z9bRLJwoYj6edHV1W1AWhnjHSs
    19KSfRYaeBJvtnFs2JovHxrqsJ5fDzB2gH
INFO:2024-12-23 18:10:15,997: Obtaining bitcoin addresses to monitor . . .
INFO:2024-12-23 18:10:15,997: Importing 1 wallets and 0 watch-only addresses into the Bitcoin node

But after a few seconds, I have this error:
electrumpersonalserver.server.jsonrpc.JsonRpcError: {'code': -4, 'message': 'Only legacy wallets are supported by this command'}

It's weird as the wallet seems legacy, the displayed addresses are correct compared to electrum wallet, and they begin with 1.
I also created new certificates as it was mentioned on another post but the problem is the same.
As anyone encountered this problem and could help me to figure it out ?
Thanks :)


text:
What would happen if miners refused halving
In may 2020 the supply of bitcoin per block is supposed to be reduced by half https://www.bitcoinblockhalf.com/
What if after this phase the first miner or more than 51% of them decide to keep the current production rate ? Do their block will be refused like if they had produced a wrong block ?

What if after this phase the first miner or more than 51% of them decide to keep the current production rate ? Do their block will be refused like if they had produced a wrong block ?

Exactly. This is no different than if a miner (or a majority of miners) created blocks which paid out anything more that 12.5 BTC today: the network would simply ignore the new blocks, and the miners will have wasted their resources, working on an invalid block.
@JBaczuk's answer is technically correct that this would create a hard fork, but it ignores the bigger picture that even if a majority of miners make the switch, that doesn't mean users will follow. So while the miners could create a new, hardforked chain, this would be rather uninteresting, as there would be no users on it. As we've seen with past events (ie, blocksize debates, Segwit2x, etc), miners will follow users, not the other way around.
If this were not the case, then users (and the network's rules) would be at the whim of the miners. This would create a broken system of incentives, as miners could just change the rules to benefit themselves (eg, changing the issuance of new coins).

This would result in a hard fork where the majority hashrate would decide the rules for the chain going forward, and any hashrate that does not go along would simply split off and have a smaller chain over time (becoming less secure).
A hard fork is a possibility at any given time, but in this case, since deflation was part of the design, the economics would expect that miners would not want to do this since it would cause the supply of coins that they already own to become inflated, reducing their value.

I think that the miner's main motivation for not inflating supply has nothing to do with losing value of their already-mined coins, and everything to do with following the network's users (since they are the source of economy). See: Segwit2X, UASF, etc. If it were possible for miners to increase the supply, I would expect them to do so: inflation erodes the value of every coin in the system, so in some sense this is a situation where 'the losses are socialized, and the profits are privatized', and thus the miner will benefit.

@chytrik it is possible for miners to change the supply and has been since the beginning. I see your point though since the value is determined by the market (users) but many users are miners as well.

'Possible' is a tricky word here, because while it is technically possible to make this change, in reality it is likely almost impossible to accomplish. So I think it is a slightly misleading description, that requires further explanation at least. Looking at the history of the network, there is nothing to indicate that any attempt at this would be successful. So it is possible in the same way that 'adding a tax to every on-chain tx, that pays Chytrik 1% of the amount transacted' is possible, but I'm fairly sure it will be impossible to convince everyone to make that change :(

@JBaczuk "it is possible for miners to change the supply and has been since the beginning" I couldn't disagree more with that statement. Sure, the entire ecosystem may make that decision (and small but economically relevant groups may be able to convince the entire ecosystem to do so, or split into one that does). But miners are not special in any way in that equation; they are part of the ecosystem, but not more than others.

@pieter Miners may create the forked chain, but that doesn't guarantee users on the new chain, is that what you mean?

Yes. And underlying PoW's security is the assumption that miners act in a rational fashion (if they're all irrational, PoW does not guarantee convergance). So without users to give the forked chain value, no miner will choose to mine it.

It could get to a point where halving the reward would mean not to be able to cover the costs. Then many miners would be tempted to risk such a rebellious move.
Users would then have to choose between the low-reward miners, that would require higher transaction fees, or the high-reward ones, where part of the costs are paid through coin inflation.

This is a speculation about block reward extension whereas the OP is asking about the consensus legality of performing such an operation. In the case that miners attempt to claim a block reward that is not on the fixed Bitcoin emission schedule their block will be invalid and they will effectively be on a fork of Bitcoin where the fixed monetary supply dynamic was not honored.


text:
Can we just delete Electrum (or any other wallets) from our device and just keep the phrase safe to make sure we don't get hacked?
I've come across various reports of people losing access to their assets, whether due to their own mistakes, backdoor vulnerabilities, or other reasons. It appears that keeping a wallet app installed directly on your device may not be the safest option.
Even the official documentation from Electrum recommends different security strategies that need more than one device, such as using watch-only wallets or multisig setups. However, we all agree that not everyone has the resources or technical know-how to implement these protective measures. Additionally, it’s important to recognize that we can never guarantee our devices are completely secure and free of threats.
This leads me to ponder whether it might be wiser to simply remove Electrum (or any other wallet app) from our devices. By doing so, we could potentially reduce the risk of hackers or malware accessing our wallets, even in the event that our devices become compromised.
I believe this approach could offer a higher level of security, especially for those of us who are HODLers.
What do you think?

If you have made (and tested! very important to test!) backups for the wallet, then yes you can remove the wallet software from your device.
The thing is, if you ever want to use any wallet functions (eg, sending coins out, or generating new receiving addresses), then you'll need some wallet software installed on some device to accomplish this.
To mitigate against 'hacker' type attacks, many users prefer using cold-storage (offline) hardware wallets. This style of wallet isolates your private keys in an offline environment, and it can then be paired with some wallet software that is running on an online device, in order to send/receive transactions (though this online wallet will not have access to your private keys, hence the safety enhancement).
Also worth noting that it is preferable to not only keep private keys offline, but to generate them offline in the first place. That way the user can have greater assurance that they will not fall victim to some malware/etc based attack due to a compromised device at the time of key generation.


text:
How does Bitcoin verify that a user owns the bitcoins he/she spent?
I'm making my own blockchain based currency for a school project and kind of hit a roadblock. I have a wallet class which initializes with zero coins. What prevents the user from just sending a transaction, if he doesn't own the spent coins. Bitcoin is anonymous, so it doesn't save the balance of each account, right? So you could just reprogram a wallet to not subtract the spent amount from your balance? How does Bitcoin prevent this? Thanks in advance.

Bitcoin doesn't really care about balances, accounts, people or ownership. It doesn't need to know about any of those things.
Read the above sentence again. It is true. It has many important implications.
Bitcoin is cash, not an account. There's no system that tells a pizza storekeeper how many $10 bills (banknotes) you have under your mattress. The pizza storekeeper doesn't care. They only care that the $10 bill you hand them is not fake.
They don't need your ID. They don't need your name. They don't care whether you don't have a bank account. They don't ask you who owns that $10 bill, because they don't care who paid for the pizza - only that it gets paid for at all.
Don't let the terminology confuse you. The bitcoin blockchain isn't a ledger that keeps track of balances. It is a transaction journal that records only half of a real-life transaction - the half where A gives B some Bitcoin money, not the half where B gives A a pizza.
The transaction has inputs and outputs. The inputs are "coins" that A is giving up and the outputs are typically a new "coin" that B is getting and a new "coin" that A gets back as change (since Pizzas rarely cost exactly $10).
A Bitcoin "coin" is really just an output amount from an earlier transaction that has not yet been spent in a subsequent transaction. It is an Unspent Transaction Output (a UTXO).
Bitcoin nodes just keep track of UTXOs. When a UTXO is spent, the U in its name no longer applies. Every node observing the spend removes that TXO from its list of UTXOs. So every node seeing a second spend of a TXO would know that TXO is now not a UTXO and reject that second spend as invalid.
If a wallet reports a false balance to its owner, no one is harmed but the owner. A fake balance does not enable you to spend money you don't have. Its like a leather wallet that has "$30" written on the outside but which only contains two $10 bills.
That's the difference between bank accounts and cash.

Thanks, that really cleared things up. I didn't know about UTXOs and TXOs. Thanks for taking your time and helping me.


text:
Is a proof of work consensus mechanism that discourages mining in pools possible?
Most proof of work cryptocurrencies, including Bitcoin, have most of their hashrate controlled by the biggest mining pools which significantly decreases decentralization. Would it be theoretically possible to create a proof of work algorithm that distributes the block reward to miners relative to how many shares they have submitted? Basically make it so that the algorithm itself is a decentralized mining pool.

biggest mining pools which significantly decreases decentralization

Not at all. Pools contribute to decentralization. Without pools, small miners would never be able to mine feasibly, because they would never find a block. No matter how much time they spent mining, no block = no reward. Pools allow them a fair share of block rewards proportional to their work.

Would it be theoretically possible to create a proof of work algorithm that distributes the block reward to miners relative to how many shares they have submitted

It's called P2Pool


text:
Output Descriptor for an Arbitrary Script
Can output descriptors be used to describe an arbitrary script?
Say I had a script something like the following:
OP_IF
  1737417600 OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 <pubKeyHashD> OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
  2 <PubKeyA> <PubKeyB> <PubKeyC> 3 OP_CHECKMULTISIG
OP_ENDIF

That's a two-branch script that either allows a 2-of-3 multisig or a single-address retrieval after a set amount of time. Is there a way to convert that into descriptor that I could then use to derive addresses?
wsh seems focused on set types of scripts, while trying raw on a 32-bit hash of a script gives me Descriptor does not have a corresponding address.

Output script descriptors do not currently support any arbitrary script. However once extended by Miniscript, descriptors will be able to support any script logically. Minscript is an extension of descriptors which allows for arbitrary scripts, within certain parameters. While you cannot specify any arbitrary script, you can use Minscript to create an arbitrary script that does what you want. This will not necessarily be the same as an arbitrary script that you come up with, but it will be logically identical.

As of October 2023, Miniscript is becoming more widely used. Under P2WSH, you can import Miniscript descriptors in watchonly mode on Bitcoin Core since version 24.0.1 and sign for them since version 25. The upcoming version 26 will support Miniscript under Tapscript (ie within Taproot descriptors).

Thanks, Andrew! I'd seen that the functionality looked possible in miniscript, I appreciate the pointer that it's the way to go.


text:
Bit Coin Mining
Sorry for being noob. I am in the process of developing Bitcoin Mining in Python, just curious about whether, can we able to receive the percentage of guess in Target Hash Function via API.
For Example:
Target Hash: 3a42c503953909637f78dd8c99b3b85ddde362415585afc11901bdefe8349102
My hash : aa42c503953909637f78dd8c99b3b85ddde362415585afc11901bdefe8349102
80% Guess kinda..
Your help will be appreciated.
Thank you

Hi J A, I'm not sure I understand your question fully, but it seems helpful to point out that Bitcoin mining is searching for a partial preimage, but the restriction is that a valid block's hash must be numerically smaller than the target. The actual values do not need to match.

(target + space - guess) * 100 / space

So for example, if your numbers had to be less than 200 and you needed to be less than 20 but got 30, your guess is (20+200-30)*100/200 or 95% right.
This makes sense. There were 200 possible results. You needed to be in a range that covered 10% of that space. You missed by 10, which is 5% of the space. So you were 95% right.
In your case, the space is 2^256. The target is the difficulty.
There are, however, several other possible definitions of how far off you are that produce much lower numbers. This is the more "optimistic" one. For example, if you're looking for an 8-foot tall man, is a 6-foot tall man only off by 2 out of 8 or 25%? That's awfully optimistic and suggests 8-foor tall men are much easier to find than they really are.

Thank you for your valuable reply @David Schwartz


text:
Why does a WIF include the network?
When creating a WIF from a private key, you have to insert a special byte at the beginning of the hex string, before starting hashing and adding the checksum:
0x80 for the MainNet or
0xef for the TestNet.
Is there a special reason WHY this has to be included in the WIF? Wouldn't it be better (=more universal) just doing the hashes and adding the checksum without the network byte? What is the sense behind this, why did the founders of the WIF-mechanism decide to go this way?
Just for my understanding...

As the original author of the WIF format, honestly: the question had never occurred to me, but I think it does make sense.
At the time the only existing Base58Check format was the P2PKH address format for mainnet and testnet, which had a network byte. To create the WIF format I just modified it to set the high bit in the version byte, and changed the payload from public key hash to private key.
Note that this was before the existence of seed phrases, deterministic wallets, or altcoins. The idea that someone would want to reuse the same key on multiple networks just didn't apply.
In retrospect, I think this was a reasonable choice. You shouldn't reuse keys across networks (or applications in general).

WIF stands for Wallet Import Format which is a standardize scheme to import and export keys from wallets. As such it makes sense to include metadata such as the network byte so the wallet knows what network is the private key for instead of trying it for every supported network. If you only want to encode just the key itself and no metadata you can do so in hex.


text:
How can I be sure that anyone (i.e miner) will not change outputs from transaction?
I am wondering if ie. miner cannot change outputs from transaction. We have example of transaction:
      {
"version": 1,
"locktime": 0,
"vin": [
{
"txid":
"7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18",
"vout": 0,
"scriptSig" :
"3045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204
b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e3813[ALL]
0484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d1
72787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf",
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.01500000,
"scriptPubKey": "OP_DUP OP_HASH160
ab68025513c3dbd2f7b92a94e0581f5d50f654e7 OP_EQUALVERIFY OP_CHECKSIG"
},
{
"value": 0.08450000,
"scriptPubKey": "OP_DUP OP_HASH160
7f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 OP_EQUALVERIFY OP_CHECKSIG",
}
]
}

I signed UTXO from txr 7957a35fe64f80d234d76d83a2a8f1a0d8149a41d81de548f0a65a8a999f6f18 by my private key. I put this signature to scriptSig and added my targets addresses to vout and send transaction to bitcoin network. How can I be sure that anyone can't change vout values? Maybe I am wrong and my scriptSig includes additional data from transaction. How this scriptSig is created?

As a very simple way to understand what's happening (and I'm not making this an answer because it lacks detail) there is a signature for each input that signs the outputs according to the requirements to claim that particular input. So if you modify any output, all signatures for inputs that require signatures will be invalid and the transaction cannot claim those inputs.

David you mean that scriptSign contains data from vout. Other words, data what I am signing are tx, vin, vout? Am I right?

That's correct. The signature binds that input to that output and, assuming you use the standard scripts, varying either the input or the output invalidates the signature.


text:
miner gets the right to get 0.05% as tramsacton fee when the coin trensfered
miner gets the right to get 0.05% as transacton fee when the coin trensfered.
But, if i start mining at the mining pool, who gets 0.05% of transaction fee?
the pool? or me?

Your question's assumption is incorrect!  There is no such thing as a 0.05% transaction fee or any percentage!  The transaction fee is based on the number of inputs and outputs not the amount!  If you create a transaction with only 1 input and 1 output to send 10 million bitcoins it will have the minimum transaction fee.  If you send .001 bitcoins in a transaction with 100 inputs and 100 outputs you will have a very large transaction fee.

Depends on the pool. BTCGuild for example also distributes the fees fairly. Eventually the fixed mining reward (25BTC now) is going to go down and disappear and everything will have to be paid from the transaction fees. So if they don't already, pools will have to pay those out at some point.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Bitcoin address does not show transaction/balance from Coinbase purchase
I purchased a bitcoin using a Coinbase account. When I try to verify that transaction to the address, I can't see any activity or balance for the bitcoin address that Coinbase shows as mine. Coinbase, however, still shows my purchase activity and balance correctly on my account.
Has this something to do with the way Coinbase or such wallet services work? Or is there something wrong? Do I actually have the bitcoin or not?

Are you looking at the deposit address? Coinbase stores your coin in an account that may not be associated with your deposit address.  You should be able to move BTC out of your account to your own personal wallet if you choose to do so.

Are you saying the deposit address is where I can receive bitcoins from someone? And it is different from the bitcoin address where my bitcoin is stored?

The deposit address is where you or a customer of yours could send bitcoins.  From my understanding coinbase is constantly buying and selling coins they could simply be stored in a wallet that coinbase controls, it may not be associated with the address listed under your deposits.  If you want to store your bitcoin in your own wallet you would be able to verify that the coin has been sent to an address that you control.

The coins you purchase are stored in an address owned by Coinbase.  This allows them to buy and sell coins using their hot wallet as well as allowing them to move excess coins to cold storage.  It also allows them to process send requests between Coinbase users using off-blockchain transactions.
The coins won't show up in an address owned by you until you send the coins to a non-Coinbase address.  When you do send the coins, two transactions will be generated by Coinbase.  The first transaction moves the coins from an address controlled by Coinbase to a new address controlled by you.  The second transaction then moves the coins from this address to the address you specified in the send request.
You can send coins to any of the addresses shown in your Coinbase wallet.  Or you can generate a new address at any time to receive deposits.
Since Coinbase keeps just a percentage of the coins in their hot wallet, this can lead to a delay in sending coins if they need to move coins from cold storage back to their hot wallet.

This is no longer correct in 2017.

I'm no expert but I'm a user of coinbase and noticed there's a mistake in ScripterRon's answer.

The first transaction moves the coins from an address controlled by
  Coinbase to a new address controlled by you. The second transaction
  then moves the coins from this address to the address you specified in
  the send request.

This is not true from the usage that I've done. When I did the "send" in coinbase, a transaction ultimately went from a coinbase-controlled directly to the destination address and never went through an address controlled by me (e.g. visible under Tools > Addresses).
Some more details from what I saw tracing where the money I spent came from: coinbase had made a series of transactions starting from an account that was holding 0.5 BTC since 23 days. On the day of my transaction, a lot of transactions happened simultaneously coming from that 0.5 BTC master account and funneling through to multiple coinbase-controlled addresses to finally include the destination address I had specified with the right amount.
And their algorithm seems to have some losses because there was a small surplus at the end, and they ended up putting 0.00000866 BTC in an address. Not sure how it will make sense for them to re-use this amount later though, with the current transaction fee costs.

They used to do this, but don't anymore due to the utter idiocy of the behavior.

@eponymous: This happened on a transaction I did 5 days ago from the time of my posting... Not sure how long ago they stopped doing so as you said.

Your answer is correct as of the last 2 years or so, the previous answer was correct for 2013.

@eponymous Good to know! Interesting to see the changes of the algorithm over the years. Looks like you've been a long term user yourself since 2013 at least?

Early 2011, or there abouts.

@eponymous To be honest, I was a bit surprised by the amount of transaction fees that occurred to lead to my ultimate transaction. It seemed lossy to me, there must be something I'm not seeing on how they make money with that ultimately.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
What exactly is "privatekeys.pw"?
Today, I stumbled upon this bizarre website: https://privatekeys.pw/

Bitcoin Private Keys Directory

The FAQ makes no sense at all and doesn't explain what it is about whatsoever.
What could they be referring to? Private keys? Are they listing compromised private keys to Bitcoin wallets? Why do that in public? And if so, of course whoever runs that site must've already nabbed any coins from the wallet anyway? So what possible use is that information to the world?
As so often is the case, I have to ask: "What am I missing here?"

WARNING this site and all like it are very likely a SCAMS!! The answers here are technically correct but they almost make it sound like it's normal or a good idea to enter a private key on this website to "look it up" or "convert it". It's not and all funds ever associated with such a private key will soon be stolen. Even if this site itself is not the scam, they publicly list the "recently searched keys" so anybody else can steal them (giving the makers a nice scapegoat).

Maybe this was added after this question was posted, but the site now has the following banner at the bottom:
Disclaimer: This site is for educational purposes only. Nobody should use someones else's private key to steal bitcoins. You are using this site entirely at your own risk. Do not post your own private keys or wallets, you may lose your balance!

The site is a joke, or at best a confusing attempt to educate.
It literally lists all private keys, from low to high, as private keys are just numbers. There are of course way more than can be reasonably computed and stored, so the pages are just generated on the fly. If you ask for private keys starting at number N, it on the fly computes the public keys corresponding to private keys N through N+43, and looks up their balance on public block explorers.
But it doesn't let you search by public key, so it is useless for cracking things. Real private keys are randomly generated, and just scrolling through a near-infinite list of pages to look for a given public keys won't give you anything.

If you look at the features of the site, there are a few notable ones:
First, it allows the conversion of private key formats on a web interface, between decimal, hex, WIF, old Electrum seeds, mini, and brainwallet passphrase. This would likely enable someone who isn't particularly familiar with programming to nevertheless validate strings to see if they are indeed private keys.
It also can convert from keys of one coin to another. While the underlying private key remains the same, different coins have different network prefixes. If someone has a wallet dump but is unsure of the actual coin the wallet is supposed to contain, the site can provide a way to convert the existing WIF private key into a myriad of different private keys on different chains, which may be helpful in identification. It can also create bech32 and segwit addresses from WIF keys where relevant.
Granted, these are pretty niche uses, but use cases nonetheless, whatever the intent of the makers of the site.

Obviously, you should expect that any coins corresponding to keys entered in such manner to immediately be claimed by the site. So, you should never do such a thing.

Yes, as OP already stated in the question. The question is on what the hook is to get people to put in their keys in the first place, not the likely outcome of actually putting private keys into the site.

Someone just reading your answer could get the impression that you are advocating that the site be used to check their key material. Please don't rely on other posts in a topic to provide context.

That's impossible, because I'm only referring to the question posed by the OP, and not relying on the question to provide the context for the answer is... by definition not answering the question.


text:
Gen=0? Will still mine Bitcoin, but will not generate Rewards
I have a debug.log showing approximately 80 rewards from january 2009 to roughly sometime 2011.
I am using bitcoin 0.8.6-beta with Gen=1 and I've ran my wallet through bitcoin 0.8.6 a few times.  I've seen 20 rewards pop up, I've seen one reward pop up, I've seen 9 rewards pop-up - and from what I've gathered, as well as what I remember the initial developer state.  The rewards are there.  When they show up in the mempool, they will be finalized and show up in my wallet.  But, January 2009 - I dont have that .exe any longer, nor can I find it.  The initial developer, lets call him satoshi.  Satoshi said, they will be scraped and deposited, when I run the bitcoin qt core with gen=1, reindex=1, and rescan wallet.  But, I should use the initial bitcoin qt to do so.
I've also come across forks that happened in 2013, which is when 0.8.6 was released.  Though I have 0.8.6 files that show to be from 2011, according to the time stamp of each file last being used.  Either way, the Fork was said to be fixing the blockchain, to not process these rewards, as there were apparently a lot of people trying to hack the blockchain using these mined blocks.  So, 0.8.6 is apparently not going to allow me to recieve these rewards.
So, I have two things I'd like to do.
A.)  Compile a Bitcoin QT (Core) that reimplements gen=0|1 so that the rewards will be generated.

and

B.)  Fix the 2013 Fork, so that these Initial Mined Rewards can be generated into the Wallet.

or

C.)  Compile all of the Bitcoin Cores and work with some volunteers to create a Bitcoin Core that does both of the above interests as well as other interests.
I know that Bitcoin QT is basically Java - or was.  I haven't been paying attention much as of late.  Nor am I a big fan of programming.  I know my way around.  But, I dislike programming.  So, I would prefer some help compiling, or I'll just study and learn how to compile bitcoin qt myself.
Can anyone explain to me if I'll ever see these rewards that my bitcoin qt wallet mined between 2009 and 2011?  And, if I should use the original bitcoin client, or compile it myself, or how difficult it will be to compile a bitcoin qt client to incorporate gen=0|1 myself????
Any other thoughts?
Thanks -=[~
Hate-Me-If-You-Must!
11/10/2023-8:12PM(PST)

Does this answer your question? What does the `gen` option in bitcoin.conf do?

If you had any software between 2009 and 2011 which sucessfully mined Bitcoin, the globally replicated list of blocks of transactions we call the blockchain will include the coinbase transactions in the blocks you mined. Those coinbase transactions created unspent transaction outputs (UTXOs) that paid block-reward money into addresses in your wallet. Addresses from which money can be spent using the private keys from which those addresses were ultimately derived.
If you still have those keys, you can spend those UTXOs
You do not need an archaic version of Bitcoin Core to spend that money. The current version or any non-custodial wallet will allow you to see your balance and spend that money. What you need to do is to import or sweep the keys into a wallet application.
I would expect a current Bitcoin core to be able to read a copy of any ancient wallet.dat or backup file.

Notes:

Bitcoin core is written in C++ not Java.
Block rewards that were generated in 2009-2011 do not need to be generated again and cannot be regenerated. Old blocks and their rewards never expire, never disappear, are never forgotten by the network. The existence of blocks and their rewards are in no way dependent on your continuing software installation or equipment. Everything is in the blockchain and thousands of nodes hold copies of the whole blockchain. Even pruned nodes contain all the transaction outputs (TXOs) ever created which remain unspent (UTXOs).
The existence of your money does not depend on you. Your ability to spend it does.
If you no longer have the keys, your money is lost to you and no amount of messing around with old software will ever change that.

Related:

What does the `gen` option in bitcoin.conf do?

My debug log showed a number that led me to this article - showing that my mined rewards are not finalized - I understand all the gen=1 rewards, but my wallet has rewards that haven't been gen=1 generated, they were gen=0 mined but not generated - now my wallet is generating them, and they have to find their way into the mempool - and the mempool is clogged - but, I need an updated client that can gen=1 with todays forks.
                                               https://bitcoin.stackexchange.com/a/87376/121859

There is no such thing as "gen=0 mined". They were mined, or they were not mined. If they're mined, you can access them by loading the wallet.dat file, or importing the keys. In all other cases, the coins are lost. They cannot be regenerated or anything like that.

I asked the developer at bitcoin.org back in 2009-2011 and they told me to run gen=1 in the config file along with reindex and rescan and it would find the rewards from the mined blocks that still are mined even with gen=0 in the config file being set.

You either misremember, or you were misinformed.

Why did you guys opt to disregard the gen=1|0 feature?  Is there a reason?  Will it ever be brought back?  Can I compile it into a new version or request it?

When (& why) did Bitcoin core deprecate mining

When?  I dont know exactly - I'm almost positive Pieter does.  Why?  I remember it being something about how asics were coming out and pc's weren't mining much.  I remember talking to someone, I think it was Pieter, and he said he would remove it.

I learned about the 2013 Fork being implemented along the lines of the dormant rewards still sitting from January 2009 to 2011 - I've seen articles on the internet showing US Courts trying to claim ownership of these Dormant Coins - My Bitcoin QT 16.3 just finished syncing and it shows a Warning:  Unknown New Rules Activated (VersionBit 2) - which reminds me of the Satoshi Developer saying something about the Fork would leave old dormant rewards on "An Old Chain" - This article (" https://coinguides.org/bitcoin-core-warning-unknown-new-rules/ ") says addresses and transactions may not show up.

My prior comment is a clickable link to answers

Thanks - I wish I could find the original developer that turned it all over to the folks developing it today - But I do have the answers - but ok - hes gone.


text:
Is it possible to find additional key pairs resulting in the same address that I already control?
I'm not really well versed in the necessary terminology to get the answer I need from searching.
As I understand, there are 2^160 possible addresses, and 2^256 possible private keys, so each address corresponds to roughly 2^(256-160)=2^96 private keys.
Let's say I generate a key pair and the corresponding address, how would one go about finding other key pairs that correspond to the same address if you already have at least 1 set of keys that generated that address? Is it possible?
Apologies if this has been answered already, I couldn't find the answer I am looking for.

It's not possible, practically speaking.
A P2PKH Bitcoin address is computed as RIPEMD160(SHA256(publickey)). Since public keys are unique, to find another keypair that results in the same address, you're essentially trying to find a hash collision on SHA256 or RIPEMD160, which is extremely difficult.
The most "efficient" way to find such a collision would be to iterate over the entire private key space.

Searching for another input that has the same hash as a given input is technically called a "2nd preimage", and it is indeed intractable (needs ~2^160 trials). A collision is something else: namely looking for two inputs that hash to the same thing, without one of the two being given already.

Thank you for the clarification.


text:
Has consensus been reached regarding the block size?
Many news from one week ago are reporting that transactions take longer to be processed because we are reaching the 1MB limit of the blocksize. Which causes transaction to be buffered, and prioritized depending on fees.
The news article report that there are tensions between two groups of developper, Bitcoin Classic and Bitcoin Core. One team wishing to augment the block size while the other would rather keep the soft unchanged.
By looking on https://tradeblock.com/bitcoin/ it seems that the blocks produced are still under 1MB but the mempool currently reports size of 4.53MB
Has consensus yet been reached regarding the block size ?
Are we still experiencing trouble ?
What has been decided ? Where can I get more info ?

There is and has been huge consensus since the scalingbitcoin.org conference in Hong Kong in December 2015 in favor of going with the Segregated Witness solution. SW had been implemented half a year earlier in a side chain but in Hong Kong Peter Wuille (starts around 35 minutes or later repeated here: https://youtu.be/NOYNZB5BCHM ) announced that a way to smoothly incorporate it into existing Bitcoin (via a Soft Fork) had been found.
The main goal of SW was to eradicate transaction malleability but it has many other advantages, as well as the nice side effect of making the effective block size larger. To around 1.8MB, although the exact amount depends on the type of transactions people do, it could be more.
The finishing touches are being applied to SW in a test network right now, while wallet software is also being updated to make use of SW transactions so their users will enjoy its benefits. Last I heard SW is scheduled to be rolled out in April 2016.
Pretty much everyone agrees, including on the opposing team, that SW is a great solution. Unfortunately for political reasons, the classic team have decided to keep spreading untruths and FUD about SW and the Core team. For example that SW is more complex than a straight up doubling of the block size through a Hard Fork or that such a Hard Fork could be rolled out faster. As well as unfounded conspiracy theories about ulterior evil motives of members of the Core team.
Fortunately classic is an irrelevantly small group of people who for the most part clearly don't know anything about Bitcoin.
Core has almost unanimous miner and community support and is streaming ahead with improvements, SW and many others.


text:
Generating Public & Private key pairs for cracking Bitcoin
Would one of the better methods to crack Bitcoin be to start creating a massive database of key pairs? It would then be possible to reference the Private key required off the public key from the DB.

It will take significant resources (probably more electricity than can be generated by all fossil fuels on Earth) and time (orders of magnitude greater than the age of the universe) to generate a complete Bitcoin address "rainbow table".
See these answers for more details.

You would hit the heat death of the universe before you came anywhere close to generating even a single already used key pair.
If you don't understand the math in the key pair generation you should take that as an indicator of the uncertain ground on which you tread.


text:
I'm making an infographic on Bitcoin. How can I download all Bitcoin transactions to do some analysis?
I would like to do some analysis of Bitcoin transactions in the last 3 months and share my insights by preparing an infographic. What would be the best way to get all Bitcoin transactions in the past 3 months?

Aren't bitcoin transactions anonymous? maybe you should ask some bicoin exchange market for some data.

@blogger: All transactions are stored publicly in the blockchain. They are not anonymous, but pseudonymous (each address is a pseudonym for a person, and therefore trackable, even though obfuscated).

@Edward: I saw a similar question a while back, the person was informed to look into a software called "ABE", I can't find the question right now though and don't know much about the tool myself.

A key element of the Bitcoin protocol is the block chain, which is a public transaction database. This contains most all transactions made in bitcoins and also includes information such as the sending and receiving addresses. You can find historical transaction data for the past 3 months by using a block chain explorer like ABE or Blockchain.info.
I would recommend ABE, only because it is written in Python, which will make it a lot easier to interface with for data analysis purposes.

You probably want to look at historic data for Mt Gox if you are looking to correlate pricing data, which is available from their public API.  There is a function that returns all of the transactions that have occurred since a particular timestamp.  Other exchanges may or may not expose historical data. Otherwise you need to perform blockchain analysis using blockexplorer.info or ABE if you have a local copy of the blockchain.


text:
Stealing a correct hash because of an invalid block
Suppose that a miner find the right hashes but involuntarily or by malicious intention then create an invalid block, like trying to double spend a transaction
My guess is that the moment this block is broadcast the first node to receive and test this block will immediately copy the correct hashes and produce a block of his own this one valid and with his own coinbase address.
I know that this scenario has little chance to happen because miner know that their coinbase will be steal and rejected by the network, but is this a valid working process ?

Related: https://bitcoin.stackexchange.com/q/95564/5406, https://bitcoin.stackexchange.com/q/51300/5406, https://bitcoin.stackexchange.com/q/17231/5406, …

It's not a valid working process: the block hash commits to all transactions.
First of all a miner cannot "find a right hash" then insert a double-spend transaction. This would invalidate the hash (and the block, actually).
For the same reason, a node receiving the block cannot malleate the coinbase transaction. It would not be able to "immediately produce a block" either.
In addition, blocks have consensus rules and a valid block does not only consist of a block header hash inferior to the target but must respect a number of other rules as well (locktimes, existing outpoints, valid scripts, ...).
The cost of producing a valid PoW is so high that you would not expect a miner to commit energy to an invalid block.


text:
Does bitcoin mining pool hash randomly and separately
When it comes to hashing does each mining entity use total random seed for each of their hashing function or do they have a range like " Im gonna cover from 0 to 500, and you cover from 500 to 1000, then if nobody find it we up 500 more "
And if they do use range does they tell it to other mining pool, so that they are not searching around the same number ?

Most mining pools use the stratum protocol. Part of this protocol includes a field for part of the extraNonce, named extraNonce1. The extraNonce is just extra data that is put in the coinbase transaction and used as a nonce in addition to the block's nonce. Each mining worker can then append their own extraNonce to extraNonce1. This second part is named extraNonce2
Typically what mining pools do is they issue work to each worker with a different extraNonce1. This allows the worker to use the entirety of the nonce field as well as their own space for extraNonce2. The submitted work can also be identified to belong to a particular worker by examining the extraNonce1.
I'm not sure how specific mining pool software determine what extraNonce1 to give out, but an obvious method would be to do so sequentially - each time work is issued, extraNonce1 is incremented so that each worker gets something different to work on.

It's just randomly assigned. There's no point in trying to make any of this sequential, as it would require pool servers to coordinate unnecessarily.

Im gonna cover from 0 to 500, and you cover from 500 to 1000, then if nobody find it we up 500 more

Yes, the server coordinates this:

The server SHOULD assign disjoint subspaces of the 8 byte nonce space to miners, avoiding the problem of multiple miners working on the same problem.

And if they do use range does they tell it to other mining pool, so that they are not searching around the same number ?

No, instead, usually coinbase tx contains the pool name which guarantees separate search spaces. EDIT: This is not needed since the payout address is different already (thanks, Pieter Wuille)

It doesn't need the pool name; you can mine anonymously. But at the very least, the payout address of one miner won't match that of another (they want to pay themselves!), so the coinbase tx will never collide.


text:
Does Electrum receive BTC as well as mBTC? Or are they the same thing?
I notice that electrum works with mBTC, but I wanted to set up a BTC wallet. Are they the same thing, or interchangeable? I'm fairly new to wallets, so I apologize if this is a very easy or stupid question.
Thank you for your help.

An mBTC is just 0.001 BTC, like a cent is 0.01 dollar.

Okay, thank you. The wallet balance is recorded in mBTC, so that means it's still bitcoin but quantified differently, correct?

This is the same as asking whether the gas price is 2.53 $ per gallon or 253 cents per gallon. Both are equally correct, they're just different representations of the same thing. If you configure Electrum to show amounts in mBTC, it'll show mBTC. It can probably also show it in satoshis (0.00000001 BTC) or bits (0.000001 BTC) or BTC itself.

Ah okay great, thank you. I was under the impression they were entirely different currencies, I apologize if it was a dumb question

There are no dumb questions, I'm happy it was easy to clarify.


text:
Which app generates stronger mnemonic seed?
Mnemonic phrase, mnemonic seed, or seed phrase are defined as a secret group of words that represent a wallet. When used in sequence they allow access to the cryptocurrencies stored within.
“Mnemonic” just means a memory aid such as rhymes, abbreviations and songs that help you remember something else. A mnemonic phrase is a group words, often 12 or more, created when a new wallet is made to store your cryptocurrency. If the computer running your crypto wallet died, was lost or even stolen, you could use your mnemonic phrase to recover your wallet and crypto. The words must be typed in exactly in the same sequence they were created. Most people store their phrases on a piece of paper and then keep that in a safe place. Your phrase must be kept secret, anyone who discovers it can steal your crypto. Mnemonic is pronounced: nuh-mon-ic.
Among the available applications (In Google Play Store and App Store) Which app generates stronger mnemonic phrases?
In general, what is the strongest way to generate mnemonic phrases?
What is the mathematical probability that someone will guess your mnemonic words randomly?

Does this answer your question? What prevents hackers from guessing seed phrases? Also we don't do app recommendations on this site, it attracts spam.

@m1xolyd1an They do not include quantum computers in their calculations.

Nor can they. If quantum computers of suffiicent complexity exist, Bitcoin private keys can be computed from public keys anyway, regardless of how random the seed phrases are.


text:
Isn't burning bitcoins a kind of fraud?
BitCoin burning is the process by which digital currency miners and developers can remove bitcoins from circulation, thereby slowing down inflation rates or reducing the total circulating supply of bitcoins.
Isn't burning bitcoins a kind of fraud?

BitCoin burning is the process by which digital currency miners and developers can remove bitcoins from circulation

I think you'll find that "Bitcoin burning" refers to owners of Bitcoin burning their own money (not anyone elses) by the equivalent of sending it to an address that no-one owns.
It is not something that miners or developers do with other people's money.

Isn't burning bitcoins a kind of fraud?

One definition of fraud is

wrongful or criminal deception intended to result in financial or personal gain.

Burning your own Bitcoin (and no-one else can) is not a way to deceive others (at least not in any obvious way) and does not by itself result in any financial gain for the person burning their own money.
It is not fraud, per se, to burn your own money.

"It is not fraud, per se, to burn your own money." depends on which currency your money is in. It's not legal to burn USD. (I'm curious if it is legal to send USDT to a burn address and not tell Tether about it)

If this action leads to some kind of famine in the cryptocurrency market, then it can be considered a criminal act.

@AirGap: (1) Not all criminal acts are frauds. (2) The consensus view among Bitcoin owners is that they are very happy when someone else burns their Bitcoin because general Bitcoin owners perceive that act increases the value of the remaining Bitcoins.

@MCCCS: (1) The question was whether it was fraud, not about other law. (2) The question was about Bitcoin, not USD or USDT.

Are they lying about something? Not really. This would be like if you put a bunch of money in a vault, threw away the key, buried the vault, and then wiped your memory so you don't know where it's buried. Would that be fraud?

The consequences of this action can be devastating for others. And those who do so knowingly will face legal consequences. This is different from what you do unintentionally.

Why would destroying something you own have devastating effects on others? I can happily burn wood I own, or throw dishware on the ground if it makes me happy. There is no reason why the same wouldn't be true for cryptocurrency - you can do with it what you want. For fiat currencies there are often specific laws preventing this, as they are national bank obligations, not fully "owned" by the holder.


text:
Will the Bitcoin Network Security decrease after the last Bitcoin was mined?
As far as I understand Bitcoin mining the block reward consists of newly emitted and transaction fees. However, this new emission will disappear in the future and there will be only be the transaction fees.
Therefore, mining will be profitable if Bitcoin has a certain amount of on-chain transactions.
My impression is that people in future will rather rely on off-chain transactions due to the long block times.
My question is: Could it be a long-term security risk for Bitcoin if there are too few on-chain transactions after the last Bitcoin was mined?

time between blocks is not affected by network hashrate and does this answer your question?  https://bitcoin.stackexchange.com/questions/105363/what-is-the-incentive-for-continuing-to-mine-bitcoin-as-we-get-very-close-to-the answer

Off-chain protocols like Lightning and sidechains can offer instant settlement but they come with their own set of trade-offs. Lightning requires you to be online 24/7 to monitor the chain and the private keys for your funds are hot rather than in cold storage. Sidechains, depending on the design, require limited trust in third parties to peg in and out. Hence onchain transactions will always offer the most security and minimize trust in third parties and hence I personally believe that as long as Bitcoin is still relevant and has mass usage when the block subsidy runs out (approximately 2140) then there will be demand for block space; potentially Lightning channel opens and closes, high value onchain transactions and whatever other higher layer protocols have been designed by then.
If I'm wrong and there is no or limited demand for block space then yes this could be a security problem. But 2140 is a long way away and there is a lot of work to do to scale and secure Bitcoin against future threats so that it is still relevant in 2140 regardless.


text:
Why do miners need a nonce if the timestamp changes the hash of the block?
As the title says.
If the timestamp is constantly changing with every guess, why does the miner also include the nonce? Is it because they're mining too fast for the timestamp to change?

Is it because they're mining too fast for the timestamp to change?

Precisely - even a relatively slow CPU can hash several hundred headers every second. Modern day ASICs can hit 100+ terahashes per second - ripping through the entire nonce space several times over.
Moreover, the timestamp is also a 4 byte value - miners do use it, in conjunction with the nonce, merkle root, and block version to create a much larger search space. Even so, the majority of combinations of all of these do not result in valid blocks.


text:
My Bitcoin transaction is lost
When I enter the deposit address of where I sent my bitcoin, the Blockchain says that the transaction is "Spent" What does this mean? It's been like this for 3-days now. Please help!

Hello, welcome to Bitcoin.SE! We'll need more info to help you (name of wallet / service you sent coins to, the transaction ID, etc), but it sounds like you've sent some bitcoin to a service and your account hasn't been properly credited yet (despite the tx being confirmed). If this is the case, then this is a customer service issue that you'll need to resolve with the service in question.

the Blockchain says that the transaction is "Spent" What does this mean?

It means that the outputs of the transaction have been used as inputs in a further transaction.
Which, in simpler terms, means that the recipient has subsequently spent the received money.
If you were the recipient, have a conventional (non-custodial) wallet and didn't knowingly spend the money it probably means you have lost control of your wallet as a result of hacking or social engineering or some other hostile act by a third party. For example where an online "friend" helped set up your wallet or where you clicked an "update" notice in an old Electrum wallet.


text:
Needing a Private Key in order to receive profits in Blockchain Wallet
I recently made an investment with Forexbitoptions and have made some profits. They have supposedly sent these profits to my Blockchain wallet but say it's not going through as I need a Private key for this. Question I have is do I need a private key for this and if so why would I have to pay for this private key in order to access my profits?

Sounds like you've been scammed. If you don't have the private key, the funds are not yours.

This is a variation of a fairly well-known scam. You never owned any bitcoins, there was never any profit, it is all fake. A watch-only address looks like there is money there, and profits accumulating but it's just a window onto someone elses money, not yours.
There are several similar stories on this website from other victims.

How to unlock private key of bitcoin
How can I get a private key for this address
Reg: Watch only Address
Bitcoin Mining as a Newbie (link wallet to another person's miner)

The Forexbitoptions.com website gives their address as 586 Mcardle Road Kinsey, Alabama 36303, USA. If you put that address into Google maps and check streetview, it looks like some random small rural home (2000 sqft, 3 beds, single storey).
That address is also used by 247bitminer.com so I guess these scammers just copy each others websites.


text:
RPC interface MITM protection
When I connect to my bitcoind instance over RPC, I need a password for that, but no certificate.
So how are man-in-the-middle attacks prevented on that connection?

The JSON-RPC interface is intended for local access. By default it will only accept connections from localhost, but it can be configured to be accessed for a wider netmask; e.g. a trusted LAN network.
If you have a need to access it over an untrusted network like the internet, tunnel it through technology specifically designed for that, such as stunnel (SSL) or a VPN. Getting the details of that right and secure is hard, and is considered outside of Bitcoin Core's scope.
For more information, see the documentation.


text:
I was wondering if Bitcoin Taproot is simply an upgrade or will it have its own coin as well? If so, where can I buy them?
I know Taproot is a soft fork, which basically means an upgrade. I see some forks have coins and some don't, I am lost on the difference and why. Litecoin is a fork and many others are that have coins as well. I don't know where to buy the new coins if there are any as well.

Related question: What is a soft fork? What is a hard fork? What are their differences?

Taproot is an upgrade to Bitcoin. It is not a separate coin.
The term fork can mean many different things, depending on the context. Generally there are 2 types of forks - code forks, and blockchain forks. Of blockchain forks, there are additionally 2 more types - hard fork and soft fork.
A code fork is when someone copies the source code and then makes modifications on it so that it becomes something distinctly different. Many altcoins, such as Litecoin, are code forks of Bitcoin in this way. They were created when someone copied the Bitcoin source code, changed parameters and made several other modifications, and created their own coin. Because altcoins were created to be distinct alternatives to Bitcoin, they also have their own blockchains distinct from Bitcoin by having different genesis blocks. Such forks pertain to open source software in general.
A hard fork is when the consensus rules for the blockchain are changed in a way that is incompatible with the previous rules. Such a change could result in two (or more) diverging chains. These chains would share common ancestry. Nodes that are not upgraded would follow the chain which conforms to the old rules. Those non-upgraded nodes would consider the other chain in the fork to be invalid.
A soft fork is when the consensus rules for the blockchain are changed in a way that is compatible with the previous rules. Such a change could result in two (or more) diverging chains. However non-upgraded nodes would still consider blocks in the new rules chain to be valid and could switch to using that chain if it were the heavier chain.

It is possible to have both a code fork and a blockchain fork at the same time. For example, Bitcoin Cash is a hard fork from Bitcoin. It uses the same genesis block as Bitcoin does and shares several hundred thousand blocks with Bitcoin. However, some code forks of Bitcoin Core were created which introduced a new rules which was incompatible with Bitcoin's rules, and so a hard fork occurred and Bitcoin Cash was created. One of the primary node software for Bitcoin Cash is called Bitcoin ABC. This software is a code fork of Bitcoin Core.

Taproot is only a soft fork. It's consensus rules are implemented in the main Bitcoin node software. It is designed in such a way that non-upgraded nodes will still regard blocks containing transactions that spend Taproot outputs as being valid. So Taproot is a soft fork and there will not be a new coin for it.


text:
Saving privateKey client side to local storage
I'm working on an SPV wallet using bitpay's bitcore lib package.
Am I able to save to local storage the privateKey object generated with 'new bitcore.PrivateKey()'
Or should I be converting it to WIF before setting it to local storage? Are there any drawbacks or advantages of doing it one way over the other?

Am I able to save to local storage the privateKey object generated with 'new bitcore.PrivateKey()'

"Able" vs "should".  Yes you are able to save whatever you want to localStorage including the private key in string format or if an object use JSON.stringify(). It is never wise to store private keys on an internet connected machine. The localStorage data can only been read by the domain that saved the data, so it does have some security, but that's not much. It's essentially just cookie data saved on the users machine, unencrypted. So this approach might be useful when developing wallet concepts or personal projects, but definitely not kosher for production level.

How do spv wallets such as Coinbase, BitPay or Bitcoin_com persist the wallet info? I can't imagine they send the private keys over the wire to a db. Besides saving it to localStorage (asyncStorage on mobile), what over options are there?

Those are all custodial wallets where the provider keeps the keys on their server(s), they are not storing them in the users browser localStorage. I have built some wallet projects myself that store keys in localStorage, works great, haven't had an issue, but these are just fun personal projects.

That's insane if true. A quick google search says that coinbase wallet is non-custodial and does not keep nor can restore your seed if lost. I've quickly looked at edge wallet repo on github and from initial glance it doesn't look like they store seed upon wallet creation. Which wallets are non-custodial then and how do devs go about keeping seeds off servers but also safe?


text:
What is the fastest way to check balance of multiple BTC address in python
I want to check multiple bitcoin addresses balance in python, can someone suggest a script that can do it fast and without getting api error.

You could do that by fetching an API from a Block Explorer

Mempool.space
BlockStream.info
Blockchair.com

Or by adding a wallet on your Bitcoin node and fetching listunspent

without getting api error

Which API are you using?

Do you have any code that fetch balance from these API's
I am using blockchain API

you can request this API (it's free to use): https://rapidapi.com/juliakafarska/api/bitcoin-api
import requests

url = "https://bitcoin-api.p.rapidapi.com/balancesByAddress"

payload = {"addresses": ["16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe", "34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo"]}
headers = {
    "content-type": "application/json",
    "X-RapidAPI-Key": "YOUR_KEY_HERE",
    "X-RapidAPI-Host": "bitcoin-api.p.rapidapi.com"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

response:
{
  "note": "Balances for 2 wallet addresses",
  "count": 2,
  "data": [
    {
      "id": 14122055,
      "address": "16ftSEQ4ctQFDtVZiUBusQUjRrGhM3JYwe",
      "btc": 0.00525093
    },
    {
      "id": 25721113,
      "address": "34xp4vRoCGJym3xR7yCVPFHoCNxv4Twseo",
      "btc": 0.00111145
    }
  ]
}

Alternative using https://github.com/Blockstream/esplora/blob/master/API.md
import requests

address_list = ["bc1q7cyrfmck2ffu2ud3rn5l5a8yv6f0chkp0zpemf", "1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY", "19SXCX6jvQxzfYfzRRMxjLBkqrNt6BUSJ2"]
for addr in address_list:
    print(requests.get(f"https://blockstream.info/api/address/{addr}").text)

output
{"address":"bc1q7cyrfmck2ffu2ud3rn5l5a8yv6f0chkp0zpemf","chain_stats":{"funded_txo_count":874627,"funded_txo_sum":1002983034753356,"spent_txo_count":874417,"spent_txo_sum":1002858836755824,"tx_count":844034},"mempool_stats":{"funded_txo_count":3,"funded_txo_sum":2604371991,"spent_txo_count":3,"spent_txo_sum":2650678155,"tx_count":3}}
{"address":"1KFHE7w8BhaENAswwryaoccDb6qcT6DbYY","chain_stats":{"funded_txo_count":82575,"funded_txo_sum":535871315837629,"spent_txo_count":82540,"spent_txo_sum":535843538512098,"tx_count":82340},"mempool_stats":{"funded_txo_count":0,"funded_txo_sum":0,"spent_txo_count":0,"spent_txo_sum":0,"tx_count":0}}
{"address":"19SXCX6jvQxzfYfzRRMxjLBkqrNt6BUSJ2","chain_stats":{"funded_txo_count":1,"funded_txo_sum":43915252,"spent_txo_count":0,"spent_txo_sum":0,"tx_count":1},"mempool_stats":{"funded_txo_count":0,"funded_txo_sum":0,"spent_txo_count":0,"spent_txo_sum":0,"tx_count":0}}

i have script that checks one by one read line by line and tell us, with balance address and also range from 2010 to 2023, you can select range, also you can take output to a file....


text:
How to convert a single number into Private key in python

https://brainwalletx.github.io/#converter,
5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf
This private key  is generated from 1
If i do this other way on this same site, It gives me different result

I want a formula to convert This 1 into this private key(5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf) in python
Anyone knows formula or python code to do this ?

You can go to the chapter 4 but doing the whole thing from the start would be best https://github.com/jimmysong/programmingbitcoin

Using this Python library (I am the author)
>>> from cryptotools import PrivateKey
>>> i = 1
>>> prv = PrivateKey(i.to_bytes(32, ‘big’))
>>> prv.wif()
‘5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf‘

Thanks , Exactly what i needed

This code gets compressed key, Is there anyway to get Uncompressed from same way.
Thanks

The code above is uncompressed. For compressed use prv.wif(compressed=True)

It gives me different result for compressed key
for example [1]: https://i.sstatic.net/Ydbhn.png
This key is 769
But the script give me this key
[2]: https://i.sstatic.net/48GFY.png
What am i doing wrong
What change do i have to do to get KwDiBf89QgGbjEhKnhXJuH7LrciVrZi3qYjgd9M7rFU74sHUHy8S , from i = 769

I think the brainwallet site is padding to 33 bytes in the last screenshot so replace 32 with 33

If i do this other way on this same site, It gives me different result

Try entering 0000000000000000000000000000000000000000000000000000000000000001 and selecting Hex at the top and Base58check at the bottom.

I want a formula to convert This 1 into this private key (5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf) in python

https://www.google.com/search?q=python+base58check leads to https://pypi.org/project/base58check/ and many others.
Note that these libraries require that your value 1 be expressed as a byte array, not as a single decimal integer.

Remember that what you are seeing is not conversion of a single number into a private key but simply the same number presented in two different representations. That is, two different encodings. Note also that encoding is not encryption.

1 is the same number as 0x01 even though the latter is encoded as hexadecimal.

1 is the same number as 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf even though the latter is encoded as Base58check.

Any idea how can i convert 1 into the byte array and then convert that bye array into the privatekey 5HpHag...... I want to do all of these in python

You can also do it "from scratch" with just hashlib, binascii and base58 modules:
import hashlib, binascii, base58

pkeyhash = "0000000000000000000000000000000000000000000000000000000000000001"

pkeyvbytes = "80"+pkeyhash

firsthash = hashlib.sha256(binascii.unhexlify(pkeyvbytes)).hexdigest()

secondhash = hashlib.sha256(binascii.unhexlify(firsthash)).hexdigest()

createkey = pkeyvbytes+secondhash[:8]

WIF = base58.b58encode(binascii.unhexlify(createkey))

print(WIF)

>>> 5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf


text:
How do i differentiate between a scam and a real bitcoin miner?
Someone offered to trade for me through bitcoin. He said i should send a bitcoin to crytomine company then he is going to claim it from the company so that he trades it with a commission of 10% of profit within 48 hours.

A real bitcoin miner is a physical device you can touch. If you don't have that, it's probably a scam.

Bitcoin mining involves setting up and running highly specialized computer machinery called ASICs (application specific integrated circuits). If you are being told you will be 'mining', but are not setting up and running these machines yourself, then chances are you are being scammed. Pretty much every instance of 'cloud mining' through some website service is a scam.
Consider: you have an ASIC machine, that profitably prints money for you. Do you:
a) use that machine to make money? OR
b) rent the use of the machine to someone else?
If you chose b), then you must expect to make more money than a) by doing so. This extra money must come from the user that is renting the machine, which means the user renting the machine is going to lose money, net.
The reality is, mining seems complicated to new users, so scammers often pretend to run 'mining operations' when they are trying to scam people. Being a 'miner' makes the scammer seem knowledgeable and wealthy, so that new users will be lured in.

Someone offered to trade for me through bitcoin... with a commission of 10% of profit within 48 hours.

This is the second massive red flag. No legitimate broker would promise a commission of 10% within 48 hours. Professionally managed wealth funds aim for a smaller return than that, annually!
If that sort of profit was guaranteed, the broker would quickly become the wealthiest person on earth. With $1000 invested, after 1 year of 10% returns every two days, the broker would have ~$34,156,133,221. Obviously, this is completely absurd.

I know at least two cloud mining that aren't a scam, meaning they will really rent you a portion of their hashrate and share part of the profits. NOT meaning they WILL be profitable. I also think that renting part of the hashrate is a strategy to balance part of their investments risks. By the way profits for end user a rare. Most of the times your B vs A is true. Most of the people going to be scammed by a false or going to buy a true mining contract should just buy BTC and hodl for a decade or so. What let's em fall into scams is that mining (read printing money) sounds so sexy to noobs.

@Marco mining is an extremely competitive industry, if you also consider the extra overhead required to build and maintain a system that will facilitate users renting the mining rigs (ie, a 'cloud mining service'), it becomes quite obvious that the user renting the rig is not going to be making a net profit. Any miner renting their rig out realizes this (otherwise they would just mine with it themselves). That is scammy behaviour, regardless of there actually being a mining rig or not.

True. But I still see some CEO around blockchain events with no shame... :)