How can I send bitcoins with Bitcoin-QT using the API? I'm making a bitcoin-based online marketplace. I've been reading/studying the Bitcoin API commands, and some of the commands need "unlocked wallet". Does this mean a wallet without a passphrase?
I think it's vital that the wallet be encrypted at all times. Still, if I've understood everything correctly, I need to decrypt the wallet (at least for a while) to be able to send bitcoins to another wallet.
So how should I proceed? If someone on the website wants to take his/her coins on to another wallet, do I need to make it so the API removes the PIN or encryption from the wallet, sends the bitcoins and encrypts it again?
Is it secure to do so?

Oh, and I'm using Bitcoin-QT to handle the coins.

To send bitcoins using the API:

It is recommended to have some knowledge of AJAX if using this method

WORD OF WARNING: Using this method can cause large amounts of inputs being set as miners fees. I suggest you continue with caution and start by using small inputs.

That being said...

Using the commands listunspent, createrawtransaction, signrawtransaction and submitrawtransaction.

To access the Bitcoin-qt console:

launch your bitcoin client as usual and wait for it to load the blockchain and start up
click on 'help' in the menu bar (top right)
click on 'debug window'
select the 'console' tab

Use listunspent to get an array of you spendable inputs in your wallet
This is where you set you transaction fee: Use createrawtransaction to generate a transaction in the form createrawtransaction [{\"txid\":\"[txid of the input transaction]\",\"vout\":[vout that relates to the txid of the input transaction]},...] {\"[address to send your bitcoins to]\":[amount of bitcoins to send to this address],...} All inputs that are not spent in a transaction are used as miners fees.
Use signrawtransaction [the output of createrawtransaction] to sign your generated transaction Note: Your wallet must be unlocked to perform this command. If not type walletpassphrase [your passphrase] 21600
Use submitrawtransaction [the output of signrawtransaction] to send your signed transaction to the network to be included into a block

You can see your transaction by going to http://blockchain.info/tx/[txid output from submitrawtrasaction]


What is a good mining pool/payout model for infrequent mining? I usually mine only, when I do stuff using my PC so it is on anyway. So far I used Slushs Pool but they have a score based reward system, which seem to punish casual mining. If a long round ends >15 minutes after leaving the pool (due to shutdown the system) you'll probably get nothing at all. What are better payout models for the casual miner and what pools can be used?

There are multiple approaches to pooled mining, each with its own benefits and detriments. Assuming you are a dedicated miner who does not pool hop then the scenario you describe should be an "edge case" that should rarely if ever occur. That said, common payout schemes include:

PPS - Pay Per Share. Each submitted share is worth certain amount of BTC. Since finding a block requires  shares on average, a PPS method with 0% fee would be 50 BTC divided by . It is risky for pool operators, hence the fee is highest.
SMPPS - Shared Maximum Pay Per Share. Like Pay Per Share, but never pays more than the pool earns.
ESMPPS - Equalized Shared Maximum Pay Per Share. Like SMPPS, but equalizes payments fairly among all those who are owed.
CPPSRB - Capped Pay Per Share with Recent Backpay.
Prop. - Proportional. When block is found, the reward is distributed among all workers proportionally to how much shares each of them has found.
PPLNS - Pay Per Last N Shares. Similar to proportional, but instead of looking at the number of shares in the round, instead looks at the last N shares, regardless of round boundaries.
Score - Score based system: a proportional reward, but weighed by time submitted. Each submitted share is worth more in the function of time t since start of current round. For each share score is updated by: score += exp(t/C). This makes later shares worth much more than earlier shares, thus the miner's score quickly diminishes when they stop mining on the pool. Rewards are calculated proportionally to scores (and not to shares). (at slush's pool C=300 seconds, and every hour scores are normalized)

The important factor is that you avoid Proportional payout systems as they are vulnerable to pool-hopping so you will probably lose some portion of your revenues to hoppers on those pools. For your concerns, SMPPS, ESMPPS or PPLNS would be good choices, but there are other factors to consider and it is ultimately up to you to choose a payout scheme and pool that best fits your needs.


Why does the halving event take place every 4 years? So, as per my understanding - bitcoin halving takes place when 210,000 blocks are mined. And blocks contain transactions - and they contain the same number of transactions (more or less). So, as the popularity of bitcoin keeps on increasing, wouldn't more transactions take place daily?
And if that is the case, then more and more blocks would be mined every day. And bitcoin halving event would take place faster and faster.
The only way bitcoin halving event takes place around the same time every year would be if every block is holding more and more information as time goes.
What do you think? I am so confused.

as the popularity of bitcoin keeps on increasing, wouldn't more transactions take place daily?

Yes, scaling of Bitcoin is a recognised issue. For people who use Bitcoin as a currency, as its creators intended, the solution is mostly off-chain payment systems such as the Lightning network. For speculators and day traders who treat Bitcoin as nothing other than a speculative asset, the solution is off-chain trading on exchanges. It seems one likely outcome is that use of the blockchain will gradually shift to being mostly closing settlement of off-chain systems.

more and more blocks would be mined every day

Bitcoin code attempts to keep the rate of new blocks at a constant rate of one every 10 minutes. It does this by periodically adjusting the mining difficulty.
In practice the interval can vary greatly from block to block but over a long period the average is close to 10 minutes. Usually it is somewhat less and in some years significantly less. I think in 2010 it may have averaged around 7-8 minutes from memory. Nevertheless, the rate is moderated and doesn't increase in an unbounded way.
See What keeps the average block time at 10 minutes?

You seem likely to have some follow-up questions. Before writing them in comments, you will probably find answers by using this site's search facility, there is a lot of good information here already.


Is there a way to retrieve a list of all the addresses that have had activities from a extended public key? Another way to put it. I want to get a list of all the addresses that have been used and are derived from the same extended public key. Is this doable? Thx.

Yeah, using blockchain.info you can do that:

https://blockchain.info/xpub/Your Public Key Here


When does transaction output become usable? Say, I've generated, signed and sent raw transaction (via JSON-RPC) to the network. The call resulted in a transaction hash. When can I use the output of that transaction: when the transaction will be confirmed at least once or when it'll be in the blockchain?

When can I use the output of that transaction: when the transaction will be confirmed at least once or when it'll be in the blockchain?

First, if that transaction is confirmed once, that means it's in the latest block, hence in the blockchain, so the choices you present are essentially the same thing.

Second, you can actually spend the transaction output right away. Miners may include both your original transaction and the dependent transaction in a block, which means you would have the same number of confirmations for both transactions. Whether your wallet software allows you to do that is another matter entirely.


How does crypto exchange got supply of bitcoins? Let's take an example of Coinbase or Luno, who are their suppliers of bitcoins to be distributed to the buyers?

You have to think about it simply, its exchange service lets consider that they're exchanging potatoes for tomato instead of Bitcoin for money.

you've bought 50 kilos of potatoes from a farmer, a customer gave you 2 kilos of tomato for 1 kilo of potatoes and go on, the farmer here is mining pools which is the main source of bitcoins.

So I would say Mining pools and Bitcoin sellers, but there's no specific answer to that question so I've marked it as Primary opinion based.


Interested in BTC trade for IOTA How do I exchange Bitcoin for IOTA?  What's the best venue through which to secure IOTA ultimately as my end goal? Since that other company (it seems I cannot name them here) no longer works with US citizens, who do I interface with now?

You can trade with a neighbor that also installed both wallets ;) or use one of the exchanges... The bigger volume the better:
https://coinmarketcap.com/currencies/iota/#markets


What are these bitcoin nodes and what purpose they serve? Explain like I'm 5 years old and my other half of the brain is surgically removed :) I don't want to put a lot of stress on my brain

1.What are these bitcoin nodes and what purpose they serve?

2.and also why they are still running?

3.and does miners use them to mine or validate transaction anymore?

4.how bitcoind is related to any of them?

0-Bitcoin Core

1-Bitcoin Unlimited nodes

2-Bitcore nodes

3-Bitcoin UASF nodes

4-btc1 nodes

5-Bitcoin Knots nodes

6-bcoin nodes

7-Bitcoin Classic nodes

8-btcd nodes

9-Bitcoin XT nodes

10-TRB nodes

11-libbitcoin nodes

12-Bitcoin ABC

The rules of bitcoin, much like the rules of a board game, are fixed. In board games, there is an instruction booklet that tells you what the rules are, and anyone not adhering to the rules is breaking them, which is known as cheating.

Bitcoin's rules were laid down by Satoshi Nakamoto, its inventor, and its rules are enforced by each player (node). Nodes check if the blocks are constructed according to the rules of Bitcoin, and punish miners who construct cheating blocks.

Having played Catan quite a bit, I've found that some people enjoy playing with house rules. Some people feel that every player should start with at least one of each resource, for example. These rules can be enforced by the whole group, as if they were in the instruction manual.

The same is true for bitcoin. Some people feel that the Bitcoin protocol is better suited by having small additions to the rules, or notable omissions. These people are free to write their own software, which enforces their own rules on Bitcoin.

Some are just translations of the bitcoin instruction manual to another language. Some aim to change fundamental parts of the protocol, such as the btc1 nodes, or Bitcoin XT nodes.

edit: The most-used client is bitcoind, which is the command-line interface of "Bitcoin Core". Due to the fact that a majority of people are using this client, it dictates the current consensus rules (the rules of the game), and other clients either adhere to it, or risk getting "forked".

Node software has been politicized these past few years. This is a different topic altogether, and I recommend you google "the bitcoin scaling debate" for a primer.


Best place to read about the algorithms and protocols underlying bitcoin? I haven't been able to find a whitepaper or technical spec detailing the bitcoin algorithms and protocols. Google is flooded with too much hand-wavy nonsense. Can someone point me in the right direction?

Bitcoin: A Peer-to-Peer Electronic Cash System

by: Satoshi Nakamoto

That would be a good place to start.


Is it possible to spam the bitcoin network with 'dust'? Someone could buy or mine bitcoins, and send them in small transactions all day to spam the blockchain.

Is this possible? And could this mean the end of the trust people have in bitcoin?

edit:

And what if someone makes bigger than 0.01 BTC transactions from one of his address to another all day. Making thousands of meaningless transactions, those totally spamming the blockchain. That wouldn't even cost much I believe. Is this possible?

Such transactions will be subject to fees.  You can read about the fee schedule here.  The fees apply if the transactions send a small amount of coins, or send the same coins over and over (giving the transactions a low priority score).

The fee is set at BTC 0.0001 per 1000 bytes.  Thus someone who wants to spam the block chain with 10 MB will have to pay at least BTC 1 in fees.  That's about US$500 at today's prices, and it causes the block chain to increase in size by about 0.1%, which nobody will probably even notice.  If you're going to spend $500 on mischief, you'll get a lot more bang for the buck by spending it on eggs and toilet paper!


