How to generate multiple public addresses using one private key? I want to generate multiple btc addresses using one private key. I am using pywallet library but each child address also have the private key. Can I use one private key for multiple addresses (if they derived from the same private key) to create a transaction?

You can use extended private key, which is basically other form of expressing mnemonic words. It is string similar to normal private key, but is longer and begins always with "xpriv....". The idea is that you have extended private key and corresponding extended public key. The later enables to generate, say, unlimited amount of addresses and ext-priv-key enables to spend coins sent to that addresses.

If you have just single normal private key, there is no standardized way of generating multiple public keys.


Contracts: Will this be possible? I would like to know if this will be possible with Bitcoin:

Create a key with the following features:

Only be able to spend btc if a % of pre-definied keys allow it
The own of the key need for example 80% acceptance from pre-definied keys to be able to spend btc (same process to each transaction)
If 80% is not reached, nothing happens
Specify a time to people (pre-definied keys) vote agree or deny

The protocol already supports transactions where x out of y keys need to agree in order to spend the coins.

The protocol will never support transactions that change/expire automatically after some period of time, as this causes problems.


Spending transaction output with only xpriv key Is it possible to spend a P2WPKH transaction output, with only knowing the xpriv key and not knowing the specific private key that corresponds to the public key of the transaction?

No, you need the private key that the address in question was derived from.
There is no mechanism for the wider network to determine that an address was derived from a private key, that was derived from a specific xpriv. The transaction signature must be created using the private key that is related to the address in question.


Mining = Printing money Recently I got in a discussion with my brother over what bitcoin is and what mining is. He had never heard of it so I had to do my best to explain it all from the beginning. I had trouble explaining certain aspects of mining though. He only understood Bitcoin from the standpoint of it being disruptive and undermining or potentially destroying the US economy. He saw my actions of mining crypto currency as printing money at home and artificially inflating the US economy. I tried to explain that essentially it is the US economy and other fiat currencies that are the ones printing money and causing massive inflation and that Bitcoin in the long term does not suffer from that problem. I am having difficultly still though understanding the best way to explain to him where the money comes from when I mine, how it is different from printing money. Anyone else out there have a similar experience or know the best way to explain this?

Is mining gold creating money? It's called mining because work goes into it. The money that comes out of it is remuneration. When the FED increases (er, eases) money into our system it's done by adding a few digits to an account. There literally is no work that goes into that. I cannot make bitcoin with no work -- that's the primary differentiator. Gold and bitcoin have real work backing them. Understanding would be enhanced by a read through Bastiat's economic sophisms: https://mises.org/library/bastiat-collection . This book is also recommended: https://mises.org/library/mystery-banking


How Does One Make Money from Bitcoin Trading? Now, this is my disclaimer: I'm very, very inexperienced with trading and general concepts of finance.

The way I understand it, the only way to make money from bitcoin is either to mine them yourself, or to trade them.

Now, the way I see to make money from trading is to buy btc with dollars when they are at a certain value, then wait and hope that they rise in value, then sell them back for more dollars. How else does one "trade" bitcoins?

Can anyone give me a simple answer? Perhaps just some key concepts that I can look up for myself.

If you buy Bitcoins at one price and then sell them for a higher price, you make a profit of the difference between those two prices, less any commission that you paid. However, if the price goes down, you will be in the uncomfortable position of having to either sell them for a loss or hold and hope the price goes back up while risking higher and higher losses if the price continues to drop. Before the current rise to over $200, Bitcoins once dropped from $35 each to $2 each.

What I'm saying is that you should definitely not invest any money you cannot afford to lose, understand that you may have to take a big loss if you're forced to sell out when the market is weak, and also realize that the entire Bitcoin economy could collapse at any time.

The other issue you have to consider is how you're going to store your Bitcoins. You can store them yourself using the Satoshi Bitcoin client. But then if your computer is hacked or your hard drive crashes and your wallet isn't properly backed up, you can lose everything. If you use an online wallet service, like the one built into most exchanges, there is always the risk that the service will go out of business or steal your funds and claim you withdrew them.

There is huge upside potential, but the risks should not be understated.


How to create raw transactions with custom fees? I have a website where users can send and withdraw funds using Bitcoin. I would like to give them the possibility to use different fees (low, medium and high) instead of a fixed fee or to let bitcoind choose the fee. I can't setup  a default fee or be changing it at runtime because then if a user decides to use a high fee and a lower one, it could happen that the user with the high fee is assigned as low or vice versa.

Therefore, after researching I have come to the conclusion that it is necessary to build the transaction from the UTXOS that my node has. However, it is difficult for me to finish understanding how to carry out this task. I will give an example to explain my problem:
If the node UTXOS is 1BTC, a user has 0.1 BTC in the service wallet and wishes to withdraw 0.07 BTC. I understand that the steps to be taken would be the following:

List all unspent transactions
Select one or more inputs to create the transaction
The fee is calculated as the subtraction between the total of the inputs and the outputs

My doubts at this moment would be:

If I understand correctly, for each incoming transaction we have, we will have an unspent transaction that will allow us to spend the available funds; Then, as long as you have in a database the correct balance to each user (updating that balance with the corresponding fees when withdrawing  funds), so I should only use the same UTXO generated by each user when depositing btcs Or is it possible to use other UTXOs as long as the quantity is the same?
I have read in bitcointalk that the inputs of a raw transaction must be less than or equal to the outputs of that transaction. Is it not possible to use inputs higher than the outs and "return" the surplus funds again to a wallet of my node?
How can I calculate the fee used? I mean, I can decide that I want to use X satoshis/kb but how can I calculate the fee that the transaction will need before I create it? Because if I understood correctly, the size of the transaction I get once I have created such transaction. I do not know if there is a way to perform the calculation that the transaction will occupy in bytes / kilobytes

I have not found too much information about it, so if anyone can help me I would appreciate it.

so I should only use the same UTXO generated by each user when depositing btcs Or is it possible to use other UTXOs as long as the quantity is the same?

This is up to you, although it would probably be safer to only spend the users deposit UTXOs to make sure nothing has gone wrong (e.g. private key leak and the coins have ready been spent). But as long as the user gets the right amount of bitcoin at the end, it doesn't really matter.

  I have read in bitcointalk that the inputs of a raw transaction must be less than or equal to the outputs of that transaction. Is it not possible to use inputs higher than the outs and "return" the surplus funds again to a wallet of my node?

I believe you have misread the information you found, or it was wrong. The inputs of a transaction must be greater than or equal to the outputs, otherwise you would be somehow generating new coins. If the inputs are strictly greater, the difference is given to the miners of the transaction as a fee. To "return" the surplus funds, you need to simply make a transaction output which sends the coins back to you, known as change.

If you generate a new transaction manually using bitcoin RPC calls, it will automatically estimate the fee itself. To use a custom fee rate, you can set the feeRate in the FundRawTransaction call. You can also set the transaction rate for all future transactions while the wallet runs using SetTxFee.


Can Litecoin & Bitcoin have overlapping Transaction Ids (txid) Im currently coding my own transaction lookup page for cryptos. Since Litecoin and Bitcoin are so similar to their txid. I wanted to ask if its actually possible that these 2 currencies have overlapping txid's. I know that Bitcoin uses sha256 & Litecoin uses scrypt.
Let me know, im really interested.

Litecoin uses Scrypt as its mining algorithm, but transaction identifiers (txids) are still produced using SHA256d. Litecoin started with a different genesis block, so there is no overlapping history in the blockchains.
It is extremely unlikely for any transactions to ever collide in their txids, simply because 2256 is such an extremely large digest space, whether that is within Bitcoin or across Bitcoin and Litecoin.


What would happen if you send bitcoins to a non-existent Bitcoin address? If one were to send bitcoins to an address that has not been created yet, what would happen? Would the coins be lost forever? Would they just sit there until the address and key pair are generated?

There's no such thing as a "non-existent" address.

Other than valid addresses created by a client in which the private key is kept secret there are also are:

Invalid addresses (which will fail the client's sanity checks and thus cannot be used when building a transaction)
There are also valid addresses in which no key exists.  The private key is required to spend the funds.  If the private key was lost or one was never generated (such as for 1BitcoinEaterAddressDontSendf59kuE) any amounts sent to that address are lost and can never be spent.  There is no way to know if a private key exists for 1BitcoinEaterAddressDontSendf59kuE or if it was a purposely created throw-away address.
There are also valid addresses in which no key can exist.  An answer to a related question provides an example.

There is no way to know for sure that a valid address has no private key.  What is known is that a program like VanityGen would not be able to create an address that includes many readable words like the address 1BitcoinEaterAddressDontSendf59kuE contains using the type of computational capacity that exists today.  So it can be assumed beyond any realm of possibility (but not absolutely, positively 100% guaranteed) that bitcoins sent to that address are gone for good.

Related:

Can a bitcoin be destroyed?
How to generate a valid bitcoin address for destroying bitcoins?


Blockchain transaction goes missing when searched from a few sites So I have an unconfirmed transaction since almost a week now.
The transaction ID is fd82fb9711afc48623fa13fa3963121f88160afe56fc968feaf02e5f73e7b764

This is due to the fact that exchange cex.io to save money bunch a huge number of requests in a single transaction which effectively brought down the satoshi/byte.

Today when I searched for the transaction in a few blockchain sites it says transaction Not found. Sites like blockchain.info show the transaction but multiple sites like live.blockcypher.com, blockchair.com, blockexplorer.com etc all show transaction missing.

What does this mean? Is it that my transaction will be dropped finally? I prefer it being dropped as this will never get confirmed. What is the sure way of checking if a transaction is dropped?

The transaction still shows on blockchain.info:
https://blockchain.info/tx/fd82fb9711afc48623fa13fa3963121f88160afe56fc968feaf02e5f73e7b764

You can never be sure a transaction is completely dropped because every node maintains its own mempool with potentially different rules for dropping transactions. And you never know, it may be confirmed any time despite the fee. cex.io who sent it is the only ones (other than miners) who can do anything about it anyway, so perhaps contact them, but likely you will just have to wait.

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


Using bitcoinj to discover peers and download the block chain I'm sorry everyone, I have looked and stared at the API and I'm coming up with nothing.

I've got a public static void main (naturally), but have no idea how to:

Connect to the network
Download the block chain
Navigate through it.

The purpose of this is to keep the block chain as a record of transactions and perform reporting on my own transactions. I don't have my wallet on the same machine.

Unfortunately for me, my ability to read the api is still underdeveloped, and the various pages I've seen don't really go step by dummy step.

Most important of the above steps is, how to get the block chain...

The class WalletAppKit is a good start. Here's a snippet of code that dumps the most recent block, you can probably take it from here. It will take a while to download the block chain and then it will print out the most recent transactions.

public class DumpLastBlock {
public static void main(String args[]) throws Exception {
    WalletAppKit kit = new WalletAppKit(MainNetParams.get(), new java.io.File("."), "test");
    kit.startAndWait();
    BlockChain chain = kit.chain();
    BlockStore bs = chain.getBlockStore();
    Peer peer = kit.peerGroup().getDownloadPeer();
    Block b = peer.getBlock(bs.getChainHead().getHeader().getHash()).get();
    System.out.println(b);
}
}


64: too-long-mempool-chain I am using bitcoind json rpc api to send bitcoin to multiple bitcoin addresses. I am using sendrawtransaction. When i have 24 unconfirmed payments sent from my account, i can't send anymore because i get this error :

  64: too-long-mempool-chain

I have increased the maxmempool to 1500 but it still doesn't fix it.

root@B2:~# bitcoin-cli getmempoolinfo

    {
      "size": 3946,
      "bytes": 1789073,
      "usage": 6043088,
      "maxmempool": 1500000000,
      "mempoolminfee": 0.00000000
    }

I use Ubuntu on a 32GB RAM , 4TB HDD server.

Any ideas on how to fix it ? I want to be able to create for example 300 unconfirmed transactions and not to receive that error.

You will not be able create unconfirmed chain for 300 transactions. Bitcoin core default limit is 25 transactions. In case you modify this parameter on your local node, network will not accept tx chain longer then 25 tx.  You have to rebroadcast transactions again after your first batch (25) confirmed.


How much will difficulty increase when ASIC miners become generally availible in the coming months? I am considering buying a 5/Ghs Butterfly Labs ASIC miner. My question is, will the difficulty increase caused by large quantities of ASIC miners being shipped in the coming months make the miner in question unprofitable?

I'm guessing this has now been asked like a million times.  Exponentially at first - once hw is available and it becomes more mainstream for the average person to buy asic hardware and setup at their own house...we will see difficulty plateau at a steady rate.  However by the time the plateau occurs, most 50GH/s hardware will only be able to mine a few USD a month...people will have already shifted over to alt-coins and GPUs will be targeting Scrypt Related stuff by that point.  I think we will see a shift of asic hardware from smaller groups  being used on other sha256 altcoins such as PPC, TRC, and FRC.

I predict Difficulty will hit 120 Million by December 300 Million by June and 1 billion by Dec 2014 at the next block reward halving event.  This won't be because of the small guys I mentioned in the prior paragraph either...difficulty will steadily rise and plateau because there will be dozens if not hundereds of commercial medium and large scale mining operations that came online to 'milk' the system.


What possible explanation could there be that Bitcoin Core on Linux Mint claims to but does not save the wallet backups? Linux Mint. Bitcoin Core 0.21.0.
I go to "File" and "Backup wallet", then select any location. I've tried with /home/a and /tmp and others.
Every time, Bitcoin Core says that the file has been successfully saved to the location I picked.
Then I look at that location in the GUI file manager, as well as in the terminal. THE WALLET .DAT BACKUP FILES ARE JUST NOT THERE!
I swear I'm not making this up and that I've enabled "Show hidden files" and tried everything to make sure that I'm not doing something wrong.
The files just are not saved, even though Bitcoin Core claims that they are. Why?
They are just not there on my file system. The only wallet.dat that exists is the actual one that Bitcoin Core itself saved, and it has put that in: /home/a/.var/app/org.bitcoincore.bitcoin-qt/data/blablabla/wallet.dat
At this point, having tried and asked and searched so much, I'm starting to truly question my sanity as well as the QA of Linux/Bitcoin Core.
This is even worse than various file nonsense in Windows. Is there some secret, very well hidden setting that I need to enable to "actually show the files" or something? Beyond "Show hidden files"?

What possible explanation could there be that Bitcoin Core on Linux Mint claims to but does not save the wallet backups?

Possible explanations include:

The path to the saved file is not what you think it is

using a relative path rather than an absolute path
using a chrooted program

Some higher level of security is preventing you seeing the files

SELinux?

There is a bug in Bitcoin core. This seems unlikely but if you can reproduce the behaviour on another machine you could document the exact circumstances in a bug report.

footnote 1
All normal Linux systems have a large number of default users and not just the one you use to log in normally. If you cat /etc/passwd you'll see a list. It will include a root user (and around a dozen others) unless the system has been substantially modified from the typical arrangement.

footnote 2
You can make your own backups of the wallet.dat but, for extra reassurance, you could practice extracting the private key using the debug-console then importing the data into a new wallet (of any type) on another computer and verifying that you can create spending transactions there.


What happened to Bitcoin testnet? What happened to Bitcoin testnet?
Confirmation time is very short.

10 confirmation occurred in three minutes.

I use Bitcoin core v0.16.0 (64-bits)

The Bitcoin testnet has a very low difficulty. Usually there are few people who mine on testnet. However, occasionally there will be enough people mining on the testnet for the difficulty to increase. But when those people go away, the difficulty is too high for the remaining testnet miners.

To combat this, there is a special rule that resets the difficulty to 1 in order to keep the testnet running. Unfortunately the way that this rule works allows large miners to game it so that the difficulty is constantly low.

What we are currently seeing on the testnet is exactly that. Someone with a lot of hashrate is mining on the testnet and gaming the difficulty to be very low. This means that blocks will be found very quickly until this person stops mining on testnet.

Nothing is wrong with the testnet, and there is nothing wrong with your node or the Bitcoin Core software.


I mined in early 2010 with a cpu miner and just found my keys after forgetting all thease years, no joke need info please who is the best most reputable bitcoin recovery company?
I have added details and questions about our situation below
Thank you
And God Bless

what was the mining program from the devs back then? I remember a pop up kinda like a dos window and it dispalyed the key and said somthing like write this down we will not give it to you again...
I also remeber a pass sentance proram that could be used to recover somthing if you entered in you full sentace string..

I have been out of crypto since I mined a few blocks way back then and I have my keys so do i just download and sink the wallet first?
remeber I did this long ago and was hoping to located the mining program from way back then to read the readme and refresh my memory.
Also back then you could contact a dev to help you,,
thanks in advance for helping out a old man trying to pay a few bills.

Sorry guys I am old sick with cancer so I do not want anyone to think I am lazy to ask questions like this. I believe what I found are my entropy codes. I remember seeing a sit down report on CNBC back in the day about Silk Road and weather or not bitcoin was a legitimate coin ect and they spoke for a good bit at length and they told you where to download the program and I thought the blocks was 50 at a time? It was a long time ago. I had ignored the boom from a few years ago to embarrassed and to and sick to care what ever happened to my codes / keys until I found my old drives and then my old codes. I do not remember it being a pool but if it was my guy is saying it was from the dev teams or team. It was a pop up miner and it would not have much on he display in the small little box. Just your mined coin count and a splash code that said something like write this down you will not get it again and will need it for us to help you recover your coins ect.

I think in late 2010 the first mining pools emerged. Could it be that you have been contributing your CPU Power to a mining pool and this was your credentials. If that was the case and you never cashed out your Bitcoin I guess you will not be able to access your coins unless you figure out which pool it was and see if the pool still exists


how is blockchain data stored and accessed? Can blockchain data be stored in a relational database? If so what would the schema be? I know blockchain itself is a data structure, but how is the data stored? In JSON files? In a RDBMS? in CSV file? What do you see in the wild? I'm looking to see if I can implement something for a case study in a RDBMS which we are required to make use of.
Is there any example of a schema for a given blockchain with tables I can find? (I started creating my own and I think it's reasonable).

Blockchain: Chain of blocks
+++++----------++++---------++++++---------+++++++
Who creates the blocks? Miners
Who validates, saves and relay these blocks? Full nodes
https://bitcoin.stackexchange.com/a/103172/

Different full node implementations for Bitcoin: Core, btcd, bcoin, gocoin, libbitcoin, knots, etc.
Database used by Bitcoin Core: Bitcoin Core stores the transaction-journal in groups of consecutive blocks in a series of large files whose format I believe closely matches the form used in the Bitcoin network protocols. But there is no prohibition on other software products doing something quite different.
https://bitcoin.stackexchange.com/a/98830/
Berkeley DB and SQLite are used for wallets


What is the best way to download a "recent" UTXO set snapshot? I am using bitcoinj to listen for payments. I need a way to maintain the entire UTXO set in a local database.

Can bitcoinj be used to download every block (I think it downloads only recent blocks and headers for older blocks)?
I don't need to use bitcoinj or even Java for creating or maintaining this database if a better solution exists. Is there anything like this?

Ideally what I want is a wallet that downloads only the UTXO set without downloading the entire blockchain (due to bandwidth limitations) and maintains it from then onward. This needs to be the entire set, not just for the addresses I own.
Additionally I need an API that allows for following queries:

Given a UTXO, check if it is present in the set.
Given an address, get me all the UTXOs for it.

I think that it is currently not possible to validate a given UTXO set without downloading the entire blockchain, so some solution in this regard would also be appreciated.

Yes, by default bitcoinj downloads full blocks, from the Genesis. Only if you connect a wallet it uses optimizations like checkpoints and filters.

Just downloading the UTXO set (in a trust free way) isn't possible, because the Bitcoin protocol isn't designed for that. You can get UTXOs from block explorers and Electrum servers, but it will be without crypto proof.


How do I own my bitcoin address? I am a bit new to BTC.

I bought few via Virwox and it tells me I have an address. People can send money in BTC to that address.

I also downloaded MultiBit on my Mac and I got another address.

But how do I actually own those addresses? I'd like to see some technical reference on this.

Thanks,

You actually own a private key, which generates the public address which is given to you.

For example, let's say your public address is:

1E4CwvCLFkhAz8Zbkvh2HpmsNafk9ecvdo

The private key which generates that address is:

5HtxkoHrU6iGJXaNCQ5iAZBEXgTWk13k14SFpQrNJHVrJuTxN78 (Do not use this private key!)

To be able to add that address to your wallet, you need to add your private key to your wallet. What your wallet basically does is to show the balance of all your private keys. You can send and receive BTC through these addresses.

So right now you have BTC on the private key (or public address) which you ordered on Virwox. If you want to see it on your wallet, you can either add the private key to your wallet, or send those BTCs to the address generated by the Multibit wallet.

BTW: If you're going to send the BTC, please make sure that you backup your wallet just in case.

Kudos,

-Besir


is it possible to launder bitcoin by exchanging it for litecoin and then back to bitcoin? The scenario I was thinking of was I have some bitcoin from doing Bad Things (TM) that I want to launder.  I could register with kraken.com and trade only virtual currencies with the L1 verification ( un/pw, country of residence, phone ).
Process

deposit dirty BTC
buy LTC
transfer to another LTC address
transfer back to another kraken account.
buy BTC
transfer BTC to another exchange that I have linked to a bank account
cash out BTC

What issues do you see with this?  From what I understand kraken.com only has a un/pw ( easy to create a throwaway ) country of origin ( no verification, can lie ) and phone ( easy to buy a burner ).  And even that isn't public knowledge.  Once I transfer to LTC those litecoins are now clean.  Does that make sense?  There is no link between BTC sold and LTC bought except for at the exchange and that only has untraceable details ( un/pw/fake country of origin/burner phone)

Because all transactions in both Litecoin and Bitcoin are stored in the block chain, you run into the same issue you do here if you were just to try and withdraw USD for bitcoins, i.e., does your intermediary store logs of the off chain transactions? When you buy LTC using BTC on Kraken, if Kraken decides to log this transaction then there is now a link between the BTC and the LTC. This link could be used by law enforcement if they are trying to trace some dirty BTC. From an LEO point of view, this is how they would follow the money:

Use the BTC blockchain to trace the money to a Kraken account.
Ask Kraken for information about where that money went. Kraken gives them an LTC address.
Use the LTC blockchain to trace the money to another Kraken account.
Ask Kraken for information on where the LTC went. Kraken gives them a new BTC address.
Use the BTC blockchain to follow the "laundered" money.

The blockchain stores all transactions. The only way to clean money is to do some sort of transaction off of the block chain. To do that you need an intermediary who is willing to do that for you, and take the risk of LEO or some other regulatory firm calling them on it. Shady mixing pools might be willing to do this for you, but Kraken or other legitimate commercial exchanges will not.


I can't find my funds on my bitcoin wallet I can't find my funds on my blockchain wallet after saving for over 1 years. My blockchain account show (00) total when i have saved 3 BTC what should i do ? please help

what should i do

It depends whether you have a Blockchain.com account or a Blockchain.com wallet.

If you have a Blockchain.com account, contact Blockchain.com support.

If you have a Blockchain.com wallet, check the transaction history and find the Bitcoin addresses which held your money. You can then check those addresses in several different  blockchain explorers to see if money has been removed from those addresses. If not you may be able to regain control by  re-creating your wallet from your recovery phrase or wallet backups.


Someone made a small, apparently fraudulent, transaction to my public address. What is the purpose behind it? I have a small e-commerce site and someone made three cryptocurrency purchases just seemingly to know my public addresses as she never paid the cost of goods. The three addresses she viewed are public derived from the master public key so there shouldn't be any security problems there afaik.

She seemingly wanted to know my BTC, ETH and LTC addresses but only made a small transaction of $1.89 in BTC. I got 0.2¢ and other address got the rest. Here's the blockchain transaction data.

By the multiple transactions from this address and others related to it, it looks like if someone is trying to move a large quantity of BTC through multiple addresses to make it difficult to track. But why using public addresses from e-commerce sites like mine? Shouldn't be the same creating multiple new addresses? Maybe you can extract more meaning from this transaction and the intention behind it.

For additional info, the IP from where she made the purchases at my site is 68.65.122.134

She might be expecting you to make a transaction consolidation all of those coins you received. Since the inputs of a transaction are almost always the coins (in jargon "unspent outputs") of the same person, she could then find the transaction which spent those 0.2 cents, add up all the inputs, which would be the amount you earned in the last N days.


Needed maths for full understanding I often come across papers written in the Bitcoin space involving some math that I am not formally versed in.

Could anyone point out general topics in math that I should have a formal grasp on in order to really understand cryptography?

The signatures in Bitcoin (and Bitcoin Cash, Ethereum, and many other cryptocurrencies) are generated using elliptic curve curve cryptography. I found these videos very helpful in that regard:
https://www.youtube.com/watch?v=jQLmaBjYrk4

Other than that, you probably want to look into hash functions and asymmetric cryptography in general.

As a general introduction to cryptography, I took the cryptography course on Coursera which I can really recommend. This goes into the role of the adversary and what he can achieve. The teacher of this course, Dan Boneh, is, I believe, among the ten most renowned and best cryptographers in the world. On top of that, he is a very good teacher. The course does go into both symmetric and asymmetric cryptography but in the asymmetric field, it only teaches you RSA and Diffie-Hellman, not elliptic curves. Use the above videos for that.


How to calculate scriptPubkey? Given an address (i.e. 1BnPVV5Tt25cxbDg6DqoxJunjSL8reCGz6), how can I calculate its scriptPubKey in order to build a transaction?

I assume you want to integrate it into a P2PKH tx.
You would have to base58decode the address, and then remove the checksum and the network byte. Then you can integrate it into a P2PKH tx in the std. way:
76 A9 14 <20 Bytes> 88 AC
I have two references with some code examples in C and python, that helped me at the time, when I had the same question :-)

https://bitcointalk.org/index.php?topic=1543429.0
https://bitcointalk.org/index.php?topic=1026.0

and some online "play tools" to verify:

http://gobittest.appspot.com/Address
http://lenschulwitz.com/base58


Implicit/Tacit mechanisms in Bitcoin Core disclosing Selfish Mining I'm referring to the selfish mine attack described by two researchers from Cornell University who describe a "possible" attack with lower than 51% hashing power.

Now it's interesting to know what sorts of mechanisms, changes were implemented into the new versions of Bitcoin Core that detect selfish mining, propagate some alerts, disclose suspicious forks etc.?

EDIT:

Obviously peers get to know about other peers' progress on the blockchain through data messages, in particular through updates via inv messages.
Are there other types of "messages" exchanged - without the knowledge of the node itself - that would give away secrets about a longer private blockchain, in this case?

It is impossible to detect a drop in hashrate working on a chain because foreign hashpower is only evident in the discovery speed of blocks, except if it were deducted from a pool publicly sharing its mining stats. Thus the dropped hashrate would only be evident over sufficient long spans of time.

The only indicator of selfish mining would be the actual publishing of a previously unknown longer chain. I believe I've read somewhere that this will be shown in BitcoinCore with a "Reorganization" warning.


What metadata can be captured by a single miner? What about a group of miners? It is my understanding that the blockchain consist of the following information for every transaction in the network:

From address
To address
Amount of bitcoins

What additional information can a miner collect? For example, is it easy to find the IP address that the transaction was first sent from? Is there other identifying information a single or group of miners can capture? What roll do bitcoin tumblers play in all this?

The sender, recipient and transferred amount are already public information and readily available in the blockchain.

The only special access that miners have is that they could log the ip address of users that directly submit transactions for mining, if such a direct access is offered. Besides that there is no special information available to miners.


How are wallets listed on bitcoin.org chosen? I only use coingate and blockchain.info and to my understanding, coingate is a party that handles transactions (make order, send and receive bitcoin) while blockchain.info is a wallet to store bitcoin. I have a few questions below:

Why can't coingate be a wallet itself?
In https://bitcoin.org/en/choose-your-wallet, why blockchain.info is not listed? Was it not updated?

The wallet listing is maintained based on best practices, as such wallets which are unsafe aren't listed. A discussion on Github removed blockchain.info from this listing, pending them making promised security upgrades. Specifically, the concerns raised by the maintainer included:

Bugs and losses: BC.i has suffered from concerning issues during the past year (e.g. iOS denomination bug, weak key stretching, sizeable number of users losing funds, and more issues I haven't verified yet)
Backup/Password Security: BC.i hasn't adopted security features which are slowly becoming standard in other wallets (e.g. BIP32, random passphrases, backup on setup, rotating addresses, 2FA by default).
Transparency: Source code of the app has been reset or not updated repeatedly, making bitcoin.org often relay the false claim that the app is open-source.

Some of these are no longer the case, their new wallet does use BIP32 for example. The full discussion, where these points came from, along with detailed conversation with the developer are available for review on github.


Can someone post an explanation of how to get the input/output addresses? Can someone post an explanation of how to find the source and destination addresses of a transaction from the input/output portions of a block?

in general: I have added a sample tx, which explains the details:

VERSION
 01000000
TX_IN COUNT [var_int]: hex=02, decimal=2
 TX_IN[0]
  TX_IN[0] OutPoint hash (char[32])
  BC8361DEC060BFE1D481BDA60B3127524B8FF65F307221DE105E9DDB3F3B6053

--> this is the previous tx, which contains funds to move

  TX_IN[0] OutPoint index (uint32_t)
  hex=01000000, reversed=00000001, decimal=1
  TX_IN[0] Script Length (var_int)
  hex=6A, decimal=106
  TX_IN[0] Script Sig (uchar[])
  4730440220128487F04A591C43D7A6556FFF9158999B46D6119C1A4D4CF1F5D0AC1DD57A94022061556761E9E1B1E656C0A70AA7B3E83454CD61662DF61EBDC31E43196B5E0C10012102B12126A716CE7BBB84703BCFBF0AFA80283C75A7304A48CD311A5027EFD906C2

--> this script has the signature, and the following public key (starting with 02B12126...) - this is where the funds were signed with, and would be the source address (you would need to convert the pub key first to the bitcoin address - see references in my comments)

  TX_IN[0] Sequence (uint32_t)
  FFFFFFFF

--> and here follows a second input, from which this transaction moves funds... same rules as before.

 TX_IN[1]
  TX_IN[1] OutPoint hash (char[32])
  A75B4B6369ABC4A5F0A95FF714460BFA33802A2C422FD06D7B28771570C4520E
  TX_IN[1] OutPoint index (uint32_t)
  hex=00000000, reversed=00000000, decimal=0
  TX_IN[1] Script Length (var_int)
  hex=6B, decimal=107
  TX_IN[1] Script Sig (uchar[])
  483045022100A428348FF55B2B59BC55DDACB1A00F4ECDABE282707BA5185D39FE9CDF05D7F0022074232DAE76965B6311CEA2D9E5708A0F137F4EA2B0E36D0818450C67C9BA259D0121025F95E8A33556E9D7311FA748E9434B333A4ECFB590C773480A196DEAB0DEDEE1
  TX_IN[1] Sequence (uint32_t)
  FFFFFFFF

and here follow the outputs...

TX_OUT COUNT, hex=02, decimal=2
 TX_OUT[0]
  TX_OUT[0] Value (uint64_t)
  hex=9025730000000000, reversed_hex=0000000000732590, dec=7546256, bitcoin=0.07546256
  TX_OUT[0] PK_Script Length (var_int)
  hex=19, dec=25
  TX_OUT[0] pk_script (uchar[])
  76A914FCA68658B537382E27A85522D292E1AD9543FE0488AC

--> this pk_script defines the conditions, under which the funds can be spend. It is encoded in bitcoin's script language, and would finally translate to an address: 1Q2tmgphDqFJxhFFYNrjBr5o8XKSSDKtXv

 TX_OUT[1]
  TX_OUT[1] Value (uint64_t)
  hex=9838110000000000, reversed_hex=0000000000113898, dec=1128600, bitcoin=0.01128600
  TX_OUT[1] PK_Script Length (var_int)
  hex=19, dec=25
  TX_OUT[1] pk_script (uchar[])
  76A9146AF1D17462C6146A8A61217E8648903ACD3335F188AC

and this is a second script (usually a return address), which translates here to: 1AkUKA3NNQt4gs3GGexhacnkSMcmYHsN3S

 LOCK_TIME
00000000

Hope this helps, as mentioned before, Ken Shirrifs link is probably best to quickly follow.


Who determines the value of BTC vs USD? How is the data collected to determine Bitcoin's value? And who determines the exchange value of Bitcoin in USD?

This question isn't really answered, no matter how much I research. I want to know the evaluation process of Bitcoin. If possible can someone go as much detail as they think necessary. I understand the mechanisms of Bitcoin: generation, exchange and the what not, but never really understood how or whom values Bitcoin.

I understand that currency is evaluated by demand and supply but how is the demand and supply gauged and who does this seemingly impossible task? Because, you know, Bitcoin is supposed to be unregulated and free.

The Bitcoin / USD exchange rate is determined by users of an exchange. Traders in an exchange can buy/sell at however much they'd like, but if you sell BTC to USD at too high a rate, or buy BTC with USD at too low a rate, your transaction is less likely to occur.


How to access market price from Python? I am struggling to get access to the kind of information I have on cryptowat.ch. For example on Kraken there is an API, but I didn't find how to get the past history, the volume information, etc.

Is there any straightforward solution for this?

Perhaps you can use the Python library CCXT:

https://github.com/kroitor/ccxt

It offers an homogeneous interface for accessing market data at different exchanges like Kraken, Coinbase, Bitstamp, etc...


Watch only address not update balance After adding watch only address to my bitcoin core and perform some transaction that make my watch only address balance to 0, but when i run getbalance and listaccount with watch only is true, my watch only address still have coin. Only listunspent address show that my watch only address dont have any fund to spend more.

So any idea to sync my balance for watch only address ?

Using importaddress you can sync your balance for watch only address with rescan set to true:

importaddress "address" ( "label" rescan p2sh )

Adds a script (in hex) or address that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.

Arguments:
1. "script"           (string, required) The hex-encoded script (or address)
2. "label"            (string, optional, default="") An optional label
3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions
4. p2sh                 (boolean, optional, default=false) Add the P2SH version of the script as well

Note: This call can take minutes to complete if rescan is true, during that time, other rpc calls
may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.
If you have the full public key, you should call importpubkey instead of this.

Note: If you import a non-standard raw script in hex form, outputs sending to it will be treated
as change, and not show up in many RPCs.

Examples:

Import a script with rescan
> bitcoin-cli importaddress "myscript"

Import using a label without rescan
> bitcoin-cli importaddress "myscript" "testing" false

As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["myscript", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/


What does "H-not-zero" and "Share is above target" mean? While mining with cgminer on TripleMining, I noticed that I was getting something like:

[2013-09-14 19:02:12] Rejected 88dde730 Diff #/1 GPU 0  (H-not-zero)

What does this error mean, why is it causing my shares to be rejected, and what can be done to fix it?

I did some reasearch and it has something to do with the header not starting with zero. What does that mean?

I have the latest version of cgminer.

I switched pools, and now it is saying "Share is above target". What can I do about that?

H-not-zero means the hash of the header isn't zero for the first 32-bits. In other words, it indicates a share that was inherently invalid and could never have been valid. This is generally caused by overclocking, overheating, or undervolting. You can probably get these errors to go away by lowering the clock speed, raising the voltage, or improving your cooling.

If you aren't getting very many of them, you may prefer to just ignore them. All that matters is the rate at which you are generating valid shares. If 1% of your shares are invalid and you can only get the errors to go away by reducing your clock speed so that you generate 2% fewer shares, it's not worth it. On the other hand, if 5% of your shares are invalid and you can get the errors to go away by dropping the clock speed by 2%, it's probably worth it.

In one specific case, I was getting that message while mining with bfgminer and made the mistake of sha-256 mining on a scrypt pool = invalid hashing.


Who decides the price of bitcoin? Okay so I understand that bitcoin's price is increasing/decreasing by its utility, its rarity on the market, how it is publicly perceived, innovations, media, investors exc..

My question is, who decides the price of bitcoin? Or any other cryptocurrency? The cryptocurrencies have value because we believe they have values. But who are the we here? Who changes its values hourly sitting in front of a computer?

I am asking, who is the guy  or the group of people who changes the number that's on this link ?

Also this comes with further questions. The people who decide value of the currency can also try to manipulate it(increase/decrease) by their own interests right? For example if they have tons of bitcoins sitting in their wallet, they will try to increase its value so that they benefit economically. I mean, who would not do that?

Prices are set by the market, meaning that every individual decides what they will buy/sell their own bitcoin for, and the generally accepted price is an aggregate of all the individual prices.

If a bitcoin owner prices their coin it too high, no one will buy it. They will either have to reduce their price to a more reasonable level, or just go without a sale.

If they price it too low, the coin will sell immediately, and be taken off the market.  The buyer will likely price the coin higher, closer to the market value.

The sites that are buying/selling (such as CoinBase) are quoting the price they are actually willing to pay.   Other sites that provide information (Blockchain.info) are posting the results of their survey of multiple buyers/sellers.   It is possible that their data may be skewed or differ from the data on another site.  But a liquid market with lots of activity should keep those differences small.


How do I export my private key on MultiBit I am using Multbit on my desktop, and I want to use my wallet on a another device like my phone.

MultiBit does not have the same dump private key options as the normal bitcoin qt. Your best bet if you want to move coins is to load your wallet of choice onto the new device, then send to that address from your MultiBit wallet. Multibit stores private keys as described here
https://multibit.org/en/help/v0.5/help_walletBackups.html
https://multibit.org/en/help/v0.5/help_fileDescriptions.html


What goes in to the message of a transaction signature? I'm trying to create my own transaction from scratch, just to see how it works.

I'm currently working backwards, and I'm stuck on the signature of a transaction...

Here's my unsigned transaction:

0100000001ff8ddda903d6e76b6c6211e1b8f3b4eaaa8d080aaa008d4b05ca01ea39116cbf0000000000ffffffff0170c9fa02000000001976a9147865b0b301119fc3eadc7f3406ff1339908e46d488ac00000000

Here's my signed transaction (I have highlighted the signature):

0100000001ff8ddda903d6e76b6c6211e1b8f3b4eaaa8d080aaa008d4b05ca01ea39116cbf000000006b | 483045022100a385d7fb16a0de4ba101145c77c0eafc4840a61b41fc94733578a7d40c14def6022014ce25daa359db1bb3489db063cc0864601609f69d6ad15b490c13c27f86ab700121 | 02e4e8b42bf9fdf18895a9574e6f5fd01ebfa594bf51e8f8ad156638aee6223918ffffffff0170c9fa02000000001976a9147865b0b301119fc3eadc7f3406ff1339908e46d488ac00000000

I like to think I understand each segment of this serialized transaction. However, I don't know how to recreate the signature. I know I need to create a message and send it through an ECDSA signing function, but I do not know how to construct the message.

So basically, what goes in to the message to create a signature for this transaction?

The message whose numerically interpreted hash, z, is used to construct the ECDSA signature (r,s) is constructed as follows:

Start with your unsigned transaction.
Remove all scriptSigs (for example, if you have multiple txins, some of which may already be signed, remove those signatures). For your example this step has no effect since there's only one txin.
For the txin you're about to sign, find the corresponding UTXO's scriptPubKey, and set the current txin's scriptSig to be the value of the UTXO's scriptPubKey.
Serialize the transaction.
Append the SIGHASH type, serialized as a 32-bit little-endian integer (the default SIGHASH_ALL has a value of 1).

The resulting byte stream is double SHA-256 hashed and interpreted as a big-endian integer (and used for ECDSA's z parameter).

For your example, the scriptPubKey to insert comes from the UTXO at txid bf6c1139ea01ca054b8d00aa0a088daaeab4f3b8e111626c6be7d603a9dd8dff index 0, specifically it is OP_DUP OP_HASH160 d951eb562f1ff26b6cbe89f04eda365ea6bd95ce OP_EQUALVERIFY OP_CHECKSIG. Serialized, this is 76a914d951eb562f1ff26b6cbe89f04eda365ea6bd95ce88ac. The transaction constructed after completing step 3 is:

"txid" : "a80d616ca30a003448157b92df511ad5294e225fd77fc3f2d5dc367a4d27f375",
"version" : 1,
"locktime" : 0,
"vin" : [
    {
        "txid" : "bf6c1139ea01ca054b8d00aa0a088daaeab4f3b8e111626c6be7d603a9dd8dff",
        "vout" : 0,
        "scriptSig" : {
            "asm" : "OP_DUP OP_HASH160 d951eb562f1ff26b6cbe89f04eda365ea6bd95ce OP_EQUALVERIFY OP_CHECKSIG",
            "hex" : "76a914d951eb562f1ff26b6cbe89f04eda365ea6bd95ce88ac"
        },
        "sequence" : 4294967295
    }
],
"vout" : [
    {
        "value" : 0.49990000,
        "n" : 0,
        "scriptPubKey" : {
            "asm" : "OP_DUP OP_HASH160 7865b0b301119fc3eadc7f3406ff1339908e46d4 OP_EQUALVERIFY OP_CHECKSIG",
            "hex" : "76a9147865b0b301119fc3eadc7f3406ff1339908e46d488ac",
            "reqSigs" : 1,
            "type" : "pubkeyhash",
            "addresses" : [
                "1Bybuago2EGrB7Z6jJG2GAFDojp6Njr8fa"
            ]
        }
    }
]

It may look strange to have a scriptPubKey-style script in the scriptSig field, but that's the way it is. Once serialized, this becomes:

1: 0100000001ff8ddda903d6e76b6c6211e1b8f3b4eaaa8d080aaa008d4b05ca01ea39116cbf0000000019
2: 76a914d951eb562f1ff26b6cbe89f04eda365ea6bd95ce88ac
3: ffffffff0170c9fa02000000001976a9147865b0b301119fc3eadc7f3406ff1339908e46d488ac00000000
4: 01000000

Above, line 2 is the serialized scriptPubKey, and line 4 is the appended SIGHASH_ALL. This full message is then hashed and interpreted as an int, resulting in z=78289050778760245857840977078575435990304898491073736369300700378208907476567, which along with the private key is used to finally create the ECDSA signature.

Note that step 2 above assumes a SIGHASH_ALL signature. Other signature types remove additional parts of the transaction before signing, please see the SIGHASH types link for more details.


How does one prove that they sent bitcoins to an unspendable wallet? Proof of burn? How does one prove that they sent some BTC to an address that no one has the private keys for? Is there an address that one can send to? Basically proof of burn.

Essentially you must send coins to an address that is provably unspendable. There are many ways to do this.

Put the coins in an OP_RETURN output. These outputs are provably unspendable because the consensus rules prevent it.
Send coins to any script which resolves to false.
Since addresses are encoded hashes, start with a hash, of which it would be nearly impossible to find the pre-image, e.g. assume a script hash of 0000000000000000000000000000000000000000. Encode that into a valid address:

bs58 -c 050000000000000000000000000000000000000000
31h1vYVSYuKP6AhS86fbRdMw9XHieotbST

This address has actually had Bitcoin sent to it, but never from it: https://blockstream.info/address/31h1vYVSYuKP6AhS86fbRdMw9XHieotbST


Does running a full node make rpc calls faster? Hello I am running a pruning node on my VPS, and some of the RPC calls such as get balance take minutes to load. I need to check the balance every time the users access the website. I was wondering if running a full node would make these RPC calls faster.

The time command shows that bitcoin-cli is taking long due to I/O operations. What could I do?

~$time bitcoin-cli getbalance profit
0.00000000

real    6m16.762s
user    0m0.000s
sys     0m0.000s

This has nothing to do with pruning.  RPC calls like getbalance only use data stored in the wallet and/or UTXO database.  They don't have any need to refer to the archive of old blocks, and having it available wouldn't help anything.

VPSs often don't have a lot of RAM, and bitcoind in its default configuration needs a lot - say a gigabyte or more.  Is it possible that you're short on physical memory and therefore having to swap?  This can make a system very slow.  You can reduce bitcoind's memory usage somewhat with different options (see How to run bitcoind in a low memory environment) but you may also have to configure your VPS with more memory (and pay more).

Another possibility is that your server is overloaded with other tasks.

Either way, running top will probably reveal something.


How to withdraw or transfer to bank account I have bitcoin and i want to sell or withdraw to get the amount to Indian bank or Paypal. Is there any way to get the equal amount for bitcoin. If yes and how?

Bitcoin is not tied to bank accounts but instead lives on a distributed ledger known as a blockchain. This ledger is verified and stored by thousands of nodes across the world. Selling and buying bitcoin is not part of the protocol for Bitcoin, and instead is bought and sold on Exchange services such as Coinbase, Kraken, Gemini, etc. or Peer-to-Peer/Face-to-Face. Bitcoin is exchanged for fiat, not converted. When you sell bitcoin, someone is buying that bitcoin for fiat.

You will need to research and find an exchange that will allow you to sell bitcoin for your native country's fiat currency. Then you can withdraw said fiat into your bank account.


How can I get the whole info for a transaction whose outputs are spent? I use the RPC method getrawtransaction to get the whole info for a transaction. But if I understood right, it works only for transactions which contain at least one unspent output.
How can I get the whole info as provided by getrawtransaction for a transaction whose outputs are all spent. Or how does Blockcypher implement this?
For example this tx:
https://live.blockcypher.com/btc-testnet/tx/501553f8a27cfb8f661e9c977b923908642c1817ef6037eb104da8dfb892890a/

If I understand the question correctly, what you’re looking for is a “txindex=1” in your ‘bitcoin.conf’. It allows you to run ‘getrawtransaction’ to recall transactions that don’t spend from your wallet/don’t pay to your wallet/are not in the mempool. Furthermore, it’s named “Index transactions by TXID”.


Does the node count reflect the mining power support of different Bitcoin versions? In the current Bitcoin blocksize debate, xtnodes.com shows a pie chart of nodes running different implementations of Bitcoin; Classic, XT and Unlimited, etc.

Does this node count in any way reflect the mining power behind each Bitcoin version?

No, nodes and miners are separate entities performing different functions in the network.

The miners create the blockchain, which requires specialized hardware that performs hashing. The hardware is acquired through a significant investment.

Nodes are relay points in the network that verify, maintain and distribute the blockchain. They require (by comparison to mining) only a small hardware investment, or can even be run on virtual servers.

Nodes are much easier to be brought online, and can even be artificially inflated by responding to several IP addresses with the same node. Mining power can be directly measured by its output of proof-of-work. The numbers of nodes and mining power are in no direct correlation to each other.


When ipv6 is enabled my ipv4 address does not appear in getnetworkinfo localaddresses After enabling ipv6 (Google WiFi/Ubuntu 16.04) I noticed that my node's upload bandwidth dropped a lot.  Investigating showed:

ifconfig lists one ipv4 address and three ipv6 addresses.
bitcoin-cli getnetworkinfo lists zero ipv4 addresses and two ipv6 addresses and one tor address.
in getnetworkinfo the only address with a score greater than 1 is my tor address.
debug.log shows the discovery of both ipv6 addresses and the tor address.
debig.log also shows the lines Bound to [::]:8333 and Bound to 0.0.0.0:8333

Everything seems in order from the logs and ifconfig but I can;t figure out why bitcoin-cli does not list my ipv4 address.  I am assuming that is why I'm not serving many historical blocks (my node used to serve 50 Gb a day and now hovers around 1Gb which I assume is the tor interface.)

Any advice is welcome!

The localaddresses field (which I assume is what you are looking at) is not always accurate. Your computer does not actually know its external IP address so it has to ask its peers for the IP address, which may not always happen or may not always be correct. Keep in mind that if no one has connected to you on IPv4 you won't know your IPv4 address.

Instead what you should look at is the networks field and check whether ipv4 is available. Also use getpeerinfo to see what the IP addresses of your peers are.

You can also run netstat -nlp in your terminal to check whether bitcoind has actually bound to port 8333 with IPv4.

Lastly, make sure that your ISP is actually giving you an IPv4 address. They may only be giving you an IPv6 address since you can use IPv6. Without an IPv4 address, you won't be able to actually receive connections from IPv4 peers. Additionally, a new IPv6 address will not be known to many peers or the DNS seeders, so it is unlikely that you are getting new peers that want to download the blockchain from you.


Move MultiBit from Mac to Windows I'm an IT consultant in Australia and I'm pretty green when it comes to BitCoin and wallets and the like.

I've been contacted by a client with a MacBook Pro that cannot be repaired and he is looking to switch to a Windows laptop.
He says he has a MultiBit wallet on the Mac which contains all his 'Private Keys'... What I would like to know is if all of this data can be transferred onto a Windows environment with minimal fuss...  Can this be done?

He also says he has a "bridge" into his "trezor" that he needs as well.  Being an older client, he might not be pronouncing things right or his understanding might not help him convey exactly what he means.  But I'm assuming the "bridge" is some sort of VPN or browser add-in that creates a link between the "trezor" service he's using.
If I cannot boot the Mac, how would I determine where and what data this is and how to transfer it across to Windows as well?

Thanks in advance

What I would like to know is if all of this data can be transferred onto a Windows environment with minimal fuss.

Yep. Find the data directory on the Mac. Copy out multibit.wallet. Install MultiBit on Windows. Find the data directory on the Windows computer. Copy it there.

  He also says he has a "bridge" into his "trezor" that he needs as well.

He's probably talking about the Trezor plugin. This page explains how to set that up in the first paragraph.


Who accepts Moneybookers/NETELLER? Because I don't have any rep. and the chargeback issue, no one will buy my Moneybookers(USD) or NETELLER(USD). Is there an exchange that will?

According to the Wiki:

VirVox accepts NETELLER and Moneybookers
Bitcoin.de accepts Moneybookers

You could always approach high-rep users and ask them to do exchange with you at some rate favourable to them, and also letting them send you Bitcoins only after some time after which chargeback would be impossible. This way you risk little (high-rep users can generally be trusted), and you will get your positive reputation started.


Concept of Block weight and segwit are still unclear It seems like duplicated question, but i read many articles and posts to undestand about segwit.

Below links are something i read

What is block weight and how is it different from block size?

After Segwit Activation, what is the largest block size possible?

Understanding Segwit Block Size

Block weight

But i need example to clearfy about block weight T_T

In
Understanding Segwit Block Size article, writer said that

  The Segwit blocks are restricted by something called Block Weight.
  Block Weight is a new concept introduced in Segwit, and it’s calculated on a per-transaction basis. Each transaction has a “weight” which is defined this way:

(tx size with witness data stripped) * 3 + (tx size)

I think tx size is

tx = transactions + witness data

Then i stuck in recursion... I cannot undetstand.

To me, it seems like contradictory.

Because to define a tx size, needs Block weight to restrict witness data size. But to get a weight, need a tx size.

I understood that if there is no witness data, then maximum block size is 1mb(Before segwit). Yes It is clear. But some people are using weight same with byte.

For example, some people said(especially bitcoin wiki - Block weight)

weight = 1mb * 3 + 1mb = 4mb

And others said(What is block weight and how is it different from block size?)

Even in this post, Sam Jone said 4,000,000 WU but block is still 1mb

weight = 1mb * 3 + 1mb = 4,000,000 Weight unit(WU) Or 4mWU

what is the exact expression?

and If there is no witness data then what is left 3mb or 3mWU filled? is it empty?

In Block #577639, Block size is 1158.038 kB

How witness data is sotred?

1mb transaction + witness data right...?

or

1mb block is shared by transactions and witness data?

Basic concept of segwit is keep a block size as 1mb for transactions and add witness data right...?

It means size of transactions(witness data is excluded) is 1158.038kB?
or transactions + witness data is 1158.038kb?

As we know, maximum block weight is 4mWU or 4mb. Therefore, if transactions without witness data is about 1.1mb, then it seems like weird

block weight = 1.1mb * 3 + (1.1mb + witnessdata)

Because it is larger than possible maximum size.

If transactions + witness data is about 1.1mb

block weight = (1.1mb - witnessdata) * 3 + 1.1mb

this calculation seems more reasonable. But if witness data is less than 0.1mb then block weight is more than 4mb. Is it possible that so little witness data?

And If There is only transaction data and no witness data like 1mb transaction data and 0 witness data(block weight is 4mb or 4mWU which is theoritical maximum size)
Then how Transaction Malleability problem is solved?

I am so sorry. Questions are quite long, but i hope it can be helpful not only me but also person who are studying about blockchain.

Thank you for reading

Have a look: https://blockchair.com/bitcoin/block/0000000000000000000cbbceb342e07071f9621607e044ec909aa86fcdf88e8a

Size = 1,158,038 bytes
Weight units = 3,992,825 WU

Now what does it mean? So the size is what you probably understand well – when you have a file on disk, its size is measured in bytes and this is exactly what the size means here. It is the number of bytes you would need to store such a block in memory or on disk. This is the sum of non-witness data (nWD) and witness data (WD). Let's call this the absolute size for clarity (AS).

There is also something called virtual size (VS). This is a new concept, which measures the block in new units, called vBytes. It is calculated as (absolute size of non-witness data) + (absolute size of witness data)/4.

Weight of the block (BW) is calculated in weight units and is calculated as (absolute size of non-witness data) * 4 + (absolute size of witness data). This actually equals what you have mentioned in your post: (tx size with witness data stripped) * 3 + (tx size) because the transaction itself contains both witness and non-witness data.

So, now we know that:

AS = 1,158,038 bytes = nWD bytes + WD bytes
BW = 3,992,825 WU = nWD * 4 weight units + WD weight units

What are the limits in the protocol? Currently there is no block size limit any more. There is just one limit for block weight. This limit is set to 4,000,000 WU. It follows that in case of a block without Segwit txs, each byte's weight is 4 WU, therefore, such a block without Segwit txs is limited by absolute size of 1 MB.

Blocks that contain Segwit txs can be bigger than that and there are some theoretical calculations that say you can go to something like 3.7 MB of absolute size of a block. But this theoretical limit is just that – theoretical. In practice, even if the block was full of Segwit txs, its absolute size would not reach this limit.

Currently, most blocks contain both txs - Segwit and legacy, so we see the block sizes of full blocks usually in the range between 1 - 2.2 MB. The block is full if it's weight is very close to the protocol limit of 4,000,000 WU.

This implies that it is not correct to think that a block of size 1.1 MB is composed of 1,000,000 bytes of nWD and the rest is WD. That wouldn't work because the weight of 1,000,000 nWD bytes would already be 4,000,000 WU and therefore if we added the weight of WD to it, we would be over the limit. That is not possible.

So, if we know AS = 1,158,038 KB then it is rather that there are 944,929 bytes of nWD with weight of 3,779,716 WU and the rest is 213,109 bytes of WD with weight 213,109. This makes the total weight of the block 3,779,716 + 213,109 = 3,992,825 WU.

We can now calculate VS:

VS = nWD vBytes + WD/4 vBytes = 944,929 + 213,109 / 4 = 998,206.25 vBytes

Virtual size (VS) thus cannot be greater than 1,000,000 vBytes, so this is what is meant if someone says that the new block size is still limited by 1 MB - they actually mean 1 million of vBytes.


get mempool transactions of some bitcoin node? May I connect to any bitcoin core node, for example, this node 119.23.63.114:8333 using telnet and get its mempool transactions or even broadcast some transaction?

I've read that section https://bitcoin.org/en/developer-reference#mempool but can somebody give an example?

No, you cannot use telnet. You will need to use a software that can speak the Bitcoin Peer-to-Peer protocol. There is no easy command line way to do this with the typical utilities, you need to have your own software. Note that you cannot just send the message to the node, you will need to perform the connection handshake as well.

You can use the Python Bitcoin library to write a python script that does what you need.

For sending a raw transaction over the P2P network, you can use the submittx tool.


Wallets with BIP44 support I'm writing my own implementation of BIP44 wallet.

Can someone please point me to a BIP44 compatible wallet that could import seeds from other wallets. I've looked at several and it seems that, at most, they support only BIP39.

Thank you.

You can find a list of compatible wallets on BIP44's Github page.

  Mycelium Bitcoin Wallet (Android)
  Copay
  CoinVault
  Samourai Wallet
  Coinomi
  TREZOR
  KeepKey
  Ledger Wallet
  21 Machine Wallet
  Trust Wallet

According to MetaMask they also support BIP44, although they are not on the list above.


How can blockchain.info show the output address of a transaction when the output address has never been used in any other transaction? I've stumbled across a transition on blockchain.info where the output address was displayed even though the output address had never been used in any other transaction.

How can blockchain.info know the address when the transaction script contains only the HASH160 of the output address, not the output address itself?

I assume that you're talking about a Pay-to-pubkeyhash (P2PKH) transaction, which is the most common transaction type on the network at this time.

The pubkey script of a P2PKH transaction output contains the hash of the public key (what you call HASH160):
OP_DUP OP_HASH160 <PubkeyHash> OP_EQUALVERIFY OP_CHECKSIG

Said PubkeyHash can be converted into the address by prepending two zeroes and expressing it in base58check, a more human readable format.


Can we sign a psbt raw tx having multiple inputs created from BTC node with bitcoinjs lib? Due to secruity reasons, unavailablity of private keys on my end and as per project requirements I need to build back end apis where I will provide a PSBT raw transaction hex (having multiple inputs)  to front end, On front end, user will add their mnemonics and will sign all the psbt inputs individually, once all inputs are signed then a final signed raw tx hex get created.
Upon receiving signed hex I will broadcast it to the btc node and return the txid to the front end.
I am unable to find any way to sign psbt raw transaction inputs ( which is generated from btc node ) using "bitcoinjs-lib".
Could anyone please suggest how can I achieve this.
Regards,
Giri


What are the different types of spam that the Lightning Network is subject to? What are the different types of spam that the Lightning Network is subject to and what are the possible strategies for dealing with such spam?

There are three types of spam problem in the Lightning Network. Let's
call them "local","fast" and "slow".
Local spam is someone sending or requesting too much data: that's a simple batter of code with rate limiting etc.
Fast spam is sending many failed payments.  You can't tell what will succeed and you can't blame the sending peer (they may not be the
source).  This attack is free since we only pay on success. The answer
is to require an up-front payment but it has to be small (making sure
your incentive is to succeed) and it should not leak information on
where you are in the path.  I've been unable to find a scheme I'm
happy with though, see my latest attempt here.
Slow spam is sending a long-lived payment. This consumes capacity > 1000x expected for a normal payment and is similarly free (if you fail). The only solution I like here is to penalize slow payments by
requiring proof-of-channel closure but you can't always tell if
the payment was really in the channel and what if the close
transaction pays super-low fees / conflicts?  You need a Merkle tree
of claimed HTLCs, plus onion unwrapping, agreement on valid closes,
handling of fake Merkle trees... all possible but real work.
Summary: We can mitigate some attacks but real fixes need spec
improvements and implementation.  More attention from Smarter People
Than Me (hi!) will help us here.

This question was answered by Rusty Russell on Twitter.


How to monitor large number of public addresses I have created 10K addresses with vanitygen to deal out for transactions, Now how do I watch all those addresses for transactions and balance?

My idea is create an account at http://blockchain.info/wallet then add all of your address as watch only address. This way you can see everything about them all together or separate.


Why is my wallet in Maintenance mode? My OMG wallet on Yobit.net is in maintenance. I get this message when I try to withdraw or lodge to the wallet. Why is this so?

this happens sometimes on many exchanges. i have seen this also on poloniex and bittrex for other cryptocurrensies. this is usually a normal procedure. in a few days you should be able to deposit/withdraw your funds again.


Preventing the exposure of public addresses on a website Rather than having a single, fixed address, I want to generate a new address on my website every time a user request comes in.

I'm concerned about google or another web crawler indexing my website and tying my Bitcoin address to my website address.

I've thought about pregenerating the addresses, storing them in a database, and only showing one to each user. I think there's probably a better way.

I use node.js, so a solution using bitcoinjs or another node.js package would be preferable.

I would prefer to use multisignature addresses.

I would rather not depend on blockchain.info or an exchange - it introduces a single point of failure.

You should try using BIP32 to generate addresses.

There's a node.js implementation here: http://cryptocoinjs.com/modules/currency/hdkey/


Why can't miners meet the difficulty by picking a low number for the block hash? In terms of 'proof of work' my novice understanding is that miners are tying to come up with a 64-digit hexadecimal number, "hash," that is less than or equal to the target hash.

Can't miners always get lower than the target has by inputting "63 zeros followed by a 1?

Beginner here, I apologize for my simplistic understanding.

The hash is a result of computing two rounds of SHA256 on the block header. If you set the hash yourself, when other nodes try to verify the hash by performing the aforementioned computation, it will not (however, there is an infinitesimal chance) result in "63 zeros followed by a 1". I suggest reading about hash functions.

The only reliable way to create a valid hash is to continuously compute the hash on the actual block header, while modifying the contents of the block so that the block is still valid (e.g. nonce, transactions, block version, etc.), but gives you a lot of tries (guesses) until you get an output that is valid. It is basically brute forcing, so having fast, efficient mining hardware is an advantage.

See also: Block Hashing Algorithm


Neutrino enables full mining nodes without storing the entire chain? in follow-up to thread 85203:

With a fully implemented Neutrino (BIP 157/8) in Bitcoin, would it enable one to operate a MINING Node without having to use/store the entire gigabytes of blockchain files?

thx

No, it would not. A node that uses BIP 157/158 is not a full node. It is not downloading every single block and making sure that all blocks and transactions are valid, thus it is not a full node.

You can already run a full node without storing the entire blockchain. For a very long time now, Bitcoin Core has supported pruning where it discards old blocks after it has validated them. Pruned nodes are still full nodes as they still have downloaded and verified every block and transaction, they just don't store all of history. Pruned nodes can be used for mining.


How To Calculate Merkle Root? I found this example:

Current merkle hash list:
  32650049a0418e4380db0af81788635d8b65424d397170b8499cdc28c4d27006
  30861db96905c8dc8b99398ca1cd5bd5b84ac3264a4e1b3e65afa1bcee7540c4

Current merkle hash list:
  d47780c084bad3830bcdaf6eace035e4c6cbf646d103795d22104fb105014ba3

I have tried to calculate the hash using PHP:

$tx1="32650049a0418e4380db0af81788635d8b65424d397170b8499cdc28c4d27006";
$tx2="30861db96905c8dc8b99398ca1cd5bd5b84ac3264a4e1b3e65afa1bcee7540c4";
$v=hash('sha256', hash('sha256',$tx1.$tx2) );

But I got:
2b5f377b4adab64f489a2f73605ffb448b8add5b708d218729f9dfc58f1f5fe2

What is wrong?

This is the correct way to double hash two tx's.
First you need to convert them into little endian, and then convert into raw binary data before hashing.
<?php

function le_raw ($str) {
    return pack("H*", join("", array_reverse(str_split($str, 2))) );
    // return map { pack "H*", join "", reverse /(..)/g } @_;
}
function be_hex ($raw) {
    return join("", array_reverse(str_split( unpack("H*", $raw)[1], 2)));
    // return map { join "", reverse unpack("H*", $_) =~ /(..)/g } @_;
}

$tx1 = le_raw("32650049a0418e4380db0af81788635d8b65424d397170b8499cdc28c4d27006");
$tx2 = le_raw("30861db96905c8dc8b99398ca1cd5bd5b84ac3264a4e1b3e65afa1bcee7540c4");
$v = hash('sha256', hash('sha256', $tx1.$tx2, true), true );

echo be_hex($v), "\n";

output
d47780c084bad3830bcdaf6eace035e4c6cbf646d103795d22104fb105014ba3


Is there any RPC Java library using which I can call lite coin methods? In case of bitcoin there is bitcoinj. but in Litecoin what will I use?

Litecoin has forked the Bitcoinj project so that you can use Litecoinj

Repo's are here: https://github.com/hank/litecoinj

and here : https://github.com/hank/litecoinj-new

I think the last one is the most recent and active repo.


Unconfirmed transaction. Please help Please help. Probably I set fee too small and now I wait 10 hours so far and transaction is not confirmed yet.

Is there anybody who can help speed it up ?

If you had signed it allowing replace by fee you can update it with a higher fee. Another way if you have a change output you can spend the output with a high fee  (called child pays for parent) last but not least you can wait but that does not speed it up. Also you should consider using the lightning network in the future as it improves speed of payments greatly while reducing. Tx fees.


Can sidechains be used for fiat currencies? How could sidechains be used for auditing fiat transactions?

How would the accounting transaction in fiat and the record in a journal be merged?

Sidechains (at least the two-way pegged sidechains, as described in our paper), are about creating a new blockchain that uses the same currency as another blockchain.

Fiat isn't native to any blockchain, so it doesn't fit that category. You can't prove to the chain that fiat tokens are actually exchangable for real fiat. Fiat just doesn't live in the same world: it's defined by real world banks, not by a cryptographically verifiable ledger.

There are however many other ways to have fiat-representing tokens in an auditable ledger of transactions (a "blockchain"). It doesn't need pegging, or proof-of-work, or a sidechain (but isn't incompatible with them either). Still, a lot of the ledger technology itself can be reused. However, all of these solutions inherently require trusting an issuer, who promises to exchange the tokens for real fiat, forever - presumably by holding as much fiat in reserve as assets are issued.


Disable update of blocks locally with bitcoind cmdline option I'm using blockchain2graph tool to import the Bitcoin blockchain into Neo4j. It uses JSONRPC calls to read block data. For this, I have to have the bitcoind service running. Is it possible to disable the update of the blockchain while bitcoind is running?

I use the cmdline and I've tried -proxy=127.0.0.1:1234 and -debugexclude=proxy options but it continuously outputs connect() to 127.0.0.1:1234 failed after select(): Connection refused. I don't want this output either.

You can tell bitcoind to have 0 connections using:

bitcoind -maxconnections=0


Reward system bitcoin I'm not entirely sure how the reward system in Bitcoin works.

So, every 10 minutes a block is solved and 25 bitcoins are rewarded to a miner (or group). This happens in proportion to the amount of total computation power that miner has invested in solving the block. So a miner that has 30% of the total network power has a 30% chance of getting the 25 bitcoins and so gets roughly 8 bitcoins every 10 minutes right? If it was a group of 4 miners, average payout would be 2 bitcoins per minder I think.

How do transaction fees work with this? So a block consists of transactions. Are all fees for all transactions summed up and added to the basic 25 bitcoin reward and hence rewarded according to the same probability as above?

In addition, does this mean that a certain block can be worth much more than another one, should somebody be particularly generous in his transaction fee?

The amount of Bitcoin a successful miner can claim for himself is currentBlockReward + transaction fees. If there are a lot of fees, a block can be worth more than others.

When users send transactions, they can attach a transaction fee by assigning less to the transactions' recipients than the inputs' total. The unassigned amount can be claimed as transaction fee: Inputs - outputs = Transaction Fee

Example: In: 0.005BTC, Out: 0.004BTC ⇒ Transaction Fee: 0.001BTC

When miners work to confirm a block, they include their individual Coinbase Transaction in the transaction data that they are trying to confirm. This Coinbase Transaction spends the block reward and transaction fees to an address of the miner's choosing. This means that a miner assigns his own reward when he successfully finds a block.

However, after a block is found, every node will check whether the block adheres to the rules: The sum of all transaction outputs in a block must be smaller than all transaction inputs and the block reward, i.e. the miner may only assign the free floating transaction fees and the current block reward to himself.

sum(BlockOutputs) ≤ sum(BlockInputs) + BlockReward

It has happened in the past that a miner claimed less than he could have. In that case the remainder is lost to the network.

Also see the related questions:

Who gets Bitcoin transaction fees?
What exactly is Mining?


Are there any tools to visualize where the transactions are coming from and going to? We spent some time doing the visualization of the transaction flow between bitcoin wallets https://bitviz.visalyze.com and wanted to know if there are any tools that can not only track, but also visualize where the transactions are coming from and going to?

Blochchain.info also offers a virtuaisation of transactions, called tree chart. It can be view for every transaction over the "View Tree Chart" link.

Example: https://blockchain.info/tree/59587897

The link you posted seems to be offline, so I'm not sure if it's this sort of visualization you are looking for.


When does a node mark a transaction as confirmed or unconfirmed? As new transactions are broadcasted, the nodes keep them in a pool of unconfirmed transactions.

One node will add it to a block as soon as it finds a proof of work. At the same time many other nodes are working on the same transactions. When a new block is broadcasted to the network, it should either be marked as confirmed or removed from the pool.

I have a few questions about this process:

1- how the other nodes know the new block is already created so they should stop working on it? (or they don't?)

2- when a new block of transactions are added to the blockchain how the other nodes know they should not consider that transactions in their next attempt? They read the node and mark the transaction as confirmed of remove them? Is there any other kind of message they exchange?

3- if 2 new blocks are added to the blockchain in different branches. the first branch as active because that block came first. a new block arrives and the second branch is discarded. what happens to the transactions in the discarded branch? they are already in the other two blocks of the blockchain for sure? what do the nodes do with them?

thanks!

They don't know about the new block until they receive it over the peer-to-peer network (or some other way, e.g. FIBRE).  But since it was broadcast to the network, and all nodes on the network will be trying to relay it to all their peers, this should happen pretty quickly.
When they receive the block, they know to exclude those transactions in their own blocks.  (In practice, they probably generate a whole new candidate block, including only transactions not already confirmed, and with a new header that lists the just-received block as its parent.)
When the node changes its mind about which branch is active, transactions from the previously active branch (subsequent to the block where they diverged) are returned to the memory pool, except for those which are already in the new active branch, or conflict with a transaction on that branch.  Then, just like all other transactions in the memory pool, they are eligible for inclusion in future blocks created by this node.


How Ripple actually transfer money from one bank to another? Imagine there is bank A from USA and bank B from England, and they are both on Ripple Network.
Bank A wants to transfer $100 to bank B.

How does bank A put money in the Ripple network? Does it need to buy XRP from some gateway?

Suppose bank A already has the equivalent of $100 in XRP.
Bank B then receives XRP, but bank B is not interested in XRP, it wants pounds.

How will bank B convert to pounds? Does it need to find a gateway?
What if the exchange rate at this gateway is terrible for him?

I think it's necessary to first consider the question: Without ripple, how do banks "actually transfer money" from one bank to another?

Suppose that you and I are banks, and I want to send you $10 million. I'm probably not going to actually physically ship you $10 million worth of bills and coins. Instead, there are a few ways we could do this:

You and I privately agree that I now owe you $10 million. I don't send you the money, just an IOU. Next month you might want to send me $8, and so you just cancel $8 million of that IOU. We keep track of who owes who how much, but might never actually need to resolve it, since in the long run we're both sending a lot of money back and forth. This is difficult, however, because every bank has to maintain debt with every other bank.
You and I make an arrangement through a mutually trusted third party. I agree to owe them $10 million, and they agree to owe you $10 million. Later, someone else might send me $10 million the same way, negating my debt to the third party. A "wire transfer" in the US is just this, where the third party is the Federal Reserve.
You and I announce to a trusted third party that $10 million of my money should now be considered yours. This third party isn't a middleman who holds debt, like the central bank described in #2 - it simply keeps track of IOUs and regularly announces to all parties who owes who how much. The ACH system in the US (a.k.a. "Direct Deposit") works this way.

So, for the most part, bank's don't actually send money to each other at all -
 they just keep track of who owes who how much. Actually settling those debts, if it happens at all, has to happen outside of the systems above.

Ripple, as I understand it, can be thought of as a decentralized version of #3. It's basically a distributed public ledger of IOUs. (And those IOU's can themselves be traded as currency, when they're written by a trusted party.)


What is my goal | Objectives when mining? I kept on learning how miner hash | decrypt | calculate all those infos that was given to them by the pool but I can't find how they do it, maybe there's a function something like:

int hashThis( param1, param2, param3 )
{
  ..
  ..
  return somthingCanBeUsedToInformThePoolOfSucces
}

int Submit()
{
  param = hashThis(param1, param2, param3 )
  submitTothePool(param)
}

That is how know mining is, but I don't know how to implement the function hashThis(), that's why I asked maybe you have a goal to reach, and return it when you reached it

Basically, you are solving a puzzle. A puzzle is to come with a nounce(number) which when added with the block header and hashed, hash should start with some number of zeros.

Higher the number of zeros, difficult it is to come with the nouce for the given block header. According to the current hash power in the network, network adjusts the difficulty.

Implementation would look something like this:
1) Generate block header for the given set of transactions
2) Get the current network difficulty level ( number of zeros hash should start with )
3) Plug in random numbers so that : hash( nounce + blockheader ) starts with given number of zeros
4) Form a block and include nounce in the blockheader ( So that other node can verify your work )