How can I calculate network hashrate for a given range of blocks where difficulty changes somewhere within the range? Not sure if the title is poorly worded, but here's what I'm looking to do.

If I have a range of blocks and I want to calculate the hashrate, I can do something similar to what is found here.

To take it a step further, I'd like to be able to calculate hashrate for a given number of blocks from the current block. Using the example provided above, this is rather trivial.

However, I'm running into issues doing this when the difficulty changes somewhere within the range of blocks.

Take last night as an example. Difficulty changed to roughly ~390M. Prior to that it was roughly ~267M.

How would I go about calculating an average network hashrate for a given range where the difficulty has changed within that range?

Thank you for the help!

Start by computing the total amount of work. Work is defined as the expected number of hashes that were necessary for a particular block. If a block's target is Target, its amount of work is Work = 2**256 / (Target + 1) (follows from the fact that Target + 1 in 2**256 hashes have a value lower or equal to Target). As the difficulty Diff is defined as MaxTarget / Target with MaxTarget = 65535 * 2**208, it follows that Work = Diff * 2**48 / 65535 = Diff * 4295032833.

So, for each block, look at its difficulty, and compute Diff * 4295032833. Compute the sum of all those values for all blocks in your time range.

Now divide that sum-work by the number of seconds your interval lasted. The result is your average number of hashes per second during that interval.

For very short intervals (less than a few hours), it is possible for block timestamp inaccuracy to be relevant. One way to avoid this problem is by starting off not with a range of blocks, but a range of timestamps, and choosing all blocks within that range, rather than estimating the time range from the range blocks.


Is it actually possible to install Bitcoin full node on a Raspberry Pi 3B+? A Raspberry Pi 3B+ has only 1GB of ram and this official Bitcoin Core page shows that minimum requirement is 2GB ram and 200 GB storage with 100MB/s read and write speed.

But I see a lot of articles where people installing full node on a Raspberry Pi 3 or even older models. Also I see some tutorials where they install full node and run testnet daemon and they attach 500GB+ external HD. Why would they need an external HD when testnet blockchain size is about 8GB.

I have a Bitcoin full node perfectly running on my raspberry pi 3B (of course, without mining).
The biggest constraint in the installation of bitcoin core (though there are also other implementation of Bitcoin protocol) is the initial blockchain download, because your machine need to verify each and every single transaction inside every block from the genesis block up to now. My raspberry with its poor hardware took about 2 and a half months to complete that procedure, but since that it has been running perfectly.
Speaking about the second part of your question, if you run a bitcoin full node on testnet it's probably for self-learning reasons or the will of doing some little tests before turning to mainnet, so it's convenient for you to already get the memory you will need for the real Bitcoin network.


Is PBFT a consensus algorithm? Can we consider PBFT (Practical Byzantine Fault Tolerance) as a consensus algorithm ?

And if yes, How does it work?

And is it similar to other consensuses such as PoW, PoS or PoA ? Or it is totally different?

And is it used actually in a blockchain platform? if yes, which one?

P.S. I heard that it is NOT scalable for large network, Is it true? And if so, is its scalability even worse than PoW?

PBFT is Practical Byzantine Fault Tolerance. It is a "classical" consensus algorithm that uses a state machine. Uses leader and block election to select a leader.

PBFT is a three-phase, network-intensive algorithm (n^2 messages), so is not scalable to large networks


Key pool in wallet softwares From my understanding, bitcoind/bitcoin-qt uses a key pool for their wallet, so when you create a wallet you are actually creating not just one but many addresses for sending/receiving transactions.

How about multibit or electrum? Do they also use a key pool? What are the advantages and disadvantages of using a key pool vs. using a single address for the wallet?

Bitcoin-QT with standard settings will keep 100 unused addresses in your wallet at all times. The goal is that backups will be future proof to some extent.

A key pool allows to create backups in bigger intervals

Every time you create a transaction, the remainder of the input balance is sent to a new address in your own wallet. If addresses were generated only then, you would have to create a new backup after each transaction, or be at risk to lose any funds associated with that new address if your wallet got lost. By keeping a pool of unused addresses in store, your backup will be sufficient for the next 100 transactions before you will be at risk of losing something.

To create a bigger key pool, with e.g. 10000 keys, the client can be started with the parameter -keypool=10000.

I don't have intimate knowledge of either multibit or electrum, but suspect that they keep a key pool for the exact same reason.

One vs. many addresses

Using many addresses, i.e. a new address for each transaction,

increases your privacy by making it harder to determine that your different transactions belong to the same person.
obfuscate which part of your transaction went to the recipient and which was the change.
create plausible deniability as sending funds to yourself looks the same as sending to another user.
By giving out a new address for each incoming payment, it is easier associate payments to specific senders. Say, you go out with a three business partners and each ends up owing you 0.10 BTC. How would you know who paid already, if you only received two payments to the same address?

Using only one address

allows your backup to last forever
reduces the overhead if people send funds to you more than once.
Your privacy, and the privacy of your business partners might be reduced.


bitcoin soft-fork how are the older nodes going to the verify new transaction? I know soft fork which is compatible with older rules, but how are the older nodes going to the verify new transaction?

for example :

block#100 there is a new rule transaction.

the miner who created block#100, it must be a new rule's miner? and how the older nodes verify new transaction?

You're confusing what happens during a soft fork and a hard fork slightly.

A soft fork is backwards compatible, meaning old nodes will still accept the softfork transactions.

Hard forks are not backwards compatible, meaning old nodes will reject the new hardfork transactions.

Think of it like this: there is a list of consensus rules. If you want to change the rules, there are two fundamental ways to do this: make the rules more strict (no longer allow something that was allowed before), or make the rules less strict (allow something new).

If you make the rules more strict, then all of the old nodes will still accept everything you are doing. This would be a soft fork.

If you make the rules less strict, then all of the old nodes will reject the new things you are doing. This would be a hard fork.


How to fund an account in a Stellar private network? I know, I can set-up a Stellar private network as described here. Once set-up, an account needs to be created as described here. The Stellar documentation says -

  In order to prevent people from making a huge number of unnecessary
  accounts, each account must have a minimum balance of 20 lumens
  (lumens are the built-in currency of the Stellar network). Since you
  don’t yet have any lumens, though, you can’t pay for an account. In
  the real world, you’ll usually pay an exchange that sells lumens in
  order to create a new account.

It goes on to say -

  On Stellar’s test network, however, you can ask Friendbot, our
  friendly robot with a very fat wallet, to create an account for you.

So, on the main network, lumens need to be purchased at an exchange. On the test network, there is the bot. What should I use on my private network?

Visit: https://galactictalk.org/d/735-is-it-possible-to-build-my-own-blockchain-private-blockchain-on-stellar/2

The stellar network doesn't use mining. It doesn't even have "blocks". I'm not sure what exactly you are looking for.
When you start a private network you get the root account key in the logs with 100 billion Lumens. It should work like the public network. If you want to remove the need for Lumens you would need to modify the software.


Can the transaction log history size scale? Four Reasons You Shouldn't Buy Bitcoins, Forbes.com:

  Scaling. The Bitcoin protocol requires that every node in the network
  download a copy of every Bitcoin transaction that has ever occurred.
  As Bitcoin has grown more popular, running the “full” Bitcoin client
  has become more and more resource-intensive. The last time I started
  up my Bitcoin client, it took several hours to download all the
  transactions that had occurred in the few weeks since the last time I
  ran it.

  To prevent things from becoming completely unwieldy, the Bitcoin
  protocol limits the size of each “block,” the basic unit of Bitcoin’s
  shared transaction register, to one megabyte. Since one block is
  created every 10 minutes, on average, this places a hard limit on the
  number of transactions the network can process each hour. Right now,
  the network is operating well below the limit. But it’s not that far
  below the limit. If the Bitcoin economy continues to grow rapidly,
  we’re likely to hit it in the next few years.

  Reaching the limit wouldn’t be catastrophic; the Bitcoin protocol has
  an elegant system of transaction fees to process the most urgent
  transactions first. But it does place some limits on Bitcoin’s
  long-term future. For example, it’s hard to imagine Bitcoin ever
  becoming a replacement for conventional credit cards. There are far
  too many credit card transactions for the Bitcoin network to
  accomodate.

Currently, every Bitcoin client knows the entire network history. This sums up to a few GB, which a modern computer can easily hold.

The number of transactions, however, is growing quickly. I roughly estimate than in a matter of a year or two, the total size on disk will exceed the abilities of a normal desktop computer.

How will the network function when the transaction history log grows beyond the powers of a normal desktop?

No, this isn't a likely problem for Bitcoin. Or, to be more specific, it is a problem that there known ways to solve.

First of all, there is a concept called a selfish client. Which means a client that can create and receive transactions, but doesn't maintain the blockchain. It's considered "selfish" because it isn't performing the work expected of a true node on the system: it only maintains the information needed for it's own transactions. These types of clients are already common in the mobile world today, where 8GB is already too much to handle.

But if we got to a scenario where the blockchain was too unwieldy for the typical client, we would also probably be in a scenario where the network already had a sufficient number of server nodes to handle the "network".

Second, Bitcoin already has the concept of discarding transactions once they are spent. (It is made possible by the way that transactions are stored in the block: via the Merkle tree.) It is essentially not implemented yet, but the concept is there for when it is needed.

It's not inconceivable that we might end up with three tiers of clients: selfish clients on our mobile devices, master nodes that have all of the transactions and can trace any transaction ever made, and hybrid nodes that do support the entire Bitcoin protocol but only keep a trimmed version of the blockchain that prunes transactions that have already been spent. See this question for some details about pruning : Is pruning transaction history implemented in Satoshi's bitcoin client? .


How can I send bitcoins to my coinbase.com account for conversion to USD? First, I am not a merchant and I don't really care to become one (for now.)  Recently, I sent some BTC to Mt.Gox, sold them and then conveniently found out that I now have no way of withdrawing my USD to my bank account from gox.

After a bit of research, everyone is suggesting that I sell my BTC on Coinbase and then withdraw directly to my bank account.  My problem is that I can't find an easy way to deposit into my coinbase account that I just created and verified.

Is this an easy process that I've overlooked or will I need to setup a shell, merchant payment system and send myself my one-off BTC payment so that I can sell my bitcoins for USD?

I actually had this same issue today.

You can find your BTC deposit addresses on coinbase.com under...

Account Settings / Integrations tab / Bitcoin Addresses (scroll to bottom)

Here you can add new addresses as well as "view all"

I hope this helps!  :)


What if two public keys have the same hash？ What if two public keys have the same hash? Although the chance is very very small, I am still interested in what would happen.

Suppose that Alice makes a transaction to Bob using Pay To Public Key Hash (P2PKH) style signature script.