Which crypto currencies have shortest payment address? Different crypto-currencies have different lengths of payment addresses.

For example, LTC address length is 34 case sensitive letters and numbers.

NXT address length is 20 digits.

Short payment address can be easier to remember, read, write, compare and transmit by phone, which makes it advantage of crypto-currency, making it attractive investment, doesn't it ?

The human mind can remember approximately 7 digits quickly and easily. That's how you can remember US phone numbers (sans area code) without even thinking about it. However, when it gets to 10 digits it starts to reach the limit of working memory, and 20 digits is definitely out for most people. Of course, if you actually spent the time to try to memorize it, 20 digits is a lot easier than 34 alphanumeric characters.

That said, I don't think the benefits justify the costs. Cryptocurrency is designed to be used by people with access to a computer or smart device. Copy-pasting is a lot easier than trying to remember a bunch of addresses. Granted, it might be useful to remember one address, your own, that you can give out to people in conversation. But these days most people have their smartphones on them wherever they go. Also, regarding "transmit by phone": Only if you use a touch-tone phone. Otherwise, you can just copy-paste and then SMS/email/submit it to the other party.

What disadvantages are there? Well, now that there are only 10^20 addresses, or 66 bits - much less than the 160 bits of Bitcoin and pretty much all of its clones, decreasing security. Moreover, this also means addresses must be generated on-network to prevent the possibility of duplicate addresses and registered as an account. For NXT, only 12 billion addresses are necessary for there to be a 50% chance of collision (a la birthday paradox). For Bitcoin, 1.4 septillion addresses need to be generated for that to be the case - which for all practical purposes, will never be generated. So people can generate addresses without being connected to the network and be very confident that no one else has ever generated the same address, making cold storage solutions easier, for instance.