But Carmen has another public key, and the hash of Carmen's public key and Bob's are the same.

When Carmen turns on the Bitcoin wallet software, is there any extra balance?

Can Carmen spend the balance?

In your scenario, Carmen can simply see and spend the money as if it was theirs.

The network does not have any way of distinguishing this event.


Can op codes be used instead of signatures? Are there any op codes or combination of opcodes that can be used instead of a digital signature when creating a transaction?

Existing signature schemes in Bitcoin are already implemented as opcodes (OP_CHECKSIG and OP_CHECKMULTISIG in particular), so this question's formulation seems a bit off.

If you don't mind a transaction whose outputs can be taken by anyone, this is trivial - you can just create an output with a script that does not use any signature checking opcodes.

Perhaps what you want to ask is Is there a way to create secure transactions without using any of the explicit digital signature opcodes?.

The answer to that is almost certainly no. You would effectively need to implement a digital signature scheme by hand, rather than relying on the provided ones. Digital signature schemes are remarkably complicated, and likely far beyond what is possible inside Bitcoin's current scripting language.


Is it safe to reuse a Bitcoin address? Besides the obvious privacy implications, and (according to a bitcointalk.org forum post) the fact that once an address is used your coins that rest on it safety depend entirely on the ECDSA safety (as opposed to your coins being secure if at least two of ECDSA, SHA256 and RIPEMD are secure for any address that were never used to send BTC) - are there any other reasons why it is a bad idea to reuse the same address (for sending as well as receiving BTCs) frequently?

There are both security and privacy related issues that arise from address reuse.  Based upon your question you are less concerned with the privacy implications and more concerned with the security implications in this question.  I will discuss security first before briefly mentioning why the privacy implications are greater than the security implications.

Address Security

Bitcoin addresses are derived randomly by generating a private and public key pair.  When an address is generated both the private and public keys are secret to everyone except the owner of the wallet.  At this point your address has 100% security assuming the device that it is stored on is not compromised already.  When you provide someone with your bitcoin address to send you funds they do not learn anything about the public or private keys even though the address is derived from the public key.  So far so good, right?

The first issue/security risk I will discuss is a specific implementation issue in a mobile wallet library.  It is worth knowing how a bitcoin transaction is structured to understand this issue but without getting too technical you may want to read this article about what happened when the same K value is used in multiple signatures.  When this issue arose it was trivial to derive the private key protecting the funds in question and attackers we able to steal a reported 55+ bitcoins.  As part of a bitcoin transaction the public key associated with the address is revealed to the network.  This allows the blockchain to validate that indeed that public key is associated with the address sending funds.  It also validates that the signature provided could only be generated by the private key associated with the public key which was now revealed.  If the user that were attacked did not reuse addresses and sent all of the funds stored out of this address to a new address after spending some of the funds, the new address would be 100% secret again.  This issue has been fixed and should only represent a concern if you are using a wallet that has not had a proper cryptographic audit.

The next class of security issues I will touch upon is side channel attacks.  These kind of attacks can become technical in discussion very fast so I will not go into details but essentially specific hardware platforms can be made to leak information about their current state thus allowing an attacker to determine random values the CPU will generate in the future.  This again allows the k value (also known as the ephemeral key) to be leaked and private keys can be recreated.   One such side channel attack know to target ECDSA is the FLUSH and RELOAD attack.

Although side channel attacks are unlikely to be performed on someone randomly without targeting it would be much easier to attack someone that is not using privacy preserving techniques.  Which leads me to briefly touch on the privacy aspects of address reuse.

Privacy Concerns

The first thing to consider when deciding whether or not to reuse your bitcoin address is that privacy not only impacts yourself when using bitcoin it also impacts everyone else that you transact with.  Using blockchain analysis it is trivial to determine which companies you may be doing business with, how much money you could be holding, as well as your complete ledger history of everyone that your address has transacted with.

There has been tracking attempts that also work to associate addresses with each other and "collapse identities" based upon transactions that are public for everyone to see on the blockchain.  Addresses that are downstream from your known address could be used to make illegal or purchases that could catch the interest of law enforcement and this could lead them to your doorstep because of association with particular transactions.

Read more about why you should not reuse addresses including 2 real world examples of unscrupulous activity that could occur if someone knew how much money you had stored or earned over a regular schedule (such as payroll).


generate/generatetoaddress what are this two rpc methods used for? can anyone explain what are this rpc methods used for:
1.generate
https://bitcoincore.org/en/doc/0.16.3/rpc/generating/generate/
from the introduction of generate mehod:

  Mine up to nblocks blocks immediately

but how? bitcoin is hard to mine, how can this method mine nblocks immediately?

generate nblocks ( maxtries )

Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.

Arguments:
1. nblocks      (numeric, required) How many blocks are generated immediately.
2. maxtries     (numeric, optional) How many iterations to try (default = 1000000).

Result:
[ blockhashes ]     (array) hashes of blocks generated

Examples:

Generate 11 blocks
> bitcoin-cli generate 11

2.generatetoaddress
https://bitcoincore.org/en/doc/0.16.3/rpc/generating/generatetoaddress/

the same question as generate method

generatetoaddress nblocks address (maxtries)

Mine blocks immediately to a specified address (before the RPC call returns)

Arguments:
1. nblocks      (numeric, required) How many blocks are generated immediately.
2. address      (string, required) The address to send the newly generated bitcoin to.
3. maxtries     (numeric, optional) How many iterations to try (default = 1000000).

Result:
[ blockhashes ]     (array) hashes of blocks generated

Examples:

Generate 11 blocks to myaddress
> bitcoin-cli generatetoaddress 11 "myaddress"

but how? bitcoin is hard to mine, how can this method mine nblocks immediately?

generate is only used on the regtest network, where blocks can be mined instantly.


Is my account balance publicly visible? If I'm sending someone my wallet address, am I making my account balance visible to him?

As far as I understand, all transactions are public, which means that if I know an address, I can reconstruct the current account balance via the blockchain.

If your business partner knows your address, they can learn the transaction history and balance of that address. Often it is possible to guess or deduce that other addresses also belong to you, but this requires a bit more effort and is less reliable. However, this certainly doesn't translate to your complete wallet's balance and activity to be known.

This is why Bitcoin users are advised to generate a new address for every business interaction they have and why generally Bitcoin software makes it easy to create new addresses.


What are the minimum fees for Ardor and Child Chain bundlers like Ignis and others? I couldn't find a chart of what the Ardor and related child chain fees are. What is the cost in Ardr, Ignis, and other child chains during mining/bundling?

The fee structure can be found on this fees chart for Ardor provided by Jelurida, the developers of Ardor.
There is no fee to mine, and no fee to bundle. But when you bundle, you are receiving child chain tokens, such as IGNIS, BITSWIFT, or AEUR, and then paying the forgers (miner-equivalent for Ardor) the respective fee in ARDR based on the chart that I linked. As a bundler, you get to set the rate that you would like, the maximum amount of fees you're willing to pay, and other settings.
Running a bundler is also a great way to convert ARDR into child chain coins because unlike using the Coin Exchange feature on Ardor where you can trade child chain coins and ARDR against each other, you won't be paying fees yourself for making the trade. It's not as fast though since it depends on the transaction volume on that respective child chain.

Transaction Type / Fee (ARDR) / Reasons

Default Ardor fee 1 permanent transaction
Default Child Chain fee 0.01 prunable transaction
New account fee 1 creates permanent global entity
Balance leasing 0.1 Ardor chain only, not frequently used
Ardor Coin Exchange 0.5 permanent transaction
Asset issuance 100 create permanent global entity, Ignis chain only, not frequently used, need to reduce scam assets
Singleton asset issuance 1 + 1 per 32b Ignis chain only, more frequently used, but still creates global permanent entity
Asset increase 10 Ignis chain only, rarely used
Dividend payment 0.1 needs processing, not frequently used
Set asset control 10 Ignis chain only, not frequently used, asset issuers only
Set account control 1 Ignis chain only, not frequently used
Cloud data upload 0.1 + 0.01 per 1kb prunable, but takes space
Poll creation 1 + 0.1 per option > 20 + 0.2 per 32b > 288b not frequently used, need to keep until poll is over, takes space
Phasing approval 0.01 per approved tx needs processing
Account info 1 + 1 per 32b permanent, Ignis only, rarely used
Set account property 0.1 + 0.1 per 32b permanent, Ignis only, not frequently used
Alias assignment 1 + 1 per 32b creates permanent unique entity, not frequently used
Shuffling (total) 0.12 takes space, but prunable, not frequently used
Shuffling penalty 10 IGNIS, 10 Bitswift must be affordable, but not negligible
Currency issuance 4 / 100 / 2500 creates permanent unique entity, not frequently used
Marketplace listing 0.2 + 0.2 per 32b takes space, need to keep until delisting, not frequently used
Marketplace delivery 0.1 + 0.2 per 32b takes space, need to keep Permanent message 0.1 + 0.1 per 32b permanent
Prunable message 0.01 per 1k prunable
Phasing appendix 0.01 balance independent, 0.2 balance dependent + 0.01 per 32b size depends on size and complexity, needs processing
Composite phasing appendix 0.02 + 0.02 per 32b + per poll fees determined by phasing complexity Referenced Tx deposit 10 refundable


How to open bitcoin source in IDE? After downloading bitcoin source from github I'l try to open it in Netbeans for Mac. Please tell how to open all bitcoin project for run it with breakpoints in IDE?

I can recommend the Qt Creator IDE or Xcode on OSX. The later has (since Xcode 8) problems auto-completing C++.

If you use Qt Creators IDE, you can also debug the Qt objects natively.

In Qt Creator, do the following:

Install all dependencies
git checkout https://github.com/bitcoin/bitcoin
./autogen.sh
./configure --enable-debug (maybe more)
Then, create new project in Qt-Creator "import project from existing
source".
Go to project settings / run, select src/qt/bitcoin-qt (or src/bitcoin) as executable
Happy debugging / coding.


Manual for Bitcoin-Qt on Mac OS X Is there a manual for Bitcoin-Qt on the Mac OS X?

Specifically, I'd like to move my wallet.dat to a different folder (a TrueCrypt volume) and if/how I may configure bitcoin.conf so that the software autopoints to that folder upon launch. Is it possible to have wallet.dat in one directory and the blockchain files in a separate directory?

Secondarily, I'd like to learn about all possible configuration settings - both from the shell prompt as well as from bitcoin.conf. Can bitcoin.conf contain just one or two lines for desired configuration settings?

Start Bitcoin-qt,
click help,
click debug window,
click show below command-line options,
click show details


How to decode private key from Android Bitcoin Wallet? I want to import my private key from the android's Bitcoin Wallet (the one created by Andreas Schildbach) but it can export it only in an encrypted way.