Edit: To answer the question in the title: I only know of two address schemes, Bitcoin-like and NXT. For Bitcoin-like addresses, the first character is always something which identifies the coin (not uniquely - multiple coins, including Bitcoin, begin with a 1, Dogecoin and Digitalcoin both begin with a D, etc.), followed by a 160-bit hash and a checksum. Then you have NXT, 20 base-10 digits. I don't know of anything shorter than NXT, and any shorter would be unreasonable given the increasing probability of collisions.


How do cryptocurrency exchanges handle users' accounts? I recently became aware of the fact that exchanges have trading engines that execute all trades within the exchange itself, and not on the blockchains. That is to say, if User A sells to User B, there is no corresponding blockchain transaction transferring those coins. Instead, both users have accounts on the exchange which are debited and credited. A blockchain transfer only takes place during deposits and withdrawals.

Please explain the same case for currency like Bitcoin as it manages its assets using UTXO Model which is a record of unspent outputs. And for other currency like Ethereum using the account-balance model as the transactions aren't included in the blockchain. So, how they will reflect changes in the account of a user?

When you send funds to an exchange, you do not own the UTXOs created. They are owned by the exchange.

Exchanges use the UTXOs from all their wallets to process withdrawals. This means that if you were to deposit and withdraw coins with no trades in between, your withdrawal will still not come from the UTXO created by your deposit. It could come from any of the thousands of UTXOs owned by the exchange (comprising of other peoples' deposits).

It's similar to how your bank account functions. When you deposit cash, the cash you hand over becomes the property of the bank. From that point, any balance that you have solely exists on the banks' internal databases. If that database was tampered with or destroyed, no one can prove you had money there. If you were to withdraw cash, the notes you get back will not be the same ones you deposited, and were likely deposited by some other customer.

Similarly, when you send coins to an exchange, your balance exists solely in the exchange's  internal database system. As you make trades, this internal balance is debited and credited. When you withdraw, the coins come from a UTXO set that includes everyone's deposits.

This is also why it is recommended to only keep coins you are actively trading on an exchange, since it leaves you open to the possibility of an exchange losing your money.


Is Merkle tree pruning described in the whitepaper feasible/useful? If not, would there be any alternative? When I was reading bitcoin-paper-errata-and-details.md written by David A. Harding, I realized that there's probably a common misunderstanding or over-simplification about Merkle tree pruning. What Nick ODell had said might be a live example:

A leaf (transaction) can be pruned when all of its outputs have been spent.

This once seemed to be true for me, until I read what David had written:

there is currently no way in Bitcoin to prove that a transaction has not been spent

I'm not sure whether I have grasped it, so firstly I made a diagram to illustrate (part of) my understanding to this problem:

Still, I don't think merely this problem can kill the whole idea of Merkle tree pruning yet, I think it just means that "the reclaimable disk capacity is much lower than expectation". In other words, if I'm not mistaken, Nick ODell's claim could be "corrected" like:

A leaf (transaction) can be pruned when all of its outputs have been spent, and all of its previous transactions have been pruned.

However, I then think that, even if the "corrected" claim is taken into consideration, the idea of Merkle tree pruning still doesn't seem to be feasible/useful:

Even if the problem mentioned above is avoided, a malicious node can still deceive the new full node by hiding/picking some merkle branches. A malicious node can lie about the actual ownership of coins (spent/unspent state) without breaking the Merkle tree structure at all. In other words, a new full node joining the network still needs to download & verify everything, otherwise, it could be deceived by a malicious node.

If a full node needs to enable pruning to reduce disk space requirement for itself, directly reading/modifying the blockchain files seems to be much less efficient than the current implementation that the UTXO set is completely separated from the blockchain storage, so that a full node (no matter it's pruning or not) only needs to query and update the UTXO set database during the downloading & validation process. The blockchain itself doesn't need to be touched once again for validation purposes at all, which is the reason why the old blocks can be simply deleted when "pruning" (not Merkle tree pruning) is enabled.

However, I'm still not sure about this conclusion. Is this related to the idea of fraud proofs, in the sense that as long as there's still at least one honest full node, the new node would be able to spot which piece of data is the correct one? What if the UTXO set is also committed to the blockchain? What if some more commitments like the block height of previous transaction are also added to the blockchain?
Furthermore, I've heard that the Mimblewimble protocol enables secure blockchain pruning. I'm also curious how Mimblewimble could achieve this, and whether similar goal could be eventually achieved in Bitcoin?

From what I understand, a full node will download everything, verify everything first. Then only the pruning starts. Thus, the issue of inconsistent pruning does not arise. As off now, there is no common consensus on the UTXO sets. For example, up to block 500,000, the UTXO set is "XXXX".  Just download "XXXX",it should be fine. I believe we will have this feature in the future. As off now, fullnode have to download everything, verify and then only prune.


BTC received in BECH32 (P2WPKH) format address not exist in Electrum I sent some BTC to a BECH32 (P2WPKH) format address. (details of the transaction)
I imported the private key(wif) in Electrum, but I can't find the income?
I am sure I sent to the right address and imported the right wif. How can I get the incomes?
Thanks a lot!

did you prefix p2wpkh: to the wif when importing? do you see the address under the addresses tab? view menu > show addresses if it's not there.


Bitcore full node list with Wallet service enabled? Is there any Bitcore full node list out there? I wanted that in order to use the Wallet Service while not being dependant on only one server.

edit: quote on their website:

  You should now be able to run your own Wallet Service for your users.
  Now you can have ultimate control over your wallets without trusting
  random SPV nodes on the Internet.

I want just the opposite. If it's possible I want a very long list of bitcore nodes.

edit2: (from comments)

I know bitcore is based on bitcoin core. but I want to know if there's a directory for bitcore nodes running wallet service. nodes can discover each other through p2p protocol but afaik they don't specify, in the bitcore case, which services they are running.

Like the directories for nodes running Electrum protocol. It would be awesome.

Nodes don't provide wallet services (like Bitpays Bitcore [don't mix that up with Bitcoin Core]). The only service they provide is SPV transaction filtering (which is much "slower").