How do I decrypt the file so I can import the key to my Bitcoin Qt?

from: https://github.com/schildbach/bitcoin-wallet/tree/master/wallet

The backup file is encrypted using your chosen password. You can use OpenSSL to decrypt:

openssl enc -d -aes-256-cbc -a -in <filename>


Creating my own bootstrap.dat? Since I have been tearing down and setting up bitcoin clients a lot for some experiments lately, I was wondering whether there is a simple way to speed up the synchronization with the network. One method that comes to mind is the bootstrap.dat file distributed by some people. The problem is that the last 40'000 blocks, which are the most expensive to get and verify, are not included.

Now I was wondering how to create such a bootstrap.dat myself, from a good copy I have on another machine. Any idea?

Bitcoin Core contains a tool to do this properly (filtering out any orphan blocks, putting everything in the correct order — which will work a lot better than just concatenating the block files. It's documented in its own README, here: https://github.com/bitcoin/bitcoin/tree/master/contrib/linearize

In short:

Launch Bitcoin with an rpcuser and rpcpassword set in your config file, with the correct location as per https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File
Checkout the Bitcoin source from Github and cd to contrib/linearize.
Copy example-linearize.cfg to linearize.cfg and update it with your rpcuser/rpcpassword values, along with the maximum block height you want to output (max_height), and the path to your data directory (input), as well as the path to your desired output file (output_file).
Run ./linearize-hashes.py linearize.cfg > hashlist.txt followed by ./linearize-data.py linearize.cfg.


Upgrade to 0.21.0 - No incomming connections via Tor after upgrading I upgraded to 0.21.0 a couple of days ago and noticed I'm no longer getting incoming connections while using Tor as a proxy. Was fine before the upgrade.
'getnetworkinfo' shows "reachable": true, "proxy": "127.0.0.1:9050" on ipv4, ipv6 and onion.
I've tried setting 'connect=myonionaddress' on my second node it's throwing the error "connect() to 127.0.0.1:9050 failed after select(): Connection refused (61)". Not sure if there's any configuration change that I need to do since the upgrade?
The debug.log file shows "Got service ID removedonionaddress, advertising service removedonionaddress.onion:8333"

I think everybody using Tor with the newest Core has the same problem, including myself. There’s a Good explanation here why this is happening:
https://www.reddit.com/r/Bitcoin/comments/kzhhgk/bitcoin_core_0210_tor_v3/
My solution was to roll back (for now) to the previous version. It now works fine.
I still do not understand why this appears not to be backwards compatible with Tor v2. As the official bulletin release clearly states:
“This release adds support for Tor version 3 hidden services, and rumoring them over the network to other peers using BIP155. Version 2 hidden services are still fully supported by Bitcoin Core, but the Tor network will start deprecating them in the coming months. “


electrum get transaction amount command line How to retrieve transaction amount via command line? Seems gettransaction return hash which contains only some inputs outputs info without any amount.


Old receiving address I sent my Bitcoin to an old address of mine but can’t figure out how to receive it I’ve the address is not open in my receiving tab but is under file receiving addresses

can’t figure out how to receive it

Once a transaction has been created by the sender, receiving Bitcoin requires no action whatsoever on the part of the recipient.
It is understandable that the recipient would like to have their wallet show them a received amount - but that is of no consequence in terms of transfer of control over an amount of money, The transfer either happened or it didn't. Regardless of whether your wallet knows about it or not.
So either the transfer happened and your wallet hasn't found out for some reason, or the transfer hasn't happened yet. The former can happen due to a wallet not being fully synchronised or not being able to communicate with other nodes. The latter can happen when the Bitcoin network is busy or when fees are set too low.
You can find out which is the case by putting the receiving address into a few Blockchain explorers.

the address is not open in my receiving tab but is under file receiving addresses

That is normal. The receiving tab usually generates a new address for each transaction for privacy reasons.

Possibly related:

Why is my transaction not getting confirmed and what can I do about it?


How does `bitcoind` generate the private key? My question is how the bitcoin core client generates a (master) private key(s)?

I know from other wallets, that they take the mnemonic and generate a HD wallet master key. With the master key, the other keys can be generated.

To my question. How does the bitcoin core software do it? I've never seen a mnemonic there.

Does it use a mnemonic?
I know about the backupwallet command to make a backup.
Is there nothing like a mnemonic I can use? If there isn't, do I have to constantly do backups?

Bitcoind does not support BIP39, which encodes a seed (128, 160, 192, 224, 256 bits) in a mnemonic phrase, from which the 512b HD root seed is later generated via PBKDF2 (Password-Based Key Derivation Function 2). This 512b root seed is used to derive the (extended) master keys.

For wallets without BIP39, the 512b HD root seed is directly supplied as entropy, without the intermediary step involving an encoded mnemonic phrase and PBKDF2.

Backing up the wallet.dat file.
https://bitcoin.stackexchange.com/a/22722/90088

Amended:
Bitcoin Core wallets will deterministically derive new extended key pairs and addresses as wallet usage progresses, which is reflected and updated in the wallet.dat file. However, when restoring a wallet from an older wallet file, the wallet will (re)derive all standard child key derivation paths, whilst (re)scanning the blockchain to determine past usage of these keys in transactions, thereby recreating the last used hd wallet state. The wallet can be fully restored, even if the wallet file backup is not the most recent one because of this rescan.


Transaction Broadcast error zcash I can't broadcast the transaction to the zcash testnet. I will give the entire steps clearly. Could anyone tell me where I am doing wrong.This is my zcash address "tmRvLFZ3Lnz9vhd9bG2JuWakYESEi4ukxqs". Private key - "cSwoLKkeHSj3zaKAqiv8DXKXQVm18Ci3vwTvgrtPAS6a2YJ1HeRY"

step:1 zcash-cli listunspent 6 9999999 "[\"tmRvLFZ3Lnz9vhd9bG2JuWakYESEi4ukxqs\"]"
[
  {
    "txid": "8a1ce0ecc491ba2cb234674662769774ce81e4beaa7a7aff466aa62ea8b8345b",
    "vout": 1,
    "generated": false,
    "address": "tmRvLFZ3Lnz9vhd9bG2JuWakYESEi4ukxqs",
    "scriptPubKey": "76a914b1c61a54ae002ef35bf1fcdbdde9ea9e02b486bc88ac",
    "amount": 2.89999774,
    "confirmations": 16,
    "spendable": true
  }
]

step:2

    zcash-cli createrawtransaction "[{\"txid\":\"8a1ce0ecc491ba2cb234674662769774ce81e4beaa7a7aff466aa62ea8b8345b\",\"vout\":1}]" "{\"tmGrqWFJQJtYXFwm6b4ptKpDetNTWdpc3kX\":0.4,\"tmFHNDXpWYgRQ44FXPidCiiq1Rfx9gESuQ1\":2.39999774}"
output for step-2 "030000807082c403015b34b8a82ea66a46ff7a7aaabee481ce74977662466734b22cba91c4ece01c8a0100000000ffffffff02005a6202000000001976a9144e63b9f685635c97f578c2e94f4aba622b65d11a88ac1e1b4e0e000000001976a9143d171848a9caf0a64b7f069b116675bca56ac08b88ac00000000a52a030000"

step:3

zcash-cli signrawtransaction "030000807082c403015b34b8a82ea66a46ff7a7aaabee481ce74977662466734b22cba91c4ece01c8a0100000000ffffffff02005a6202000000001976a9144e63b9f685635c97f578c2e94f4aba622b65d11a88ac1e1b4e0e000000001976a9143d171848a9caf0a64b7f069b116675bca56ac08b88ac00000000a52a030000" "[{\"txid\":\"8a1ce0ecc491ba2cb234674662769774ce81e4beaa7a7aff466aa62ea8b8345b\",\"vout\":1,\"scriptPubKey\":\"76a914b1c61a54ae002ef35bf1fcdbdde9ea9e02b486bc88ac\",\"amount\":2.89999774}]" "[\"private_key\"]"
output :
{
  "hex": "030000807082c403015b34b8a82ea66a46ff7a7aaabee481ce74977662466734b22cba91c4ece01c8a010000006a47304402201607a0454a641dc28a81324dd292275780fde44bbdec4d95131d0be35bcd591f0220601161a481a4b690076febf5c1c7508cddfd1972fda432b9bbc55d87289beb9c012103472fba697de28693fea3ea2d7a0d744d164d6264f8c4f44648eb904162387fe4ffffffff02005a6202000000001976a9144e63b9f685635c97f578c2e94f4aba622b65d11a88ac1e1b4e0e000000001976a9143d171848a9caf0a64b7f069b116675bca56ac08b88ac00000000a52a030000",
  "complete": true
}

step:4

zcash-cli sendrawtransaction "030000807082c403015b34b8a82ea66a46ff7a7aaabee481ce74977662466734b22cba91c4ece01c8a010000006a47304402201607a0454a641dc28a81324dd292275780fde44bbdec4d95131d0be35bcd591f0220601161a481a4b690076febf5c1c7508cddfd1972fda432b9bbc55d87289beb9c012103472fba697de28693fea3ea2d7a0d744d164d6264f8c4f44648eb904162387fe4ffffffff02005a6202000000001976a9144e63b9f685635c97f578c2e94f4aba622b65d11a88ac1e1b4e0e000000001976a9143d171848a9caf0a64b7f069b116675bca56ac08b88ac00000000a52a030000"
output:
error code: -25
error message:

The Zcash testnet is currently in the midst of an upgrade. You need to upgrade your zcashd to at least 1.0.15, and it may be necessary to wait a while because the block frequency is artificially low at the moment.


Can't perform remote JSON RPC to my Bitcoin node (C#) I'm trying to perform a remote JSON RPC. It works fine using localhost but not if I try to do it from another computer.

Here's what I have so far:

            int index = 0;
        HttpWebRequest webRequest = (HttpWebRequest).Create("http://fakeip:8332");

        webRequest.Credentials = new NetworkCredential("fakeuser", "fakepw");
        /// important, otherwise the service can't desirialse your request properly
        webRequest.ContentType = "application/json-rpc";
        webRequest.Method = "POST";

        JObject joe = new JObject();
        joe.Add(new JProperty("jsonrpc", "1.0"));
        joe.Add(new JProperty("id", "1"));
        joe.Add(new JProperty("method", "getinfo"));
        // params is a collection values which the method requires..
        Dictionary<string, string> Params = new Dictionary<string, string>();
        if (Params.Keys.Count == 0) {
            joe.Add(new JProperty("params", new JArray()));
        } else {
            JArray props = new JArray();
            // add the props in the reverse order!
            for (int i = Params.Keys.Count - 1; i >= 0; i--) {
            }
            joe.Add(new JProperty("params", props));
        }

        // serialize json for the request
        string s = JsonConvert.SerializeObject(joe);
        byte[] byteArray = Encoding.UTF8.GetBytes(s);
        webRequest.ContentLength = byteArray.Length;
        Stream dataStream = webRequest.GetRequestStream();
        dataStream.Write(byteArray, 0, byteArray.Length);
        dataStream.Close();

        WebResponse webResponse = webRequest.GetResponse();

which gives this exception:

    Unable to connect to the remote server ---> System.Net.Sockets.SocketException:
A connection attempt failed because the connected party did not properly respond
after a period of time, or established connection failed because connected host
 has failed to respond fakeip:8332

I've tried using curl too:

   curl --data-binary
    '{"jsonrpc":"1.0","id":"curltext","method":"getnetworkinfo","params":[]}'
-H 'content-type:text/plain;' http://fakeuser:fakepw@fakeip:8332

curl: (7) Failed to connect to fakeip port 8332: Timed out

My bitcoin.conf:

testnet=0
server=1
rpcuser=fakeuser
rpcpassword=fakepw
rpcallowip=0.0.0.0/0
txindex=1

Anyone have any ideas?

Edit: rpcbind allows me to make the RPC query using C# but the curl method is still not working.

Running the following:

curl --data-binary
'{"jsonrpc":"1.0","id":"curltext","method":"getnetworkinfo","params":[]}' -H
 'content-type:text/plain;' http://fakeuser:fakepw@fakeip:8332

results in:

{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}

I get the same error for any command.

You'll need to specify an IP address to bind the RPC interface to. Since Bitcoin Core 0.18, it's not sufficient to have "rpcallowip=*", as it will by still default still only bind to localhost.

So add:

rpcbind=fakeip


Bitcoin Block Download frozen For 5 days now my block download has been frozen at 57%. I tried downloading a new wallet to a different computer (which did download all the way), but I can't figure out how to pull the information from my frozen wallet to this one so I can recieve my bitcoins. Or how to get the blocks to finish downloading on my original wallet. Any help would be much appreciated, I need my money asap!

Lets start with the version of the bitcoin wallet that you are running. Are you running the latest version 0.6.3?
Second, which OS are you using, It'll help us to tell you which files to delete in order to restart the chain download.

Delete the blockchain data and reload the chain.  !!! Do not delete the files wallet.dat, addr.dat and bitcoin.conf. Except for those, stop the wallet, delete all other files, restart the wallet.

The files you'll see and that you can delete are, e.g. blk0001.dat, blk0002.dat, blkindex.dat, *.log, peers.dat, the whole subdirectory 'database'


Bitcoin to Bitcoin Cash on Trezor Just sent bitcoin to my Bitcoin Cash Wallet on Trezor. How can I retrieve it? 12-06-2016

Use this website to recover your coinage: trezor.io/recover-coins


How does the network decide the appropriate rate at which to create bitcoins? In the debt based fiat system of currency currently being monopolized, the amount of money added into circulation can cause it to deflate or inflate in value.  How does the network calculate the proper rate at which to add more bitcoins?

The answer for @jtorba is not strictly correct.

Difficulty is the main control mechanism used to determine the amount of Bitcoins released over time. The amount of bitcoins released is according to the bitcoin era as defined here

Currently the system tries to maintain a release of bitcoins every 10 minutes - which is part of the config settings that all miners adhere to. To do this the code takes into account the average block completion time every 2016 blocks.

It is important to note that this is NOT affected by the number of miners, but instead affected by the computing power.

A block is discovered by a process of hashing - which is a repetitive computing process -  until a result is found that matches a rule. Obviously the FASTER you can repeat this process the better chance you have of finding the answer that fits the rule before anyone else. It is specifically designed not to matter how many computers you have doing this task.

The rule becomes increasingly difficult - hence the use of the word difficulty - and therefore more computing effort is required to cycle through the possibilities becomes harder.

This self adjusting process is the main mechanism that maintains the release of bitcoins to the schedule in the link above.


Number of bitcoins mined algorithm Is there a library to know the number of bitcoin mined at a given block number ?

There is a fixed rate for how many bitcoins are mined each block. The block reward halves every 210,000 blocks, see Controlled Supply.

Here is a short term bitcoin distribution projection from the Bitcoin Wiki:

To calculate the total coins for a given block, try:

coins.py

block = 210000 * 10
totalCoins = 0

subsidy = 50.0
for i in range(1,block):
    if(i%210000 == 0):
        subsidy = subsidy / 2
    totalCoins += subsidy
    #print i, subsidy, totalCoins

print totalCoins

Also, you might find this helpful: Deflation Calculator


Can zero-fee txs get into a block? What happens if a transaction is set to have zero fees?
Can it get into a block?

Also, if you updated a coin's code to accept zero-fee transactions, would this cause a hardfork?

(e.g. made tx's in certain denominations return a tx.GetMinFee() of 0)

zero fee txs get into blocks all the time. many pools accept zero fee txs that have sufficiently high priority. that is, the inputs are aged and of high value.


What is the value of these bitcoin certifications that have popped up recently? Are bitcoin related certifications viewed favorably amongst the bitcoin community? I work in a related field and I am interested in pursuing a certification to distinguish myself, but I'm not sure how valuable these things are.

For example the following organizations:

CryptoCurrency Consortium

Digital Currency Council

It varies.

The first certification you posted, CBP, seems to be broadly well-perceived. As for the second one, I cannot find anyone saying anything about it, besides that it exists.

  but I'm not sure how valuable these things are.

I'm not sure either. Similar to security guard training companies, these certification organizations are going to exist along a spectrum of legitimacy.

Personally, (and this is where we go from facts to opinions) I think the CBP test would be worth taking if you already have the knowledge to do so, but beyond that, you're probably better off with a certification in a related field, like RHCE.


Is the Bitcoin Core software managed by a central authority? Is the Bitcoin Core software managed by a central authority? It is in the context, that once a transaction is broadcast by a user, then is it centrally published at the application level (i.e Bitcoin Core) or it is propagated physically to every other user through the Bitcoin network?

It is propagated server-to-server and, with luck, eventually gets to a bunch of miners who will include it in a block. There is no central authority -- individual servers are free to propagate transactions using whatever rules they wish.


Bitcoint Core Gui will not display once index is loaded I have the most recent Bitcoin Core "QT" for 64 bit Windows running on my system, It is working from what I can tell via the debug log. The splash screen loads and displays the loading and rewinding of the index. And when, I gather, it reaches 100%, the window minimizes and will  not restore. It remains on the taskbar as a program running. The little app by the clock is there and a right click brings up a menu. But I cannot see the actual account details.

I am able to quit the program safely. I did so and reinstalled a fresh version but there is no change. The program worked properly, previously. Because of some hardware power problem recently in my region I have not always run the code.

Like I say, the code is working but the Gui screen simply does not display. I gather I can run bitcoind instead and use a CLI, but does anyone know of a way to get the GUI back?

If you go into the task manager (ctrl + shift + esc),  expand Bitcoin Core and left click and click maximize it will show up.


In Litecoin every single block is mined every 2.5 minutes, double spending? In Bitcoin it takes roughly 10 minutes for every block to be mined.
In Litecoin it takes 2,5 minutes.

2.5 minutes in Litecoin mean that transactions can be confirmed faster.
In Bitcoin these 10 minutes are not  coincidentally, it has been choosen also to prevent double spending.

Why does Litecoin allows 2,5 minutes and not, like Bitcoin, 10 minutes?
Is the probability of having double spendings in Litecoin not much higher when using 2,5 minutes ?

The probability is not dependent on the block time alone, it is dependent on the block time, and how many blocks you wait before considering a transaction complete.

For Bitcoin, generally 6 blocks is considered to be the point after which a chain reorganization that changes the block the tx is in is considered to be impractically due to the cost involved with gaining enough hashpower to roll back 6 blocks.

Due to this, most exchanges and merchants will require 6 confirmations before crediting your account (although, Bitcoin is by far the largest network in terms of mining power, so for certain use cases, even 2-3 confirmations can be considered enough).

Litecoin has a lower block time, and to guarantee the same security, receivers should wait for a greater number of confirmations before considering the deposit complete.

Ethereum, with a block time of 15 seconds, is even faster. Thus, many exchanges will wait for even more confirmations (I've seen up to 50 for ETH and token deposits).

The block time alone does not guarantee safety against double spends. Even a 10 minute block-time chain can be double spent if you only wait for a single confirmation.  To prevent double spends, you simply need to find the tradeoff point after which it is impractical for someone to roll back the chain.

In most cases, the actual confirmation count used is often less than this impracticality point, since for smaller chains it may require too many confirmations, leading to a usability issue. Thus, exchanges may settle for a lower number of confirmations than required for absolute safety, but still good enough to guarantee it in the vast, vast majority of cases.


Please explain WalletExplorer.com layout of data I am having a hard time understanding exactly what information is being presented here:
https://www.walletexplorer.com/wallet/Poloniex.com
I believe that this is the aggregating wallet held by the exchange Poloniex. On the left hand side (received) are incoming bitcoins to the aggregating wallet likely from individuals who are selling their bitcoins to the exchange in order to cash out. On the right hand side (sent) are outgoing bitcoins leaving the aggregating wallet likely due to individuals who are buying bitcoins from the exchange.
If this is correct, why is the balance decreasing when coins are received? The balance appears to be denominated in bitcoin, but exactly what does this balance mean?

You may try c-hound.ai for a more intuitive interpretation of wallet data. It goes a bit further compared to most common wallet explorers, by highlighting inter-address relationships, token balance, and more. I hope my suggestion will come handy for you.


How are the transactions chosen from the Mempool if every node has its Mempool? I have this scenario:

So whenever a wallet user is initiating a transaction, this goes as far as I understood into a Mempool. And that each node has its own Mempool.

I have some questions though: Do every node get all the transactions in their mempool, meaning it's like a syncronisez place where everybody can see the same transactions? If so, how does the rest of the network of miners know that the transactions they have chosen from the mining pool isn't already being mine by another miner?

Or each and every node get different transactions in their Mempools? If so, how is the transaction broadcasted? Does it go randomly to some miner's mempool?

Thank you for your patience!

When a new transaction is broadcast, it will be passed from the originating node to all available peers. Those peers will then pass it to all of their peers, and so on, until (hopefully) every node in the network has heard about the transaction. Each node can keep a mempool if they so choose, and that mempool will store all of the transactions they have heard about recently. Node operators can configure several variables in their software to only store a certain certain amount (in bytes) worth of txs, to only relay transactions that are above a certain fee rate minimum, etc.

The mempool of each node may thus be a little different, there is no consensus enforced on what is stored in the mempool of each node. In fact, a node operator may choose to not keep a mempool at all!

Miners will run full nodes that communicate with the network, this is how they hear about new transactions to include in the blocks they are mining. Once a new block is found, the miner will broadcast it to the network. As each node hears about the new block, they will work to independently validate the block and all of the transactions in it. Part of this process involves identifying which transactions are confirmed in the block, and removing those transactions from the node's mempool. Soon after hearing about a new block, each node's mempool will be updated to remove the now-confirmed transactions.

  Do every node get all the transactions in their mempool, meaning it's like a syncronisez place where everybody can see the same transactions?

There is no enforced synchronization or consensus or mempools, but many mempools will likely have many of the same transactions stored at any given point in time.

  ..how does the rest of the network of miners know that the transactions they have chosen from the mining pool isn't already being mine by another miner?

Chances are there will be a large overlap in the transactions stored in each miner's mempool. When working on a new block, miners will use transaction from their mempool, but it doesn't matter if more than one miner tries to mine a block with the same transactions in it. Eventually one of the miners will find a valid block, and upon broadcasting it to the network, the other miners will simply update their own mempools to remove the now-confirmed transactions that were included in the last block (in the same way any other node will). Then the process starts all over again, with everyone racing to mine the next block, again using the unconfirmed transactions they have in their local mempools.


Will I double my money after a bitcoin hard fork? Could anyone please explain to me how this fork will work?

Examples would be greatly appreciated. The way I'm understanding is, if I have 1 BTC on Coinbase, they will match it. So after the fork I will have my 1 BTC and 1 B2X (Bitcoin 2x). Let's just say I sold my 1 BTC, will I still have my 1 B2X to sell? Does this mean free money?

No, it doesn't mean free money.

When a cryptocurrency forks into 2 separate cryptocurrencies, then the market sets the value for each.

Much of the value of Bitcoin is based on several things, such as the existing base of businesses that accept it, the efficacy and reliability of the developers maintaining it, and the familiarity by people that use it.

After a fork, that value becomes reduced, as many users or businesses pick one or the other to use.

New value may be created by new functionality added by the changes that caused the fork, or overall value (ie the sum of both forks) may become reduced due to a loss of trust in the system.

A more reasonable expectation is probably that the overall value, between both forks, is roughly the same as before the fork, but becomes split between two.

However, given the speculative nature of a sizeable proportion of the market, any small change may trigger large market movements, so it's anyone's guess as to what will actually happen.

After the fork, if you sell your BTC, then yes you will still have your B2X to sell (assuming that the wallet service you're using gives you access to it, or that you run your own wallet).


I run Bitcoin Core 0.14.1, for Segwit they tell me to "upgrade" to 0.13.1. So confusing Short version of my question: I run Bitcoin Core 0.14.1. Will I be fully compatible with the segwit soft fork after Aug 1 2017 with this version? IOW, I can simply do nothing and be segwit compatible?

The long version of this same question:
I'm running Bitcoin Core] version 0.14.1. I upgraded to that several months ago. I have the full blockchain downloaded. I've been running core since 2014 with periodic upgrades.

I now see all the news about a hard fork and Segwit but finding clear information about how it affects me as a Core Node host and having Bitcoin Core wallets has been difficult and confusing.

The Bitcoin Core website tells me I can choose to "not upgrade" for segwit or I can "upgrade" to 0.13.1. They never say anything like "if you have any version above 0.13.1 you already have Segwit so you're good to go." I want to emphasize that I have not found anyone saying that having any version of Bitcoin Core above 0.13.1 means I'm good to go with the new soft fork.

Sorry, I don't feel comfortable making assumptions. Sure, I know it seems obvious that later versions should include what's in earlier versions, but there has been so much talk about this soft fork and so very little information about what people like me need to do who have a Bitcoin Core wallet and am running core so that I can use that wallet.

This Bitcoin Core page (Segregated Witness Upgrade Guide) says:

"The easiest way to prevent this problem is to upgrade to Bitcoin Core 0.13.1 or another full node release that is compatible with the segwit soft fork. If you still don’t wish to upgrade, it is possible to use a newer Bitcoin Core release as a filter for older Bitcoin Core releases."

"Full nodes run by a reasonable number of users and business to validate the payments they receive need to be upgraded to Bitcoin Core 0.13.1 or another segwit-compatible implementation in order to incentivize miners to follow segwit’s rules after segwit activates."

This is very vague. How do I know what release is compatible with the segwit fork? "Another segwit-compatible implementation", what does that mean? Sorry, it's not clear to me that this means that 0.14.1 is "another segwit-compatible implementation."

Nowhere on this page does it say to upgrade to 0.13.1 or later.

OK, it says "or later" in this paragraph with heading "Not Upgrading", but in a very confusing context:

"For this reason, after segwit reaches locked-in, it is recommended that you either upgrade your full node to Bitcoin Core 0.13.1 or later (or a compatible full node), or that you follow the “not upgrading” instructions in the Full Node section below to use Bitcoin Core 0.13.1 or later as a filter for your pre-segwit software."

I have no idea what this means, especially "a filter for your pre-segwit software."

So does having any version above 0.13.1 of Bitcoin Core (in particular 0.14.1) mean I have segwit and that I'll be on the new soft fork?

If I do have to "upgrade" to the earlier 0.13.1, how do I do that?

Yes, it means 0.13.1 or later. All versions of Bitcoin Core since enforce the SegWit rules. The upgrade guide was written when only 0.13.1 was available, but since then 0.13.2, 0.14.0, 0.14.1, and 0.14.2 were released. Version 0.15.0 will be released soon.

I've filed an issue to get the page clarified: https://github.com/bitcoin-core/bitcoincore.org/issues/411


Beneficial proofs of work I'm new to this community and a Bitcoin novice.

I believe to have understood the concept and purpose of proof of work but also, that the high energy consumption of proofs of work is a major problem of the Bitcoin (and other blockchain based) systems.

The puzzle that need to be solved for the proof of work has to be complex:

computing the cryptographic nonce (as used in the Bitcoin system)
solving complex differential equations
operations on dense matrices

I wonder if my impression is correct that these puzzles' only purpose is to provide authentication, esp. for the right to mine new bitcoins -  and that they are otherwise "useless".

More than that I wonder if there are attempts to define complex proof of work puzzles that fulfill other purposes that are more beneficial/useful/valuable to - let's say society - which would justify the high energy consumption.

You may compare this with Google's ReCAPTCHAs that next to authentication "assist in the digitization of books or improve machine learning".

Your first point is indeed right: The BTC puzzle is only useful for ensuring the security of the blockchain.

Onto your next question: One of the first attempts to define a "useful" PoW was Primecoin, created back in 2013. Additional research in this area is being done.

In defense of Bitcoin's PoW, some people have said that Bitcoin mining tends to use up energy that would otherwise go to waste. For instance, if a hydroelectric plant is no longer being used for its original industrial purposes, then it can instead be harnessed for BTC mining. Mining on fossil fuels is currently unprofitable.

Of course, a more "useful" PoW could harness this energy for something even better. But even then you have to weigh up the pros and cons of switching BTC/ETH to such a PoW function. And you'll probably come up short.


Why is Slush Pool recognizing my worker as offline? Just wanted to try out some mining but when I press start on GUIMiner Slush Pool dosn't recognize it. Right now I can mine at around 60Mhash/s, is that too slow or is it any other problem?

When you mine with less than 1 GH/s (1000 MH/s) most bitcoin mining pools will show your hashrate as zero. This is likely to happen at many pools even with 10 GH/s. This is because the current default/minimum worker difficulty in pools makes you find proofs of work very rarely with a GPU. This again gives the pool very little data to estimate your realtime hashrate. If the pool has a hashrate display that covers more time (like average hashrate over the last hour) then you will probably see something.

Why are pools using such high worker difficulty? To function better with ASIC miners. Today 1000 GH/s is a slow miner and less than 1 GH/s is basically zero. There is a popular miner these days that runs at 13500 GH/s.

There are some pools that offer special mining servers for low hashrate miners. In that case the pool may be able to display a realtime hashrate. But the question is whether they show fractional GH/s or round off to the nearest GH/s.

You can mine without a realtime hashrate display on the pool's website. Mining still "works". Technically. The real problem is that you mine so slowly that you never earn more than some "bit dust".


Must mining be profitable for Bitcoin to succeed? If no, what are the mitigations? It is clear that mining is responsible for securing the network, and it is incentivised by block payouts and transaction fees.

I've also seen discussions regarding different incentives for miners in the event block payouts and transaction fees are insufficient incentive for 51% of the good guys to mine the network.

Question

What are the current proposals (or theories) that will maintain a secure Bitcoin network in the event mining is not profitable?

If there are to be people that only mine Bitcoins for living, mining has to be profitable. However, it needn't be only profitable through transaction fees and block rewards. People could subsidize the miners if needed be. Moreover, miners could be providing some paid services while mining - for example giving priority to certain transactions, embedding some messages in the block chain (advertising?), or the like.

It would also be possible for various companies that profit form other sources than mining to run their miners at a loss. This would be similar to say, Google providing free email, social networking and web hosting, as they are gaining enough money from ads to soak up the costs. Moreover, some people could run some charity miners that would for example include 0 fee transaction or some other ones that would be shunned by normal miners. However, if such for-loss mining would be too popular, regular miners would have a smaller profit margin (higher difficulty to reward ratio). This could cause them to stop their business and leave the whole burden on the other miners.

In the end, miners have a semi-regular source of new Bitcoins. They can hoard them and sell them only when they have a profit. If they have enough money to get by for awhile, they can just not sell the coins at too low a value and eventually drive the price up. I'm not sure, however, how well this would work.


What is the current legal status of Bitcoin around the world? Has there been any concrete information about the legality of Bitcoin in any country?

Since any information can be injected into the blockchain, then if child porn / copyrighted material is injected into the blockchain, does this make Bitcoin clients illegal in some sense?

At this point, the legality of bitcoin remains largely untested. To date, there have been no legal actions brought against any bitcoin exchanges (which would likely be the first place for the legality of bitcoin to be tested, rather than end users) and multiple bitcoin exchanges are seeking legal clarification regarding the jurisdictions they are operating in.

Some non-profits including the EFF have chosen not to accept bitcoin at this point in time because of untested legal issues.


Confirmations in block and trasaction From the bitcoin RPC, both gettransaction and getblock returns a confirmation number in their response, are they always the same? Is there a case a transaction's confirmations isn't the same as its containing block's confirmation number?

https://bitcoin.org/en/developer-reference#gettransaction

https://bitcoin.org/en/developer-reference#getblock

Is there a case a transaction's confirmations isn't the same as its containing block's confirmation number?

No, by definition the number of confirmations on a transaction is the number of confirmations on the block it is contained in.


The Mystery: I've mined some BTCs with Bitcoin Core 0.9.0, however the system no longer synchronizes and in the blockchain the balance is zero I got some BTCs using a Bitcoin Core 9 version beta, from August to December 2019, they are listed in my history as "generated" and with several confirmations with one, the balance appears in my system, however when I put the key or the hash on a blockchain explorer there is no balance.
Another problem is that my system is stuck, it doesn't synchronize anymore, I've tried using a 0.20 and 0.18 Bitcoin Core, I copied the wallet to the new systems but then the transactions appear without validation, even synchronizing the system.
Does anyone know what I should do?
Below some screenshots

As outlined in the comments, there's a couple of possibilities here:

You downloaded a very old version of Bitcoin Core, and managed to end up on a private chain where CPU mining is possible, and the chain is still new enough that the block reward is 50 BTC
The program you downloaded is a Bitcoin clone and gives the illusion of paying out 50 BTC or more, while either stealing crypto keys from other wallets on your computer, or later on asking you to pay some kind of recovery or unlock fee to claim these mined coins.

In either case, there is no Bitcoin. The block reward has not been 50 BTC for many, many years now (it was 12.5 BTC in 2019, and is currently 6.25 BTC in July 2020). Regardless of what method you used to mine, it is simply impossible to have a 50 BTC block reward dated in 2019 on the Bitcoin mainnet.
In short, you're either being scammed, or are mining on a private Bitcoin network with no relation to the public mainnet.
As Murch said in the comments below, you should definitely NOT use any address generated by this software to receive Bitcoin from an external wallet, exchange, or other service. All of these will send you real, mainnet Bitcoin.
As your version of Bitcoin Core is, at best, on a private network, you will not be able to access any externally received coins until you move your keys into a legitimate wallet that connects to the public Bitcoin network.
At worst, you're running some form of malware, and any real coins sent to addresses generated by this software will be stolen by whoever wrote it.


Is there any way to make an UTXO that cannot be spent until a certain block #? In bitcoin, each transaction has an nLockTime integer to specify the earliest allowed block number/time that the transaction can be added to the blockchain. In addition, each transaction input has an nSequence integer that could theoretically be used to update transactions and know which is the most recent (although this functionality is currently disabled).

But is there a way to broadcast a transaction which is final and can be added to the blockchain immediately, but also make it so that its outputs cannot be spent until a certain block number/time? It seems like this would be a useful feature. For example, if I want to give my inheritance to be made available at the time my grandson/granddaughter turns 18, I don't think there is any way to do that in bitcoin except have someone hold the funds and give them to them at the time. Or if I wanted to give someone an allowance, I could just send funds at once for 3 months or so, and they would just show up in the son/daughter's wallet on a weekly basis.

So, just to double check, there's no way to do something like this in bitcoin, is there? Are there any security risks by allowing transactions like this? If there really isn't any way to do this, then maybe it's something to add to the hard fork wishlist.

If there is no way to do this with Bitcoin right now, is it because there is a serious flaw with such a system where an UTXO could be added to the blockchain that is not YET spendable?

I can think of two ways that such a thing might be implemented.

Supplement the bitcoin scripting language with OP_BLOCKINDEX and OP_BLOCKTIME opcodes, which just push the corresponding value onto the stack. These values would have to come from the block that spends the UTXO, though, not from the the block that included the transaction that created the UTXO. This would mean that any transaction outputs with these OP codes could not be spent with 0 confirmations, because these OPs would have no meaning in this context. (This method possibly adds too much complexity to the situation)
Or, similar to the nSequence field, we could add an extra few bytes to each output to denote when an output can be spent (block number/time). If not provided, it can be assumed to be 0.

No, there isn't currently any way to do what you describe without using a third-party oracle.

Yes, you may be able to do this relatively soon.  A soft fork has been proposed to introduce a OP_CHECKLOCKTIMEVERIFY op code` (CLTV), and what what I can tell it has strong support from the core dev team (but note that soft forks require miner support for implementation).

As Nick says, previous attempts were rejected because they proposed pushing the current block's height or time on to the stack like this:

<pubkey>       checksigverify  block           <data>    equalverify
<your pubkey>  compare to sig  current height  1000000   Only spend in block 1,000,000

Again, elaborating on what Nick said, the example transaction above would be valid in block 1,000,000---but if there was a chain reorganization, it might not be included in the new block 1,000,000 and so any transactions depending on it would be invalid.

The CLTV op code avoids this two ways.  First, it use the nLockTime value from the spending transaction rather than the block height or block header time value.  Since a transaction can only be included in a block if its nLockTime is equal to or greater than the current block height/time, this achieves the primary goal of allowing UTXOs that can't be spent until a particular time.

The other thing CLTV does is check values directly rather than pushing data to the stack.  This allows it to only implement a greater-than-or-equal-to check, so the transaction is always spendable after the specified height/time.

My guess is that the soft fork process to introduce CLTV will begin with Bitcoin Core 0.11, possibly sometime around July 2015.  (But, really, the core devs are unlikely to spend much time on CLTV until 0.10 gets released around January, so don't count on it.)


Why this transaction is valid? The before transaction is @ https://www.blocktrail.com/tBTC/tx/da58f6688b0727a7f1bf3eec899099bde1f18b9c7099f9d2c79556db238e623d

Its output script is "OP_HASH160 da1745e9b549bd0bfa1a569971c77eba30cd5a4b OP_EQUAL".

The current transaction is @
https://www.blocktrail.com/tBTC/tx/839b903b9f79c3372792ceb95917047c46d1b919ed1f6471f5a19d7c865ab32c?txinIdx=0

Its input script is "51".

I verified the transaction manually but it failed.
Why the transaction was accepted and confirmed?

The evolved stack is as below. What's wrong?
628850cb844fe63c308c62afc8bc5351f1952a7f = RIPEMD160(SHA256(1))

The transaction is valid. This golang code gives the correct result.

You need to HASH160 51, not 1.

Additionally, make sure you run the hash on 0x51, not "51" or int(51).


Can I claim my bitcoin gold if I have used my bitcoins few days ago? I had my bitcoins on blockchain.info when the fork happened. A few days ago I sold my bitcoins. Now I am wondering if there is a way I can claim my bitcoin gold? Blockchain.info support has said I can export my private keys and get them but I have no idea on how to do it. Please guide. Thanks.

You should be able to claim your Bitcoin Gold with your private key. The snapshot of ownership for Bitcoin Gold was taken on October 25th, if you had bitcoins at that time, you'll get Bitcoin Gold.

In order to redeem it, you'll need to import your seed/private key in a Bitcoin Gold wallet, but beware of fake wallets that just want to steal your coins.


What's the point of trading BTC if you're limited in the things you can buy If you're trying to make a profit by trading BTC... fine, I get it. What other reasons are there to trade BTC?

Well I guess there are three reasons I personally trade for.

Make a profit by buying BTC/fiat low and selling fiat/BTC high.
Potentially increasing the profitability of Bitcoin by increasing the coin volatility via trading.
Being a stakeholder in the currency of the 21st century.

Does this give you an idea of some of the motivations?


Reading Bitcoin Raw Transaction I want to understand Bitcoin data structure. So i try to understand a raw transaction in json format.
When i checked the blockchain.info API documentation, i see that input structure is defined for transactions like this:

"prev_out":
{
    "hash":"a3e2bcc9a5f776112497a32b05f4b9e5b2405ed9",
    "value":"100000000",
    "tx_index":"12554260",
    "n":"2"
},
"script":"76a914641ad5051edd97029a003fe9efb29359fcee409d88ac"

But when I query a transaction from blockchain.info, it seems differently:

"prev_out":
{
    "spent":true,
    "tx_index":8845778,
    "type":0,
    "addr":"1CfD77hupeUvFwBPxZ2fA8iyWmVwQY22oh",
    "value":10212000000,
    "n":1,
    "script":"76a9147fe34b97aeff4ab754770be5c8f12e2e95332fd488ac"
 }

Is there any document that clearly explains these data fields?

My current wonders:

What is the spent field?
There is no hash field at queried transaction, there must be i think?
What is type field?
Which fields are signed? The signature is generated by which fields hash?

I have been using this for a long time, and I always skipped the fields. Now that you mention it, here is a partial answer:

1.) I do not know.

2.) The transaction hash appears at the end of the list; it also appears in the link you provided.

3.) Another good question. I do not know.

4.) The fields which are signed come from the previous transaction where, basically, the whole data structure is signed with the exception that the "scriptSig" field is filled with the "pubkey" script.

There are three great sources of documentation on transaction structures:

1.) Bitcoin.org Developer Guide

2.) "Mastering Bitcoin" by Andreas Antonopoulos

3.) Bitcoins the hard way: Using the raw Bitcoin protocol

I hope this was beneficial.


Confusion of Confidential Transactions I'm reading paper of Greg Maxwell's Confidential Transactions, I understand the example about Pederson commitment and Range Proof, which assume the amount is interger (example of proof amount range in [0, 32) ). What I can't figure out is  how commitment and Range Proof work when the amounts are expressed using "decimal floating point where the digits are multipiled by a base 10 exponent"(just as the paper mentioned). It's means the amounts is floating point number,like 2.3728BTC ? How can a floating number multiple a point in EC? I thinks there are something important I missed out. Could anybody explain or give a example here to make it clear?

When we're talking about an amount like 133.7 BTC, we're actually talking about 13370000000 satoshis (13.37 billion units).

If you're using 32-bit rangeproofs in Confidential Transactions, you're limited to a range of 1 through 2^32-1 satoshi (42.94967295 BTC). To use a number as large as 133.7 BTC, you would need 34 bits at least (making the proofs larger and slower to create and verify).

What the section you're quoting is about is that CT supports scaling this number by a power of 10. Basically, the proof can (in the clear, for now) indicate that it is not dealing with satoshi units, but with millions of satoshis. Now a 32-bit proof can deal with ranges of 0.01 BTC through 42949672.95 BTC.

So the term "floating point" here simply refers to the fact that we're representing the number as 13370*10^6 satoshis rather than as 13370000000 satoshis. It does not mean we're dealing with fractional units.

Note: multiplying an EC point with a fractional number is technically possible in some cases, but not really used here.


What would stop this kind of attack? Many gambling services (and p2p exchanges) do not wait for confirmations before exchanging value (many realize their customers will not wait 6+ hours for a confirmation).

What's to stop someone from sending 10 BTC they don't have, assuming that the party they're sending it to will not wait for confirmations?

They don't wait for confirmations, but they check if a transaction has appeared in mempools of some miners. They could also just check if the preceeding transaction (the source of 10 BTC) exists on the blockchain.


If i pay 0.001 to cloud mining site such az minezone.io or bitbase.club or 99quick.cloud If i pay 0.001 to cloud mining site such az minezone.io or bitbase.club or 99quick.cloud, they give my balance or no

I wouldn't trust them at all.

Take minezone.io for example, they claim to be a London-based company. The company number they have on their "FAQ" page is for BITEXPLOSION LIMITED whose registration status is "Active — Active proposal to strike off". Being struck off is a bad thing. Their annual confirmation statement is four months overdue. That also is a bad sign.

Bitbase.club's website is an almost exact copy and also gives the same company number (i.e. BITEXPLOSION LIMITED)

The 99Click.cloud domain doesn't seem to exist.


Can I use wallet balance in satoshis as input for transaction builder ( bitcoinjs-lib )? Can I use wallet balance in satoshis as input for transaction builder using bitcoinjs-lib ?

If yes, how?

No. Bitcoins are not kept in addresses, but Unspent Outputs ("UTXO"). You must specify TXIDs and outputs indices ("vout"). Specifying amount to make a transaction is not needed, but BitcoinJS may ask you for it to calculate the change output and the fee.


BIP32 child derivation from another child I have a bit of conceptual problem here,
Let's say I have a BIP32 implementation. If I derive two subkeys (1/2/1/2) and (1/2). is it possible to derive (1/2/1/2) from (1/2) with a subkey of (1/2)? I tried with chain_code and some other attributes but couldn't do so. by theory it should be possible to do so.

{
   "BTC_address_uncompressed": "1Pgi2HfASCtdVRNvX9HAtExenob1P5XtND",
   "address_uncompressed": "1Pgi2HfASCtdVRNvX9HAtExenob1P5XtND",
   "chain_code": "2b8efcd0870f61cac59eada4a1134a4f85d6817dc9a3dd7bf05f36e6c441a86c",
   "child_index": "2",
   "hash160": "392c59e21bc90f9c64ecc231db10cb04536277d6",
   "hash160_uncompressed": "f8d53bbd2c19a6ba9e8f35acecea7c37e31f80b1",
   "key_pair_as_sec": "02f9f02c77c6941f6352a2dd0a49964855ca239f008cd3be82532dacda0a3c79cd",
   "key_pair_as_sec_uncompressed": "04f9f02c77c6941f6352a2dd0a49964855ca239f008cd3be82532dacda0a3c79cd3872f468b85780e4bdcf377d8edf489598db1c2599cda0b850485fca2dbfb2cc",
   "netcode": "BTC",
   "parent_fingerprint": "1d6a6638",
   "private_key": "yes",
   "public_pair_x": "113050249498765822977324374771814145675507826911953945709948991807419582282189",
   "public_pair_x_hex": "f9f02c77c6941f6352a2dd0a49964855ca239f008cd3be82532dacda0a3c79cd",
   "public_pair_y": "25532626935404182358748554952372223106065623765752497625888032090220560102092",
   "public_pair_y_hex": "3872f468b85780e4bdcf377d8edf489598db1c2599cda0b850485fca2dbfb2cc",
   "public_version": "xpub6DkSjhJroC5HcnATQeZbdVZ2jFvWFvRqtayUJrc3H7GQeZJkKnn1BzdjDXyfYybctt38hyhz6zCdwWUAV6RnZqPone2ogmbTURBWsEFijgB",
   "secret_exponent": "21957517685205718377964087536472375993731742179518736675030422350744044394236",
   "secret_exponent_hex": "308b83bc8496fba96b299ca060f8c4cd15201aef14319891118facee42fb56fc",
   "subkey_path": "1/2/1/2",
   "tree_depth": "4",
   "wallet_key": "xprv9zm6LBmxxpWzQJ5zJd2bGMcJBE61rThzXN3sWUCRimjRmkybnFTkeCKFNFRCnqUsSAPB6AP38ENJNqzwmi51KxsUpNU5Rns3UwNCNw93VWi",
   "wif": "Kxr5MqcX6p1kCHLYhAtDA8dsuihHC3YJRfQfzrPUi9DZAbv1co8g",
   "wif_uncompressed": "5JBfbdPYk1EJwfbLR49RxYBd1ASthZkLopfttAq96F6ZfSXB2uK",
   "y_parity": "even"
}
{
   "BTC_address_uncompressed": "1CpmMHVTTn49351P4miiJZ6Wmw7rDJbg3z",
   "address_uncompressed": "1CpmMHVTTn49351P4miiJZ6Wmw7rDJbg3z",
   "chain_code": "566d6d36816b37d1bc9f0f926c1bcf48b9bf6c63154f65be05092a7ce0bac35d",
   "child_index": "2",
   "hash160": "387e7a981a85ded4ad332ac22400d542de38a978",
   "hash160_uncompressed": "81b1f48274c505147b5bf587db589062b1b69f5b",
   "key_pair_as_sec": "02c2f7da1cdc57f27e145a9fda472bfdc16cfc5b4ee32ee222413b0d88edc965f1",
   "key_pair_as_sec_uncompressed": "04c2f7da1cdc57f27e145a9fda472bfdc16cfc5b4ee32ee222413b0d88edc965f1a42ae022c788b0979dd88be456fd1c978ff3b0106799bc17de4cd46d17832970",
   "netcode": "BTC",
   "parent_fingerprint": "35a566ae",
   "private_key": "yes",
   "public_pair_x": "88186609208940930858580461894832276236539662740019279303523484605501248464369",
   "public_pair_x_hex": "c2f7da1cdc57f27e145a9fda472bfdc16cfc5b4ee32ee222413b0d88edc965f1",
   "public_pair_y": "74255061673209624574278121782459859935947830070827127273487212667373296494960",
   "public_pair_y_hex": "a42ae022c788b0979dd88be456fd1c978ff3b0106799bc17de4cd46d17832970",
   "public_version": "xpub6AAW9FwEvZaNLKtYTx1vFA1R1dVQv5GwTXwqgCg6GXq7E3fKVz7aaNGLFVcHH9LpWgqUpJ7FRFcibtRWzJ1WegqzZyynr66KxDLUPcpjRNK",
   "secret_exponent": "88370307846732603980165533658065807515286167433444038693954586861070917075377",
   "secret_exponent_hex": "c35fd25e084c54afae5c7a9942f1374780bd2b8a55e4148c5615ea2ed84c81b1",
   "subkey_path": "1/2",
   "tree_depth": "2",
   "wallet_key": "xprv9wB9jkQM6C257qp5MvUut24gTbevWcZ66K2EspGUiCJ8MFLAxSoL2ZwrQEahDCk2EugHxu5w6p5z6cHLdk9yE9bC5axxbaT49Ccs4UUPTzb",
   "wif": "L3mVYhLfDx23vrSRdWYQgk1Myqga4cFXVepcFJ4EQ774e5GRFHXB",
   "wif_uncompressed": "5KJL9zdB282beaQS4jwhFttHY19xyZ17uiCEspN87bTkRJEHtZH",
   "y_parity": "even"
}

I was able to derive the first part from the second using the btcutil package from btcsuite:

package main

import (
    "fmt"

    "github.com/btcsuite/btcutil/hdkeychain"
)

func main() {
    xkey, _ := hdkeychain.NewKeyFromString("xprv9wB9jkQM6C257qp5MvUut24gTbevWcZ66K2EspGUiCJ8MFLAxSoL2ZwrQEahDCk2EugHxu5w6p5z6cHLdk9yE9bC5axxbaT49Ccs4UUPTzb")
    // go to child "1"
    child1, _ := xkey.Child(1)
    // go to child "2"
    child2, _ := child1.Child(2)

    pub, _ := child2.ECPubKey()

    serialized := fmt.Sprintf("%x", pub.SerializeUncompressed())
    fmt.Printf("Is Equal: %v\n", serialized == "04f9f02c77c6941f6352a2dd0a49964855ca239f008cd3be82532dacda0a3c79cd3872f468b85780e4bdcf377d8edf489598db1c2599cda0b850485fca2dbfb2cc")

}

Note the serialized uncompressed format is from the 1/2/1/2 node and the xprv is from the 1/2 node.

When you run this program, you should get "Is Equal: true".


A crypto-currency for supporting informal education? I am involved with Funoon (funoonfoundation.org), a non-profit working to organise informal learning spaces. These informal spaces are basically physical spaces where learning happens on a peer-to-peer basis, guided by a mentor/ tutor.

We are brainstorming on how to incentivise talented people to come in and spend an hour or so weekly with a learning group. We can't pay them (at least not to start with), and without a solid incentive, its hard to get things going.

So I am wondering, if its a possibility to create a crypto-currency that solely exists to pay out a small chunk to anyone who comes along to mentor/ tutor at a learning space. My knowledge on how a crypto-currency works is quite limited, so I am looking to get enlightened  on this.

It is possible. However, there are a few difficulties. Normally, cryptocurrencies are based on a proof-of-work (PoW) scheme which involves computing data which is hard to find but easy to verify. A collision-resistant hash function such as SHA-256 or Scrypt is an example of this, and is used as PoW for a majority of existing cryptocurrencies. Unfortunately, there isn't really a cryptographic way to verify that someone has been legitimately tutoring for a period of time, so the currency will have to be issued by a central authority (i.e. you).

This means that you will have to hold a significant portion (perhaps all) of the coins in the beginning (in cryptocurrency circles, this is called a "premine"). If you hold all the coins, then you would be well-advised to choose proof-of-stake (PoS), where people leave their wallets open and are rewarded coins at a rate dependent on their current holdings (called "minting"), which incentivizes people to secure the network. (Otherwise, there would be no miners to process transactions since there's no incentive to do so, and the coin would be dead.) Alternatively, you can premine something like 10% or 50% of the coins, leaving the rest to be mined just like Bitcoin or Litecoin on a decreasing schedule. Here PoW miners are willing to secure the network for you because of the block rewards.

The issue with premined cryptocurrencies is that many people don't trust a single entity with all those initial coins, so they are unlikely to gain much value. Thus your tutors might not be willing to work for essentially worthless coins. And besides, since you're going to have a lot of central control due to your premine, you might as well just create an in-house currency, kept track of on your servers, rather than a cryptocurrency. Maybe eventually have a online store where users can buy stuff using that currency.

Another alternative is to ask for Bitcoin donations (possibly from the students), and then pay tutors with that (or even have students tip tutors directly).


With sendmany, how to specify the "subtractfeefrom" so that I pay the fee, but it's not subtracted from any of the "inner transactions"? https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/sendmany/
If I don't want the recipient to pay the fee, but I also don't want to subtract the fee from any of the "inner transactions" specified (that is, I want to pay it myself), what do I do with the "subtractfeefrom" parameter?

From the documentation:

The fee will be equally deducted from the amount of each selected
address.
Those recipients will receive less bitcoins than you enter in their
corresponding amount field.
If no addresses are specified here, the sender pays the fee.

So it seems like you simply don't specify any addresses in that field.