Running your own wallet service (like BitPays Bitcore) can be useful if you have your own setup, etc. (It's more a server/client thing).

Bitcore is basically a Bitcoin Core full node with some extra database layers (address index, etc.).
The full node behind Bitcore will connect to some dozens other full nodes (p2p).

You don't want to manually maintain a list of full nodes. There is a built in p2p address manager.


What versioning scheme does Bitcoin Core follow? I saw a discussion recently about whether Bitcoin Core was following the Semantic Versioning scheme. I could not find information in the GitHub ReadMe.md or Contributing.md.

Luke-Jr stated that neither Bitcoin nor Bitcoin Core follow Semantic Versioning.

What versioning scheme does Bitcoin Core follow?

Bitcoin Core does not follow semver. BitcoinCore.org explains its Software Life Cycle as follows:

Bitcoin Core aims to make a major release every 6-7 months.

Minor releases provide maintenance, fix bugs, and might introduce minor features. Proposed changes to consensus rules are always first shipped in minor releases, so that consensus rule changes can be adopted independently from the release of new major features.

Bitcoin Core releases are versioned as 0.MAJOR.MINOR, and release candidates are suffixed with rc#. Examples of each version type are:

release candidate: 0.12.0rc1
major version: 0.12.0
minor version: 0.12.1

Note that Bitcoin Core versions built directly from the master branch instead of a tagged release show up as 0.MAJOR.99.
Update in Dec 2020: The next "major" release after 0.21.0 will drop the leading zero and therefore be called 22.0.