Create custom Transaction ID using Bitcoind raw transaction I would like to know if it's possible for someone to create a raw transaction using bitcoind or bitcoinJ and predict the Transaction hash.How exactly is the transaction ID(hash) calculated ?

For the details of computing a transaction ID, see How to calculate a hash of a Tx?
Basically, it is the double SHA256 hash of the raw transaction data.

SHA256 is believed to be a secure hash function, and part of what it means to be a secure hash function is that there is no reasonable way to "predict" what the hash of some input data will be, short of actually computing it.  It also means that there is no reasonable way to compute some input data whose hash will have a specified value.  So if you are trying to create a transaction whose ID is DEADBEEFCAFEBABE0123456789ABCDEFFEDCBA9876543210FACEFEEDACEDBEAD, or matches the ID of some existing transaction, sorry, you cannot (unless you figure out how to break SHA256).  But you can safely assume that nobody else can do so, either.


Fixedseed ignored by bitcoin-qt I play with bitcoin source code to learn,
I create my own fullnode, and change the chainparamsseeds.h to just use my own node as SeedSpec6, and comment the dns seeds in chainparams.cpp.
When open bitcoin-qt, it wont connect to node defined. but when I use addnode command, then it connect and start syncing.

Why same node can't be used form FixedSeednode config?

Thanks

Those nodes listed in chainparamsseeds.h are fallback seed nodes. They are not what Bitcoin Core uses by default to connect to the network, they are only used as a last resort if none of the other methods for finding nodes works.

Furthermore, the nodes listed there are seed nodes. This means that Bitcoin Core will connect to them briefly to get IP addresses of other nodes to connect to, and then disconnect from the seed node. They are not there to maintain full connections.

If you want to have a node connect to another node, use the addnode command.


Are Bitcoin transactions traceable? I have a question after a silly discussion.

We discussed for the best way for terrorists to get money. I have offered bitcoins. My question is: is it possible to trace who has cashed out bitcoins into money if you know the bitcoin wallet address.

I think it should be possible to trace, but how to trace such a thing?

NOTE: I'm just talking about cashing out bitcoin into money, not buying some cheap stuff.

Bitcoins are only ever really anonymous if you mine them your self or were given them by a miner. Once bitcoins are exchanged on, well an exchange (especially one affiliated with the U.S.) then those bitcoins have been associated with you. You can transfer them to other wallet addresses, but it will be visible in the block chain.

You can cycle them through many different accounts, but unless you have hundreds or thousands of accounts, then any illicit activity could be traced back to your first transfer by a sufficiently savvy analyst.

I also think that in the current mining climate, it would not be a trivial feat to acquire enough computers to generate enough bitcoin to fund any significant endeavor.

It should be noted that any exchange operating in the U.S. is obligated to employ someone whose job description is to look for money laundering.


How can loans work with bitcoin? Before answering this question please go through this scenario
Let's assume that we have now become a bitcoin-only economy and nearly all bitcoins have been mined. Now, someone wants to do business and he needs bitcoin loan, which a lender will provide him at 10% interest. After one year, the borrower has to pay back bitcoins, which now have a increased value, plus the interest. Thereby, he has two forces acting against his borrowing - the interest and deflation.
In fiat, interest and inflation cancel each other out which promotes borrowing; that's a healthy thing. But in the bitcoin economy a borrower has to fight against deflation and interest. If interest rate gets lower than zero, lenders would have no incentive to lend.
So, this makes bitcoin as a replacement for fiat useless as according to the above scenario lending doesn't work out in this economy.
Further, if somehow we make it work, where will the interest amount come from? There will be more btc to be repaid than actual btc we have and this will lead to creation of IOUs and fractional reserve. In essence, we will be reinventing the wheel.

In Fiat Interest and Inflation cancel each other and promote borrowing and thats a healthy thing, but bitcoin economy a borrower has to fight against deflation and interest, if interest rate gets lower to zero then lenders will have no incentive in lending

At a basic level, the person providing the loan hopes to receive a small return (interest) for providing the capital, and the person receiving the loan hopes to use that capital to make profits in the short term.

Removing inflation from the equation (eg by providing a BTC loan) does raise the bar for what could be considered a profitable venture for the loan taker, but that does not mean every loan will no longer be profitable. Rather, it just incentivizes individuals to seek out ventures which have a higher chance of turning more profit.

In my opinion, the argument of "nobody will spend a deflationary currency on anything!" is silly. Individuals will still have to spend, they may just have a higher threshold for the question of "what is worth buying? (or investing in?)". Even if your money is deflationary, you'll still have to pay rent, because its better to have a safe place to live than to have a little more money in the future, but nowhere to sleep.

  Further if somehow we make it work, where will the Interest amount come from ?There will be more btc to be repaid then actual btc we have

Interest on a loan will come from profits made by utilizing the loan. This is no different than a loan denominated in dollars: when you pay the loan back, the interest you pay is not 'freshly minted money', it is just money that already existed in the system, but you are now the owner of.

In general: Use-cases for bitcoin are not dependant on how well the system mimics the lending properties of the traditional banking system, in fact bitcoin is likely useful because it has different properties than the traditional system. Bitcoin is a decentralized, permissionless, borderless, immutable and programmable system of value. What exactly the implications of this are is a story that is still unfolding, but it certainly does promise many exciting things. I think one of the most important is that it grants the user financial sovereignty, which is a rare and important thing in our increasingly Orwellian tech world.


What's the simplest way to deposit BTC into US Banking account with minimal fees? I've been looking through the bitcoin wiki and googling isn't providing any useful results. Basically I'm looking for some way to deposit my BTC into my US bank account. Is there any service that can do this without incurring massive processing fees or surcharges?

Essentially I'm looking for the following:

Simple to use. Should not have to jump through hoops like signing up for paypal account or go through intermediate exchange like mtgox USD etc.
Preferably has a direct deposit method similar to how you might get payed from a job.
No fee or extra surcharges or kept to a minimal. Many of the exchange services I've looked at has wire-transfers but the associated fee makes it simply prohibitive especially for small BTC to USD transactions.
Doesn't necessarily have to be instant or fast.

[...] I'm looking for some way to deposit my BTC into my US bank
  account. Is there any service that can do this [...] ?

In short, no.

Your US bank account holds US dollars, not Bitcoins.

You can sell your Bitcoins for US dollars, and deposit the US dollars into your US bank account, but you can't deposit Bitcoins into US dollar bank accounts.

Edit: I just found the Bit-Pay Deposit Card which claims to allow you to "Receive Bitcoins into your US Bank Account!"  So perhaps that's what you are looking for.  There's also a video about it.  Apparently "the fees are 2.99% which includes the currency exchange and the next-day ACH".


crypto password copay I want to recover my wallet since I forget my encryption password, for this I am trying to import the wallet with the 12 words and the system gives me an "error" and the message "already this wallet exists". What should I do?

First, use your 12 words to import the wallet to another device. Once you have successfully done this, you should be able to delete the wallet from your original device, then re-import it.

I always recommend importing to another device first before deleting the original wallet, just in case the import has issues.


How can I build my own get address transactions API? I want to build an API to query an arbitrary bitcoin address for received transactions. The address is not necessarily associated with my wallet. Is this possible using the commands in bitcoin-cli?
I do not want to rely on a third party service like blockchain.com Though a public code library would be fine.

You can use NBXplorer: https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#address-transactions
How to setup NBXplorer? https://youtu.be/a5ehSfzYkJo
Requirements: Bitcoin Core and .NET Core SDK


Bitcoin cash with bicore and addressindex Bitcore runs a version of bitcoind where theres address index and we can search any addresses I have implemented the bitcoin insight block explorer and its working perfectly

I need to implement bitcoin cash (bitcoin ABC or Unlimited) but my question is can I search using addresses if I mix bitcore + bitcoin cash

I mean does bitcoin ABC comes with address index function ? thats compatible with bitcore ?

Bitcoin Cash client does not support address index like Bitcoin, so you need a patched client to use this feature. You can use https://github.com/bitprim/bitcoin-abc. I also forked bitcoin-abc with address index feature. This repo is in https://github.com/Sotatek-DucPham/bitcoin-abc. Follow the build guild and get your bitcoind, remember to add usecashaddr=0 in bitcoin.conf before run. Good luck.


Could mining calculations be used to crack private key? Could mining calculations be used to crack private key, in addition to mining for checking against few million accounts with positive balances? If that possible, at the current mining rate (30TH/s) network can check 1.8 x 10^16 hashes every 10 mins (per block). May be few (<10) of these could be a lucky guess for the corresponding private key, in a year.

No.  The math involved in cracking a private key uses a completely different set of mathematics and source data.  There is no benefit in reusing one for the other.

There is a conspiracy theory going around about the SHA hashes being a big rainbow table for "The Russians" but that crackpot theory has no basis in mathematics or applied usage.  I hope people keep talking about it so I can buy BTC while they are still cheap.  FUD (Fear, uncertainty, doubt) are good to keep BTC's price low while before the market value becomes what it should be.

To be more specific, SHA hashing (mining) is a different set of math used for the ECDSA secp256k1 encryption that in the private key.

Now that ASICs are used, it's impossible to dynamically re-wire the hardware for such a purpose.  In theory FPGA can be reprogrammed for this, and so can GPU/CPUs.

You could keep all your BTC in one address, or you could diversify your risk by keeping BTC in many different accounts (addresses) knowing full well that this will increase your transaction size and therefore your transaction fee.  The choice (to some extent) is yours


Using Bitcoin Core Wallet, encrypted it, now it won't recognize password I typed in the password very carefully, the same 5 digit password I use on another program. I know and remember exactly what I typed, I didn't type anything incorrectly. I got an error message saying the password was too short. Then the program crashed. When I relaunched it, the wallet is encrypted but it won't accept the password that I put in. How can I get my bitcoins back and/or unencrypt the wallet?

Try to unlock it on console by using the walletpassphrase command (e.g. walletpassphrase (5 digit here) timeouthere)


MultiBit Classic wallet gone I formated my computer yesterday, and my MultiBit Classic wallets are gone. I just tried a trial software to recover the files, and they appeared as found. But I cannot recover unless I buy the full version.

The wallets didn't ask for any password when I open MultiBit. If I successfully recover the .wallet files, I will be able to recover my bitcoins with this files only? I dont remember to configure any passwords or anything for this wallets. The only data that I can recover is the .wallets file. Is this enough?

Yes your wallet file will be sufficient to recover your Bitcoin if you did not encrypt it with a password.

In the future please encrypt your wallet and store backups offline


What is the story behind Tradehill? Tradehill used to be an important Bitcoin exchange, but it was closed earlier this year due to losing a lot of money to their payment processor. What is the full story behind Tradehill?

Basically, Dwolla promised that they would never honor chargebacks. They in fact did and stole dollars back from their bank account after TH gave Bitcoins to the scammers. They lost a lot of money by this. I believe Dwolla is being sued for 2 million dollars as a result of this.


The nlocktime parameter in createrawtransaction seems not work using Bitcoin Core Wallet GUI If I add the CLocktime (e.g 20) at the end it always gives:

Error: Error parsing JSON:{"12CxqQHzhFxCm2TkGkKHdFFPyUerFXcSte":0.008,"1DBDDvpcHv66LD7sWz1mCitPALW1qfrga7":0.012},

If I delete the CLocktime at the end it will be ok.
Have anyone has similar experience and know why?

You're putting the locktime in the wrong place. You have

"[{\"txid\":\"myid\",\"vout\":0}]" "{\"address\":0.01, \"address\":0.01} 20"

but it should really be

"[{\"txid\":\"myid\",\"vout\":0}]" "{\"address\":0.01, \"address\":0.01}" 20

The locktime is a separate parameter, not part of the quoted parameter that has the transaction outputs. It goes outside of those quotes.


Can I have a fee rate lower than the one suggested by estimatesmartfee economical I know what the inputs and outputs are, the weight of the transaction. At the moment I have $1400 divided into addresses (of my own bitcoin-node).
When using sendtoaddress, 24 blocks, ECONOMICAL he wants $400 commission. Is there anything I can do now?
Can I somehow transfer money locally to 1 address?
UPD: estimatesmartfee return
bitcoin-cli estimatesmartfee 24 "ECONOMICAL"
{
  "feerate": 0.00105724,
  "blocks": 24
}

Is there anything I can do now?

Yes, if you want to lower the fee rate, you can set the fee you want to pay manually:
bitcoin-cli settxfee 0.00081

fee are in bitcoin/kB  so they correspond to 81 satoshi/vbyte
and then you can do your transaction with
bitcoin-cli sendtoaddress "address" "amount"

Can I somehow transfer money locally to 1 address?

From blockchain viewpoint all address are equal, it don't know which belong to the same wallet, so there can't be local and external transactions.


blockexplorer is not fully synced I am working with a cryptocurrency which is a fork of bitcoin. In my blockexplorer it shows 91% synced and I cant see any latest blocks.

Does the GUI of the daemon show that you are connected to inbound peers?

If it does, you may have to do a re-sync of the blockchain from scratch. It's happened to me before.

Not sure which crypto you're using, but I'd try backing up your wallet.dat files, you can save a copy of the blockchain database as well if it's huge and restore it later just in case.

But back up your wallet files, then do a fresh install, re-sync the blockchain, and see if it gets to sync status. Then open your wallet files.


Personal information and bitcoin purchasing I am in the process of buying bitcoins and am being required to put in a lot of personal details. Once i buy the bitcoins is there any way that the information i had to submit to buy them originally can be traced back? thanks.

I am in the process of buying bitcoins and am being required to put in a lot of personal details.

The Bitcoin network itself requires no identifying information from users. In fact, efforts have been made to make transactions / addresses as indistinguishable from one-another as possible, in order to provide the best fungibility and privacy for users of the system.

That said, many of the services which allow users to trade Bitcoins for fiat are businesses that are subject to the laws and regulations of the jurisdictions they exist and operate in. There are anti-money-laundering (AML) and know-your-customer (KYC) regulations in many jurisdictions that require these businesses collect information about their customers. In order to be a customer of one of those services, you must surrender personally identifying information.

  Once i buy the bitcoins is there any way that the information i had to submit to buy them originally can be traced back?

Lets consider two situations:

a) You send all your personal info to an exchange, buy 1 bitcoin, and withdraw to a wallet you control.

b) You meet someone randomly on the street, and buy 1 bitcoin from them.

Now, the question is about how your personally identifying information can be linked to your future Bitcoin transactions. In both cases above, lets assume that you now own one UTXO for 1 bitcoin. In both cases, the counterparty to your trade (the exchange/person) will know that you are the owner of this UTXO. The exchange will know much more about you (perhaps your full name, address, bank info, etc), whereas the random person will just know you as... well... a random person.

Next, lets say you want to buy a bucket of rocks using your newly acquired bitcoin. The price is 0.25 bitcoin (they are very nice rocks!), so you send a transaction that spends your 1 bitcoin UTXO, and creates a 0.25 bitcoin UTXO (paid to the rock seller), as well as a 0.75 bitcoin UTXO (paid back to yourself as change).

So what will the exchange or the random person be able to say about this transaction? The answer is: they will not know whether you now own the 0.75 btc UTXO, the 0.25 btc UTXO, or both, or maybe even neither! The rock seller will know the reality of the transaction, as will you, but third parties will not be able to know with absolute certainty.

Tracking individual coins through time isn't technically possible, but there are some heuristics that can be used to make a best guess of ownership over time. Ultimately, Bitcoins are fungible, so with best practices a user can keep themselves relatively anonymous. Conversely, if a user only uses a KYD'd exchange's custodial wallet and sends/receives all transactions from that wallet, then they will have basically zero financial privacy against that company (and anyone that has access to that company's records).

For more information on Bitcoin privacy, see this wiki article or this stack exchange post (it is an old post, so the wiki is probably more up to date, but the answers there seem largely applicable still to this day).


Bitcoin signatures have two components: s and R. To sign a Bitcoin transaction with private key k, the signing algorithm generates an ephemeral private key r. The R component of the signature is the x-coordinate of that ephemeral public key. The s component of the signature is calculated in the following way: s = r-1 (Hash(m) + k * R) mod p; where Hash(m) is the hash of the transaction data m.

Since, s changes with r, as shown in the equation above, the signature component will be completely different when you compare two transactions signed if their ephemeral key generation algorithm differs.

Most softwares uses RFC 6979 to deterministically but securely generate the ephemeral key used to sign transactions. So for two identical transactions, the ephemeral key should be the same and that is the reason you are seeing the same signatures on different Bitcoin Core software. However, RFC 6979 algorithm also allows the usage of other additional optional data while generating the ephemeral key. This additional optional data might be different for different softwares and as a result you are seeing different (s,R) signature from Bitcoin-Core and nBitcoin.


Can a Trezor seed be used in any other HD wallet? Trezor FAQ says

  If you do not use a passphrase, your recovery seed is all that is needed to access your bitcoins.

If you do not use a passphrase, can the Trezor seed be used to recreate a hierarchical deterministic wallet?

Yes, Trezor uses the BIP0032 standard to derive your keys from the seed. That means you can use any BIP0032-compatible client for recovery, or you can even use them simultaneously (but be aware of the security implications - you don't want it to leak, otherwise it beats the whole Trezor purpose).

For example, Electrum works great with HD wallets, but I'm sure you can find other clients as well.


Why was Blockchain.info DecryptWallet removed? https://blockchain.info/DecryptWallet.html has been removed for quite some time. Anyone know why?

PS. FWIW, an archived copy at Pastebin

Have a look at https://bitcointalk.org/index.php?topic=594570.0 for ways to export your blockchain.info wallet to another client.

As for the why, at this point I would say it has to be bad organization or possibly lack of funding. Blockchain.info has been fundamentally broken for quite some time (a quick search yields a post on bitcointalk over a year old for a still unresolved, somewhat minor problem: https://bitcointalk.org/index.php?topic=271633.0 and if you do a bit of digging you can find plenty more)


What does TruCoin do? I just saw that Gavin is employed with a company called TruCoin. Any idea what does it actually do besides help develop and QA the bitcoin client?

The about page (odd URL) doesn't explain it much.

From reading publicly available information it seems the intention of TruCoin is to create a set of stable business fronts that can benefit both the growth of bitcoin and also the company (ofcourse)

As we all know without stable business there will be very little growth. Working in close colaboration with the lead developer of bitcoin gives both a good understand of how to support the specific business metrics that bitcoin may demand when running a live and large e-commerce site.

Other upcoming sites may greatly benefit from any situations that they face and can certainly "test the water" for large organizations to use BTC.


Address creation in standard client - random library? Is the random library used by the standard client in any way deterministic, or can one count on it being truly random?

For example, often random libraries are initialized with seed value of the current time, like in C++:

srand(time(NULL));

But if someone was to iterate over reasonable ranges of time when a client started, eventually one would use the same seed value, and thus be able to generate the same addresses.

Is the random library used by the standard client vulnerable to such an attack, or does it also use some other variables that are unpredictable (say, temperature of the processor down  to such decimal places it becomes an unpredictable noise)?

In addition to microsecond time, Bitcoin seeds the random number generator with GUI events, /dev/urandom on Unix, and HKEY_PERFORMANCE_DATA on Windows (very random, constantly-changing data).


How many transactions in One Block? Block is collection of transactions.Who can decide Number of transactions per block? and How transactions are selected in block?

and How does the priority works for fee transactions?

Thanks

Transactions are broadcasted by anyone in the system and at random intervals. Which transactions, of all the ones broadcasted, are included is very dependent on the miner, as he/she is the one who groups them up and includes them in the block. As Nate noted below, there is also a 1MB block size limit which limits how many transactions can be included in a block. This limit is to prevent huge blocks that clog the network and may be removed if the number of transactions in the network ever grows such that the limit is a serious factor.

Good miners accept all transactions with the standard 0.0001 BTC fee (which is mainly a spam prevention measure). Bad miners are selfish and avoid including transactions to decrease their propogation time. For example, look at this block to see an example where a miner didn't include any transactions except for their own reward transaction.

If you look at https://blockchain.info/ then you can see how many transactions are included in each block.

As far as priority goes, again it depends on the miner, but in general miners like bigger fees and smaller transactions and may prioritize them that way.


Why did Dogecoin fork into 3 chains and not just 2? This I never understood ever since Dogecoin forked in mid-February 2014: If the cause of the fork was, apparently, the same as the one that affected Bitcoin in March 2013 (namely: a very long block being accepted by a new wallet using a different database but rejected by the earlier wallets) then...

How come there were up to three forks of he blockchain at a time? I would've expect at most 2 competing chains, one kept forth by the miners using the old version (then, 1.4) and another by those already on the new one (1.5, then). But, how was it possible to have three forks?

And finally (rant here), what was the point of increasing the size of the potential block size? In retrospect it's obvious something like this was going to happen. Why not treat the rules of a coin as set in stone once it's released, non-critical bugs and all? I had to delete the blockchain and resync twice, each time getting into a different, invalid forked chain - at the end I simply downloaded the files a volunteer shibe uploaded, with the potential risks that has - and hated the experience.

The articles you link attribute the forks due to raising the total coins limit. Which changed from 500 million to 10 billion. Now this by itself won't cause a block chain to fork, until there is a transaction larger than how many coins there should exist according to old and outdated clients. In Dogecoin's case someone created a 500+ million transaction that would create an invalid block from an old node's perspective.

To create multiple forks, you'd simply stem from newer blocks in the "outdated client" chain. Old clients would reject it and opt for blocks created by outdated miners and newer clients would be hit by a self inflicted 51% attack of sorts. Where newer nodes have multiple chains to sort and make a decision on. As an example here are the chains a newer updated node would have to choose from.

Original client chain
Original client chain with leading block containing one 500+ million transaction
Original chain with second-last block containing 500+ million transaction

It goes with the longest chain initially, but what happens if another chains mines a few blocks faster and becomes the leading chain? It switches over, and you have this complex multi chain scenario.

Why was the total coins possible limit increased?

The creator simply didn't expect this, all though it is really expectable. Dogecoin was set to mine itself out entirely within 1.5 years from release. Compare this to Bitcoin's ~2 centuries from now. Whoever configured these initial values expected Dogecoin to become irrelevant within this time frame or simply wanted cosmetically large block rewards to entice people.


How to mine solo Vertcoin? Now, I assume that probably all cryptocurrencies that have any value at all are impossible to mine alone for any realistic mining cluster setup, for a normal individual.

However, I have been curious about this for a while: How do you mine solo? If I want to run sgminer on lets say Vertcoin, using only my own miner, how would you do it?

I'm not looking for just some answer that describes the concept, but what commands would you actually issue to get this working with sgminer (omitting the performance specific arguments of course)?

Download the official wallet : https://vertcoin.org/wp/get-started/
Then, install it and wait for full sync (aka vertcoin blockchain download)
During the sync, look how to build a simple appropriate vertcoin.conf file which had to be store in the appropriate vertcoin folder (%appdata%/vertcoin in windows)It basically look like this :

rpcuser=WORKER

rpcpassword=SUPERPASSWD

rpcport= X // CheckDefault rpcport vertcoin

daemon=1

server=1

listen=1

Then restart your wallet (node)
Download the appropriate miner according to your hardware configuration https://vertcoin.org/wp/mining/

Create a batch file

sgminer -o 127.0.0.1:rpcport -u WORKER -p SUPERPASSWD -I 13

Make sure to be fully synchronized with the vertcoin network before start it.Hope for the Best
It's not an exhaustive solution but it gives you a good overview about how to set up a solo mining configuration


Is there a database of wallet addresses with lost private keys? Hi is there a database of wallet addresses that have lost the private keys?

No, because it's not possible to prove a negative ("No I don't have the private key for that address") and I can't think of a use for that.


Error compiling altcoin-qt for Windows, getting a GCC internal compiler error I think I managed to get all my dependencies and libraries right (fingers crossed), but now when trying to build blackcoin-qt, the QTSdk compiler gives me this error while building qtipcserver.o:

In function 'bool boost::interprocess::winapi::unlink_file(const char*)':
internal compiler error: in gimple_rhs_has_side_effects, at gimple.c:2343
[build/qtipcserver.o] Error1

The unlink_file function is on line 1638 of win32_api.hpp in the boost library. This seems like a GCC error, any ideas?

Most likely cause: the compiler ran out of memory.


Transacting bitcoins while there are no Accept rules in iptables Is it normal for the network to work without any ACCEPT rule? Because now my iptables have INPUT DROP, FORWARD DROP and OUTPUT DROP only port like ssh, http(s), 53 it's open.
I don't add any rule for port 8333 and 9333 but it works and if I telnet (with this tool http://www.adminkit.net/telnet.aspx) port  8333 or 9333 I have an error message

  Connection failed: A connection attempt failed because the connected
  party did not properly respond after a period of time, or established
  connection failed because connected host has failed to respond

I add here all iptables rules
http://notes.io/qZkF

I tried to send btc from external source and I received it. In bitcoin.conf I have

  rpcport=9333

Netstat -tulpn

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      19626/nginx.conf
tcp        0      0 127.0.0.1:9333          0.0.0.0:*               LISTEN      3537/bitcoind
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2446/sendmail: MTA:
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      19626/nginx.conf
tcp        0      0 0.0.0.0:5565            0.0.0.0:*               LISTEN      2416/sshd
tcp        0      0 0.0.0.0:11111           0.0.0.0:*               LISTEN      8575/php
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      2936/mysqld
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      2446/sendmail: MTA:
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      2440/memcached
tcp        0      0 0.0.0.0:8333            0.0.0.0:*               LISTEN      3537/bitcoind
tcp6       0      0 ::1:9333                :::*                    LISTEN      3537/bitcoind
tcp6       0      0 :::5565                 :::*                    LISTEN      2416/sshd
tcp6       0      0 :::8333                 :::*                    LISTEN      3537/bitcoind
udp        0      0 127.0.0.1:11211         0.0.0.0:*                           2440/memcached

Last debug.log

2015-11-22 16:33:33 receive version message: /bitcoinseeder:0.01/: version 60000, blocks=230000, us=[xxxx:xxxx:x:xxxx::]:8333, peer=304
2015-11-22 16:34:01 ERROR: AcceptToMemoryPool: free transaction rejected by rate limiter
2015-11-22 16:34:01 keypool reserve 47
2015-11-22 16:34:01 keypool return 47
2015-11-22 16:34:11 receive version message: /bitcoinseeder:0.01/: version 60000, blocks=350000, us=[xxxx:xxxx:x:xxxx::]:8333, peer=305
2015-11-22 16:34:11 ERROR: AcceptToMemoryPool: free transaction rejected by rate limiter
2015-11-22 16:34:12 ERROR: AcceptToMemoryPool: free transaction rejected by rate limiter
2015-11-22 16:34:31 ERROR: AcceptToMemoryPool: free transaction rejected by rate limiter
2015-11-22 16:34:38 ERROR: AcceptToMemoryPool: free transaction rejected by rate limiter
2015-11-22 16:34:44 ERROR: AcceptToMemoryPool: nonstandard transaction: dust
2015-11-22 16:34:53 receive version message: /bitcoinseeder:0.01/: version 60000, blocks=350000, us=[xxxx:xxxx:x:xxxx::]:8333, peer=306

With PHP I use this

$server = new jsonRPCClient("http://$user:$passwd@127.0.0.1:9333/");

Update: I think it's because I have these rules

iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

Is it a good idea to close port 8333 and 9333?

Telnet says 'Connection failed' which means others will not be able to connect to you. Your iptables is working as it should.

You may be mistaken thinking that bitcoin is working without ACCEPT rule because you are seeing outgoing connections. Probably 8.

Your netstat shows bitcoin is LISTENing but if iptables doesn't ACCEPT then it will never see any incoming connections.

Try netstat -na | grep 8333 and you will see only outgoing connections (source address: you).

To make your bitcoin node reachable to the outside world simply add a rule to accept 8333.

Note do NOT open 9333 ! It's meant for local use only and you might lose your bitcoins if people get access to it (in fact you're better off disabling it if you're not using it).


Can you explain some of the dynamics that drive the variations in mempool depth? I often see mempool graphs such as Jochen Hoenicke's that show significant fluctuations in mempool depth and hence the fee needed to get into upcoming blocks. Can you explain some of the dynamics that are driving these variations?
Should I be monitoring and understanding these graphs before making a transaction if I want to choose an opportune time to broadcast a lower fee transaction?
I have heard it is generally better to broadcast transactions at the weekend as there is less activity on the network. Is this a good rule of thumb such that I don't need to monitor these graphs?

Mempool basics
When a bitcoin user wants to pay another user, they craft an announcement to the whole network. This announcement takes the form of a transaction which specifies the funds that are being spent and the funds to be created. It also includes proof that the message was authorized by the owner of the spent funds. These payment promises are gossiped through the network. Each node keeps track of unconfirmed transactions in their individual memory pool (mempool).
As transactions are gossiped through the distributed network, the mempools of any two nodes generally overlap greatly (and I refer to this overlap as "the mempool"), but do not match exactly. Particularly, two nodes may receive transactions at different times or even have conflicting information altogether. The network needs a mechanism to resolve conflicting information among participants and converge on a common state. To this end, some nodes, called miners, assemble sets of unconfirmed transactions and propose them as updates to the network's state. The protocol performs a perpetual distributed lottery to select one among the many proposed updates to the shared state. The winning block commits the transactions to the network's journal (the blockchain) and indicates to participants that they should update their copy of the ledger (the Unspent Transaction Output set).
The protocol limits the overall transaction data as transactions consume resources of all participants in the network. Blocks are limited to 4,000,000 weight units, and the network regulates itself by targeting a stable block interval.
On the other hand, the amount of transactions that get submitted to the network is flexible. Miners can often not include all transaction that are queued in their mempools and they pick which (valid) transactions to include. Each transaction offers miners a small amount of bitcoin to incentivize inclusion in a block. Miners generally choose the transactions that pay the highest feerate (fee per weight unit) to maximize their revenue.
Especially, when bitcoin's exchange rate makes big swings, the volatility prompts people to participate in the market. As "being your own bank" is a core tenet among many Bitcoin users, a lot of people do not keep funds in exchange accounts but in wallets fully controlled by themselves. This means that market moving news and price swings often prompt the creation of higher than usual transaction traffic. Once the transaction creation rate exceeds the available blockspace supply, the mempool grows quicker than transactions get confirmed.
Anecdotally, transaction creation seems to follow a daily and weekly cyclical pattern. Transactions pick up with the start of the business day in Europe, and slow down with the end of the business day of the US west coast. The mempool usually shrinks between those hours as the Asian markets currently do not seem to produce as much traffic. Generally, the transaction volume drops on weekends. These patterns are sometimes overshadowed by other influences such as price rallies, or slumps in the hashrate that reduce the blockspace production.
Reading the mempool chart
As mentioned before, each node keeps their own view of the queued transactions in the so-called memory pool (or mempool). Jochen Hoenicke's website publishes mempool statistics of his own node. The website has three different graphs:

Unconfirmed Transaction Count (Mempool)
Pending Transaction Fee in BTC
Mempool Size in MB

All of the below charts show  the "mempool size in MB" from Jochen's site.

In the past few days, transaction creation has been exceeding transaction confirmation and more than 50 blocks worth of data have accumulated in the queue. This is about 1/3 of a day's capacity as the network targets 144 blocks per day. As users have varying urgency to see their transactions confirmed, they bid accordingly for inclusion of their transactions.
The colors in the graph represent different feerates. The feerate of a transaction is the ratio of fee per data amount. The higher the feerate, the more money a miner will make by including the transaction in their block.

The blue bands in the bottom represent low-urgency transactions. The users may just be consolidating dust or have other reasons to prefer low cost over quick confirmation. The blue bands collect transactions in the feerates of 1–10 sat/vB.
The green bands in the middle consist of transactions that want to get some priority, but are unwilling to pay a premium to get confirmed as quickly as possible. These are users usually aiming to see transactions confirmed in a day or two. The green bands collect transactions in the feerates of 10-40 sat/vB.
The yellow (and red) bands at the top are users vying for express confirmations. They usually choose their bids to get confirmations within the next hour. These transactions could for example facilitate business deals or attempt to enter a market as quickly as possible. Yellow ranges from 40–140 sat/vB, red starts at 140 sat/vB.

While the transaction creation exceeds block capacity, the mempool grows more quickly than it shrinks. New transactions attempt to skip to the front of the line to make yet a higher bid and especially get added to the top. This pushes up the top feerates.

Eventually, the transaction creation slows down and drops below the rate of blockspace production. The mempool starts clearing from highest feerate to lowest feerate.

However, during a market frenzy or a hashrate slump, the demand for blockspace may exceed production for an extended period of time and bridge the nights and weekends which have lower blockspace demand. For example, in May after the third halving, more than 50 blocks worth of transactions amassed in the 1-2 sat/vB band (the lowest blue) when the transaction queue did not clear for over two weeks.

Last weekend, the mempool did not clear out either.

This is by no means the worst we have seen. In the 2017/2018 winter, around the time that the Bitcoin price reached its latest all-time-high, the transaction queue never fully cleared between Oct 26th 2017 and February 22nd 2018.

At the peek, just before Christmas, Block 500,546 collected 14.82150630 BTC for an average feerate of 1,415 sat/vB.
When to send your transaction
This really depends on the urgency of your transaction. If you need to make a payment that will be confirmed soon, you will need to be aware of the current queue and bid appropriately near the top. If you can choose the time of your transaction, you can either send with a lower feerate and just wait for the mempool to clear to that level, or wait for the transaction queue to recede to the levels you are willing to pay and submit your transaction then.


Does AUTHORIZATION_REVOCABLE flag affects all credits help or up to any amount? If one issues currency with AUTHORIZATION_REVOCABLE flag, and account A hold 100 credits of it, can issuer revoke only 13 credits? Can account A spend the rest 87 credits as normal?

No it isn't that fine grained. The credit will just be frozen until the user deals with the gateway and the gateway unfreezes.  The gateway could of course unfreeze the credit after 13 of it is sent back.


Altcoin creation from bitcoin ReadBlockFromDisk: Errors in block header at CBlockDiskPos I am trying to create a altcoin using bitcoin source code.

i have changed the pszTimestamp, port number, magic number. I have cleared the DNS seeds and removed checkpoints for now.
Then I printed the following values using printf and updated the new values:
genesis.hashMerkleRoot and genesis.hashMerkleRoot

In the log file I see this error:

  2017-10-04 18:32:29 ERROR: ReadBlockFromDisk: Errors in block header at
  CBlockDiskPos(nFile=0, nPos=8) 2017-10-04 18:32:29 *** Failed to read
  block 2017-10-04 18:32:29 Error: Error: A fatal internal error
  occurred, see debug.log for details

I tried to debug the code and i see that this is where it fails in pow.cpp :

 bool CheckProofOfWork(uint256 hash, unsigned int nBits, const Consensus::Params& params) {
      bool fNegative;
      bool fOverflow;
      arith_uint256 bnTarget;

      bnTarget.SetCompact(nBits, &fNegative, &fOverflow);

      // Check range
      if (fNegative || bnTarget == 0 || fOverflow || bnTarget > UintToArith256(params.powLimit))
      {
          LogPrintf("\ncase 1\n");
          return false;
      }
      // Check proof of work matches claimed amount
      if (UintToArith256(hash) > bnTarget)
      {
          //LogPrintf(bnTarget);
          LogPrintf("\ncase 2\n");
          return false;
      }
      return true;
 }

It prints case 2. What does this mean? What am I missing?

instead of using merkel hash from the code run i used a genesis block generator to generate the hash,nounce. it took an hour to get the values using this code:

https://github.com/Gnaf/GenesisBlockZero

then i used the values from this and it worked.


How i can delete last block from blockchain? altcoin How can I delete the last block from blockchain to be ready for hardfork.
What I mean is, in blockchain last block is with error's. I want to delete those blocks, for the new blockchain is disabled from the last block.

How can I mine new block if last block would be 1 day old? How do I understand that the daemon does not start giving work to pool/miner, if last block is very old? They will be trying to find new block's from peer, even if it does not exist ?

You can't delete a block, just mine a new block on top of the previous block, creating a fork. Just reference the parent block as the parent of your new block, and if you mine more on top of your new chain, it will become the accepted chain.
The age of the block shouldn't matter.


Why is my bitcoin wallet keep telling me: there was a problem sending your transaction uneconomical UTXO requested That is what I keep receiving when I try to sent my bitcoin to another wallet address ...

To state simply, you don't have enough money to send, your output was 4142 satoshi in the previous transaction but you need 22013 satoshi, try to find out if this is because of hidden tx fees or your trying to send from the wrong wallet/ transaction chain


With Ripple, is it possible to have XRP IOUs? Just as there are USD IOUs, EUR IOUs, BTC IOUs, and so on, is it possible to have XRP IOUs in the system?

If yes, could XRP IOUs be used as transaction fees?

We debated how to handle XRP IOUs during the design. Ultimately, we decided not to have any official support of them because of the potential for user confusion. However, we did reserve the currency name "XRR" for IOUs denominated in XRPs. There is no built in mechanism to pay them off with XRPs, but it's not difficult to place a 1-to-1 exchange offer. Such functionality might be added in the future.

We also debated allowing IOUs to pay transaction fees directly, rather than having to first exchange them for XRP. We couldn't see any advantage and there are some significant disadvantages in addition to the added complexity. The big one is the exchange rate might change such that the transaction can't claim a fee and we wouldn't discover that until the transaction was processed. There was a fear someone could bombard the network with such transactions and cause high load at no cost. Instead, we decided to try to keep transaction fees so low that there would be no reason to care.


Paper wallet generator that can split a private key into multiple parts like a multi-sig transaction? Are there any paper wallets that lets you split a private key into multiple parts like how a multi-sig transaction works? Sure I can just print out a paper wallet and cut it up into 4 pieces and give one to each user, but I'm wondering has anyone solved such an issue? A good use case is cutting up a private key and giving each one to a family member. In order to form the private key back, all parties must be present.

www.bitaddress.org offers something similar to your description. It's under the Split Wallet tab once you generate enough entropy. You can even specify a m-of-n multisig.


Problems decrypting my bitcoin-wallet on android So I dropped my phone in the toilet... Of course I immediately turned it off and went with the rice technique. I realized later that I had coins on my phone on the bitcoin-wallet on android . Luckily, i was able to turn the phone back on after a day and the first thing I attempted on doing was backup my wallet. I used the back up function and was prompted to enter a password to encrypt with. I did. Then I wanted to decrypt the password (to prove in case of emergency that I could).

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

When trying this I'm asked for the password, which I give. Then I'm given a bunch of garbage.
I have found that I'm using version 3.53  . Thanks in advance for the help.

If you didn't see the error message bad decrypt, and if the garbage you saw had the string org.bitcoin.production, then the decryption worked.  In recent versions of Bitcoin Wallet, as explained in the README, the wallet backup is no longer encrypted plain text but a custom protobuf format.

You can write the decrypted wallet to a file using the -out option to openssl, which is probably more useful than dumping it on the screen.  However, if you want to read it or extract the keys manually, you'll probably need special tools, which I am not sure if anyone has written.  See also Is there a known way to export my wallet private key from the "Bitcoin Android" app (com.bitcoinandroid)?, though it may or may not be current.

If you did see the message bad decrypt then you got the password wrong.  Try other variants.

The intended way to use the encrypted backup file is simply to copy it back onto your phone and restore it into the Bitcoin Wallet app with the "Safety:Restore Wallet" option.  You don't need to manually decrypt it with openssl unless you are trying to do something fancy.


What would happen if two blocks had the same hash? Consider the following scenario:

January 2016 block A gets submitted. Its hash is 0001010.
January 2017 block B gets submitted. Its hash is also 0001010 (collision).
10 minutes later, block C gets submitted and the previous field points to the hash 0001010.

Is it still possible to determine that the previous block is block B and not block A?

Note that while this is unlikely, there are not 2^256 possibilities a block hash can be. Every block hash has to start with zeroes which decreases the amount of possibilities. In this scenario there are only 2^4 possibilities even though the hash has 7 bits which would theoretically allow 2^7 possibilities.

Blocks are identified by their hash.

This means that in your story, in Jan 2017, when B gets broadcast, any node that it is advertized to will think "I already have this block", and ignore it.

However, when we consider block hash collisions to be a realistic situation, there is another issue that may arise:

If two blocks with the same hash and the same parent are produced ~simultaneously, one of which is valid, and the other is invalid (but does have valid proof of work), some nodes in the network will see one first, and others will see the other first. Those who see the invalid version first will mark the block as permanently invalid, and they won't bother even trying to learn about the valid one when another block builds on top. This would lead to a permanent chain fork between the nodes who saw the invalid block first and those who saw the valid one first.


Can you generate bitcoin addresses without storing a private key? Suppose you have a possibly compromised system, which you do not trust enough to stores your private keys on.

Is there some process where you can generate unique bitcoin addresses within the system, that does not contain a private key?

To clarify:

You have a web server that clients use to make orders. You want to create a unique bitcoin address per purchase. In addition, you don't want the server to contain your bitcoin private keys - an attacker gaining access to the server shouldn't be able to touch your bitcoins.

Yes

I love how all the upvoted answers talk about multisig or electrum but the one answer that mentions HD wallets is at -1.

HD wallets allow you to do this.

TL;DR Derivations per level on an HD wallet use 3 portions in 2 different hashes. 1 hash requires the parent public key and parent chain code (summed together creating the parent extended public key) and the other hash requires the parent private key and the left half of the output of the 1st hash.

Confused? The diagram at the bottom oughta help. At the end of the day, the private keys used to sign are derived from the chain of private keys all the way from the ECDSA key. If you only derive from the extended public key (public key + chain code) then you can derive as many addresses as your heart desires without giving up the private key. Minus the chain code and you're unable to generate many addresses (chain code gives up privacy AKA ability to derive many valid addresses)


Are there any online wallets available for Litecoin? Are there any litecoin wallets available on the internet right now? I have a mac and the mac version software is very confusing.

We have just released http://www.coinwallet.co which supports Litecoin.


How would one audit that the mgwBTC - Multigateway assets are backed by 100% Bitcoins? I am curious of how would one audit the mgwBTC multigateway for nxt to make sure they aren't doing fractional reserve. They say its backed by 100% deposits, but how can we verify such claims? i want to use the platform, but I'm sure others have similar concerns of trust.

They say this eliminates another mtgox fiasco, but just to be sure everyone should be able to audit multigateway's internal books to make sure its really 100% backed by deposits.

I'm no user, and just discovered multigateway, I've read their docs, using my understanding, it seems that when you deposit Bitcoins (or anyother coin) to them, they create a new Bitcoin (or anyother coin) address for you only for which they hold the private key.

You [edit] would [/edit] therefore monitor, that your mgwBTC amount match exactly the coins at the public deposit address, at all times (just give it a little time for transactions to settle). If this is true for any anounts and at all times, they are not doing fractional reserve.

[edit] If they transfer the coins on the deposited address to another address (which is a better practice (see below)) you can't prove anything for sure, as you have no vision on the total of mgwBTC in circulation (and issuance process), nor can you know for sure that they really own the public address, and not for example rent some payment services from an address which has lot of bitcoin to inspire confidence (unless their whole book is public (and proven so), you then aggregate all transactions, see where the funds are coming and check it started at 0 and everything adds up the way it should)[/edit]

But a word of caution here, them not doing fractional reserve is not an all risk guarantee. It may even be considered bad practice. Their keys may get stolen at any time. All coins are 'live' (because of the no fractional reserve guarantee), this means if they get (self?) hacked, 100% is gone almost instantly. Whereas exchange usually have most of the cash on frozen addresses, whose private keys are not stored on a device connected to internet.

If there is a bug in their system, and for example their transactions are not really 'transactional' which is kind of hard to do in a distributed system and some mgwBTC got double spent, their transaction algorithm will automatically adjust your BTC deposit to match the mgwBTC. Which means if someone can steal some mgwBTC they can steal your deposited BTC.

An other word of caution: they seem to only release binaries of their software, which is not good for inspiring trust (but they are still beta).


What is the difference between the two transaction headers on the Bitcoin Liquid sidechain network? You can see transactions for this asset
https://blockstream.info/liquid/address/H4UWQS836njW4QJ6WfkGAPjaYtK2twLnZE
For the second transaction, it has a header of

802dc4c4a08fcf4f50e4320bdb5eb596afc01c95dd0ff6afb83304aeb989be15 (2020-01-07 11:21:58 UTC)

Underneath the transaction, is a another header of

81efc96bea93fcb5992831d8311dec63a0b1d17072ec2e6f1263901b1bd26000 (2019-10-31 19:05:58 UTC)

What is the difference between these two? why does one transaction have two headers?

Tx: 802dc4c4a08fcf4f50e4320bdb5eb596afc01c95dd0ff6afb83304aeb989be15
Inputs:
38V6gLL6kVCWhfXPo4t5x1gMfg5BKe3Rv
H18z1ifzs184pzwTABag5gv47AAxZSi1qg
Outputs:
H38V6gLL6kVCWhfXPo4t5x1gMfg5BKe3Rv
H4UWQS836njW4QJ6WfkGAPjaYtK2twLnZE
GnHogGZpDCwmskKFJoVhuvgUg6gKhWQjy6
Tx: 81efc96bea93fcb5992831d8311dec63a0b1d17072ec2e6f1263901b1bd26000
Inputs:
Gm5rw7zmqdMV1ajbT6zTEEDJhSHK1Ymdfq
H38V6gLL6kVCWhfXPo4t5x1gMfg5BKe3Rv
Outputs:
H38V6gLL6kVCWhfXPo4t5x1gMfg5BKe3Rv
H4UWQS836njW4QJ6WfkGAPjaYtK2twLnZE
GisytKX4AhQ8B1aH4p9fHsNuRbpzSr1VdF


Is it ok and safe to import master public key from electrum wallet into bluewallet to be a watch-only wallet? I want to use my iPhone (Blue wallet) to be the watch-only wallet for my offline wallet generated on electrum. So that I can generate unsigned transaction on the bluewallet and send it back to my offline wallet to be signed on electrum. And then send the signed transaction back to bluewallet to be broadcasted.
Is it safe to do so? Is there any better way to do it so I don't have to send the unsigned and signed transaction back and forth?

Is it safe to do so?

It should be considered safe. For better privacy and security, using your own Electrum server in Bluewallet could also help. Creating transactions in a watch-only wallet using bluewallet and signing them using Electrum offline has no issues.

Is there any better way to do it so I don't have to send the unsigned and signed transaction back and forth?

After signing the transaction you can broadcast it from anywhere. For example: I can sign it on a mobile device which is not connected to Internet but can send text messages, can encode transaction hex and broadcast it using text messages. Related Q&A
Or you can broadcast transaction using this link in Tor browser on an online device: http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/nojs/tx/push but you will have to copy the transaction hex after signing or maybe just scan QR code.
FullyNoded is also a good project that you may find interesting considering you have an iPhone.


What is the "Maintenance" amount referring to on the bitcoin exchange Bitcoinica? I have tried out Bitcoinica, and although it is complicated i like it a lot!

What confused me is the "Maintenance" amount shown in the Account overview. It looks like it is not explained on the website.

If it is the fee, it is quite steep, i must say..

No, it relates to when you have a margin call for your open positions. From their FAQ:

  What's your Margin Call Policy?

  After you've logged in, you can immediately see your real-time account
  Net Value (total assets) and Maintenance (minimum net value). When
  your Net Value falls below twice the amount of Maintenance, we will
  issue a margin call. If you don't take actions before your Net Value
  falls below Maintenance, all your positions will be liquidated
  automatically.


How can a Bitcoin Oracle ensure that the money can't be respent? Suppose I modify the requirements of the Inheritance Scripting Sample where I need to make sure that the prior BTC is "guaranteed" to be available and not reduced or re-spent prior to either of the preceding events:

The 18th birthday arrives
The oracle verifies that the man is dead

With the additional requirement that the Oracle can't hold the transaction hostage for a ransom (since it would know how much is due to the payee), is there any way to use scripting to cover the condition that the previous funds can't be respent?  How can this be done?

(elaborating on the comment I gave to the question)

You do this by wiring the funds to an address controlled by both you and an oracle (or a set of oracles). You do this by utilizing a bitcoin multisig address.

That way there's no way for you to move the funds away without oracle's permission, and there's no way for oracle to run away with funds.

As for preventing oracles from holding the transaction hostage, you can use distributed oracles - i.e. a set of independent oracles. So, to withdraw the funds you'd need a signature of both yourself, and say 8 out of 15 oracles. If you choose oracles wisely, the chance for them to collude and hold your funds for ransom should be minimal.

You can consult Orisi Whitepaper ( https://github.com/orisi/wiki/wiki/Orisi-White-Paper/ ) or website (oracles.li) or github repo (https://github.com/orisi/orisi) for more info.


Default behaviour when network partitions/pruned network From people oposed to SegWit I have heard about the argument, that after SegWit activation, nodes may chose to drop/prune all Witnesses. From my understanding, this may not be much different from nodes who are already only storing a pruned version of the blockchain. And a node using the ruleset from SegWit would not accept a block without the witnesses, only the backwards compatible nodes that do not follow the ruleset from Segwit would?

My question is what the default behaviour of a core node is, when it receives block up to X, and the blocks thereafter are only header-files with the actual block data pruned.

In other words: what happens if my node is somehow kept away from the true/whole bitcoin network, so that my node only receives pruned blocks which cannot be verified. Would my node only accept the blocks up to the one which was a block with complete data and drop the rest until complete data is received for those? What if my node is a mining node?

Bitcoin Core does not support pruning witnesses. It supports pruning blocks entirely, but that is independent from segwit.

No full node in the network will accept a segwit block without the witnesses. It's simply impossible to validate a block without it, so not having a witness is treated as equivalent to not receiving a block at all.

SegWit does enable dropping witnesses for relay. It is a bandwidth optimization for lightweight clients, because they don't care about the witness data in the first place.

In theory, nodes could indeed choose to not store witnesses at all, but why bother? They can already delete the blocks entirely if they don't care about serving other nodes that want to verify history.

All pruning node have a minimum requires number of kept blocks, which corresponds to a few days of time. That should be sufficient to overcome reorganizations and temporary partitionings.


As of Feb 2013, which are the top 5 bitcoin mining pools to join with a good community? I'm looking to join a bitcoin mining pool. Which are the top five mining pools with good community support?

According to the blockchain.info's chart, as of Feb 2013 the top mining pools apparently are:

BTC Guild
50BTC
Deepbit
Slush
EclipseMC

I can't say for the "good community" since that's obviously quite subjective.


Bitcoins transaction is completed but I don't get the coins I got the bitcoins but it's not getting added to my wallet, I even got the email etc. and it shows up but see this

Transaction is not available at this time

The transaction ID would be helpful to further diagnose what went wrong, however without that information, you can try the following:

Refresh the transaction cache.

Go to "Settings" (gear icon)
Choose the BCH wallet
Go to "More Options"
Choose "Transaction History"
Choose "Clear Cache" to reset your transaction list.

Note that it will say 'Updating Wallet' until the list has been retrieved.

Refresh the server's cache.

Go to "Settings" (gear icon)
Choose the BCH wallet
Go to "More Options"
Go to "Wallet Addresses"
Choose Scan addresses for funds

Note that it will say 'Scanning Funds' until the addresses have been scanned.


Running bitcoin core in a low storage system I have a machine with ~40GB in storage. The Bitcoin block chain is ~75GB in size, is there any chance to run bitcoind in my system? I mean, can I somehow skip downloading some part of the block chain?

Thanks in advance for any answers.

You cannot skip downloading the blockchain, but you can skip storing it.

If you run Bitcoin Core with the -prune=N or put prune=N in the bitcoin.conf file, only at most N megabytes worth of blocks will be stored on disk. N has to be at least 550 currently.

Pruning does not reduce the validation or security at all, but does prevent your node from serving historical blocks to other peers.


bitcoin transaction showing unconfirmed over 6 days A friend sent some bitcoin to me worth $91 on May 7 2017 (with extremely low fees without initially telling me). It show unconfirmed till 10 may 17 when it returned to sender and was able to login and send bitcoin to other users.  Surprisingly, I login this morning and the bitcoin has resent itself to my wallet.  Since then I have tried two transfer with extremely high fees.  It is showing pending and I need those transfer to really go through. Pls how do i solve this problem. The hashcode is b27e371f54cd24d2bdcc8d9e283dc7929589949c6d8ab47232feb6d13cb9f778.
Please I need urgent help.

The only thing we can do is to wait for the transaction confirmation, like me now. This link show that more than 120.000 transaction unconfirmed including ours https://blockchain.info/unconfirmed-transactions

Hope that we get confirmed before it resent


Signing a Segwit Multisig Transaction I am creating some test code which can create transactions and sign then, I already could do it with NON-Segwit multisig address, they were signed using my code and broadcasted.
But when I tried with Segwit multisig, I got problems, it was not signing it right.
Can someone walk me through the steps of creating and signing a multisig segwit transaction?

It sounds like you are using the non-segwit sighash algorithm. This is not correct. Segwit uses a different sighash algorithm as defined in BIP 143.


Why miners solve a puzzle in proof of work I am new to block chain, In PoW, I know a puzzle is given to the miners to solve and the miner who solve the puzzle and find the nonce first will create the block.

But I don't understand why there is such a mechanism like solving a puzzle and finding the first one to create the block, is this puzzle is used to find the miner with more computational power? so he can create the block quickly?

No, the time spent creating a block is tiny and even a simple cell phone could make it in a few microseconds, if we leave aside the puzzle-solving time.

The purpose of mining is not to find who has the most computational power, but to make those miners with lots of computational power to 'waste' electricity. I say 'waste' but it's not actually wasted because mining itself is important. I mean in the sense that, to create an artificially scarce resource - bitcoin - mining was designed to take advantage of naturally scarce resources: electricity and computer time.


Before Mining Genesis Block Im trying to make a test altcoin and I created the genesis block, merkle root and nonce. When I compile and run the daemon, The coin is trying to connect other IPs for hours so I can't mine the genesis block. I've changed P2P and RPC port.

Why is this happening ?

You're supposed to run a 2nd daemon and let that one connect to the first one


multiple low end miner or 1 high end miner Newbie here,

Im torn between buying a GTX 1080 or multiple 1050

Is there any Pros and Cons on having multiple but slower miner?

Thanks!

The money in mining is really from the increasing value of the coin you have mined. You may make mre mony just just investing in coin rather than the rig and mining but where's the fun in that. So lets get mining.

You will want to spend the least on your rig and your electric as possible. You will want to mine a coin with the most profit AND most potential. Here is what my friend and I have discovered.

Ethereum mining got exciting when the price went up. I don't think it was ever spectacular to mine. The problem is that it needs a NEW graphics card since these have 4GB of RAM or more. This causes a problem since the miners cleaned out all the best ones and all the new GPUs doubled in price.

What we found was in terms of HASH rate a HD5870 for £25 is the same as a RX560 for £160 except you are limited to NeoScrypt on the HD5870.

We found that the HD5870 was making about the same money on PhoenixCoin as an RX560 would make on Ethereum but a lot shorter return on investment.

We started simply by fitting an HD5870 into our existing PCs but we wanted more. So we got hold of the crappiest scrappiest old PCs and fitted the £5 PCIe extenders and bigger PSUs to support more cards. We hit ebay and bought every cheap HD5870 going.

We found we can use an extra PSU to drive an extra GPU with a paperclip between the green pin and the black pin to make it come on.

Your motherboard wants as many PCIe sockets as you can get. The Crossfire ones are good as they take two cards. The little PCIe x1 sockets will mine perfectly well too as long as you use the PCIe extender to fit the GPU.

No need to have a decent CPU. We're using a Celeron and an Athlon 64 with 2GB RAM and a hard drive big enough to hold a wallet and Windows 7 64 bit. Then using the NSGminer neoscrypt on PXC, PhoenixCoin. Using The Blocks Factory mining pool.

We've now got some ugly noisy mining rigs that are making us about a £1 a day and using who knows how much electric, we don't care. Calculations suggest that as difficulty rises the coins first mined will rise in value to say £100 per day. OK so we will always only ever mine £1 per day with these rigs but effectively we're mining £100 per day.

Clearly we're insane to think that would happen but then look at the insane price rises that have already happened. Mining is all down to the price rises, otherwise it's nothing.

You ain't gonna know if you don't do it and if you only dabble in it as I did in 2013 and then see "what you coulda won" then you'll kick yourself. Do get your wallet sorted and make a 'paper' backup. I came back to my BitCoin wallet that had £20 in it from Christmas to find it was £100!

So even if this is just a bubble you learn something and keep the house warm this winter. Have fun.


digitalcoin wallet won't sync I've had my digitalcoin wallet open for a few days now, hoping it would eventually sync back up but it's seemingly stuck, not necessarily at a specific block, but around 3 days back, whichever block that may be.

I have several other wallets that all sync fine.

Is there something wrong with digitalcoin or is it me?

What would the repair process look like for "resetting" the wallet?

thanks for the help!

Make sure you backup your files before doing this!!

This might be late, but you need to replace the following files in your system.

p2pstate.bin
blockchainindices.dat
blockindexes.dat
blocks.dat
blockscache.dat

MacOS: ~/.digitalnote

Linux: /home/Your username/.digitalnote

Windows: C/Windows/Users/Your username/AppData/Roaming/digitalnote

Here is a video on how to do it for MacOS: https://www.youtube.com/watch?v=_QCeQxsZxus


P2SH (pay to script hash) within a script? BIP16 P2SH defines special rules to apply on scripts with a specific pattern, namely:
OP_HASH160 <scriptHash> OP_EQUAL.

My question is: Can a P2SH be used within a script? So can I e.g. make a scriptPubKey:
<420000> OP_CHECKLOCKTIMEVERIFY OP_DROP OP_HASH160 <scriptHash> OP_EQUAL?
Or must all additional opcodes be in the redeemScript so that the whole scriptPubKey follows the pattern mentioned in the BIP16 above?

No, P2SH can only be invoked using the exact magic pattern described in BIP16 in the scriptPubKey and not using any variant of it, nor recursively inside the P2SH redeemScript itself.

Earlier proposals (see OP_EVAL) existed that did allow much more flexibility, but it was hard to give strong guarantees about execution time and memory in such a model.


Import bitcoin core generated multisig public address to electrum multisig wallet for watch(2/3) and sign(1/3) I have 3 Machines, and I want to create (2/3)multisig wallet. Sign with other machines safely.

I have;
xpub1, xpub2, xpub3
xpriv1, xpriv2, xpriv3

Machine-1: In electrum:
New/restore->Multisig Wallet->Use a master key->2/3->Cosigner1: xpriv1, cosigner2: xpub2, cosigner3: xpub3,
for watching (2/3)multisig wallet and partially sign(1/3).

How to import machine-2 generated public addresses to Machine-1 for watch(2/3) and partially sign(1/3)?

The electrum wallet database is look like json formatted. Am I need manually enter there(json["addresses"->"receiving"]) or any other way to import a corresponded addresses

As you were told on bitcoin talk forum you can't import arbitrary private or public keys and create a multisig setup with them using electrum. It only supports using extended private and public keys or seed words for this functionality.

If you just want to create a watch only wallet with the address itself then you can do that. Go to file > new/restore, enter a unique filename and click next and when asked what type of wallet you want to create choose the option to "import bitcoin addresses or private keys". Then paste in the address in the next step and proceed with on-screen instructions for the rest. This will let you watch transactions relevant to this address but you won't be able to sign any outgoing transactions.


Is there a JavaScript library for validating P2SH addresses? I looked at coinstring.js but it looks like it only validates simple BTC addresses (1-prepended addresses).

  isValid(base58str, version)

  Validates whether the address string or wallet import format string is valid.

  base58str: A string that is either the wallet import format or public address.

  version: Is an integer representing the version or Buffer. See below for more information.

  Returns a true or false.

I'm looking for a JS library that can validate BIP16 P2SH addresses.

You can use the library you've linked.

Instead of using:

isValid(address, 0)

use

isValid(address, 5)


What is the best way to implement withdrawal in online service? Suppose we have a service, which holds user balance in Bitcoin.

How to implement withdrawal from bitcoin perspective?

Which RPC call to use? How to archive transaction to have a proof of sending money to user? How to prevent duplicate money send in corellation to SQL transaction?

The most important thing is to prevent dual-submission having in mind power loss at any time. So we should have a way to mark some money as "possible sended" + some way to check in future time if it really was succesfuly sended and stored in blockchain.

(note that I am not asking about security, ACID transaction itd. I am interested in a way to comunicate with wallet daemon service)

As far as I know, there is no third-party ID could be associated with a bitcoin transaction. This means, if the power goes down, you would not be able to determine if the transaction "made it" by looking at block chain for the sender and recipient wallets.

But wallets and transactions are cheap. So you can create a pool of wallets and then intelligently rotate them making sure you lock on one until the entire transaction is complete and confirmed with public records. Then based on exclusivity of access you can determine BTC transaction hash for your system transaction record.

To take this idea to the extreme, you could create a new wallet for every amount you want to send, and use this wallet to identify the only one outgoing transaction.

Hope this would help,
Alex


Resources for HF Trading of Bitcoin & Altcoin I am going to write a HF trading algorithm (probably using the CCEX API) to buy sell gridcoin/altcoins.

Has anyone here got any useful resources for this? What would be the best platform to use for a beginner (CCEX API is the only one I have found)?

Related questions: Algorithmic trading python library & How to build a bitcoin trading bot?.

Check out my ccxt library on GitHub: https://github.com/kroitor/ccxt

With it you can access market data and trade bitcoin, ether and altcoins with many crypto currency exchanges. It provides quick access to market data for storage, analysis, visualization, indicator development, trading strategy backtesting, bot programming, building trading algorithms on top of it, webshop integration and related software engineering.

The code is in JavaScript / Python (2 and 3) / PHP. You can deploy it from PyPI, with npm (for Node.js) or by cloning from GitHub repository.

The ccxt library is under heavy development right now, but already offers a quick-start for trading and technical analysis with many crypto exchange markets out of the box.


Why is the scriptSig formatted this way in the Genesis Block (inside function CreateGenesisBlock) I was exploring the function static CBlock CreateGenesisBlock inside src/chainparams.cpp and I was looking at the way Satoshi created its scriptSig:
 txNew.vin[0].scriptSig = CScript() << 486604799 << CScriptNum(4) << std::vector<unsigned char>((const unsigned char*)pszTimestamp, (const unsigned char*)pszTimestamp + strlen(pszTimestamp));

CScript is constructing an object of the CScript class with the following inputs:
486604799  is the Nonce
CScriptNum(4) is an extraNonce
pszTimestamp is just a string "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks";
Why is the scriptSig formatted like this and shouldn't the scriptSig contain the signature of the whole transaction (not just little parts of it) and a public key of the person who signs the transaction?

The scriptSig field of a coinbase transaction is special. It doesn't need any signatures at all, as no coins are being spent. The ability to produce new coins, which that input represents, is inherent to the protocol - every block is allowed some fixed amount of produced coins. Requiring a signature on it would be wasteful and pointless. Which key should we expect a signature with? Miners don't have identities by design, as it is intended to be permissionless.
Instead, this field just contains arbitrary data the miners chooses. It can function as an "extra nonce", when the nonce in the header overflows. It is used by BIP34 to store the block height. It can further be used to store messages - which is what happened here.
As for why Satoshi chose that specific structure, i'm afraid you'll have to ask him.
Also note that the genesis block is hardcoded by the protocol, so there are no real rules that apply to it. It could have been declared to be anything.


mysql instead of leveldb for bitcoin core Is it possible to use db other than leveldb for bitcoin core? I'd like to make queries on running node and make views with decoded data

There is no code for that, and it would be either very slow or nearly useless.

Bitcoin Core assumes it has exclusive access to the -database, and caches data very aggresively. It may take hours before actual data from the chain is on disk.

The data structures are very compact and specifically designed for efficient use in Bitcoin Core. This means only unspent transaction outputs and block/transaction disk location are written to the database, in a custom byte-level format. You'd have to write your own parsers for these. In the 0.12 release most of this data will be scrambled by default even, to thwart overly aggressive virus scanners that detect virus patterns inside the database.

In short, that's not what the database is intended for. If you want something to index the blockchain or query the UTXO set, there exist other projects that build databases specifically designed for that.


What has OP_RETURN been used for over Bitcoin's history? What has OP_RETURN been used for over Bitcoin's history? How were these use cases enabled?

pourteaux answered this in a Twitter thread.

The story starts in 2010, when there was debate on bitcointalk about a proposal to include a DNS service on bitcoin called BitDNS. There was concern (including from Satoshi) that this would bloat the bitcoin blockchain, making it harder to do things like verify transactions.
Satoshi: "Piling every proof-of-work quorum system in the world into one dataset doesn’t scale. Bitcoin and BitDNS can be used separately. Users shouldn’t have to download all of both to use one or the other."
Some people point to this Satoshi quote as an implicit acceptance of altcoins, but I'll leave that debate for another day. And, BitDNS eventually did find a home in a separate blockchain called Namecoin. It never took off.
But, this isn't the end of the story.
A debate continued about the purpose of the bitcoin ledger. Is bitcoin for:

Recording financial transactions only, or
A secure, distributed data store

Option 1 is more scalable and sustainable. Option 2 allows for more experimentation and could > grow the bitcoin ecosystem.
I'll keep my opinion to myself, but neither camp won. Instead, a compromise was struck in May 2014 where Bitcoin Core enabled extremely short (40 byte) messages in a function called op_return. This was a sufficient size to, for example, store hashes linked to an external service.
This was a compromise because while it allowed messages, the size was limited and importantly- these messages were prunable.
Super important concept: what does prunable mean?
Prior to op_return, people who wanted to write messages on bitcoin were sending btc dust payments to fake addresses where the address itself was the message. This was a problem because all unspent bitcoin outputs have to be stored by all nodes forever as part of the UTXO.
op_return fixed this, because op_return transactions are  unspendable. Thus, nodes can safely ignore them since they are dead ends for btc and therefore take up no space in the memory of a bitcoin node.
These transaction are, however, forever stored in the bitcoin blockchain.
Fast forward to 2018 - 2019. Something like 20% of all bitcoin transactions are op_return transactions during this time. These messages mostly came from two sources: Veriblock (an altcoin that settles on bitcoin) and Omni (a way to mint tokens like Tether with bitcoin).
Bitcoin fees were quite high at this time due to op_return. Supporters of op_return argue that this is good for bitcoin: raises demand for btc and pays fees to miners to secure the network. Opponents say say these were crowding out bitcoin's intended financial transactions.
In all, Veriblock and Omni added about 10GB to the bitcoin blockchain from 2018 - 2019 with about 32 million transactions. Today, Veriblock/Omni have fallen out of favor, but the 10GB contribution to the blockchain is a permanent cost to nodes (some label it as "pollution"). But, because op_return transactions are prunable, there is luckily no memory cost since they aren't included in bitcoin's utxo.
Yet, op_return remains. Does it have any use? Well, it's safe to say that it isn't being used much currently. http://opreturn.org does a good job tracking this. Many argue that the functions op_return was used for are better off being executed with things like timestamps (e.g. OpenTimestamps) that don't bloat the bitcoin blockchain while still allowing you to prove the existence of something at a certain time (akin to a digital notary).
Some additional resources on OP_RETURN:
https://link.springer.com/article/10.1007/s10723-020-09537-9
https://bitzuma.com/posts/op-return-and-the-future-of-bitcoin/
https://en.bitcoin.it/wiki/OP_RETURN
https://opreturn.org/op-return-per-month/
https://www.blockchainresearchlab.org/wp-content/uploads/2020/03/BRL-Working-Paper-No-7-Dominating-OP-Returns.pdf
https://bitscribble.com/


New version of Bitcoin Wallet is signed with a different key F-Droid is offering an update to Bitcoin Wallet, but when I try to update, the following message is shown. I haven't found any official news from the author about this key change. What should I do?

I don't have an account, but just popping in to clear this up. F-Droid repos sign all of the published apps with a separate, private key. For obvious reasons, that key is not the same as the one used by upstream.

Why don't we use the same key as upstream? Because we compile the apps ourselves, and because we can't expect upstream devs to always sign our built apks.

Long story short, this has nothing to do with upstream. You should either stick with his builds or with F-Droid's, but mixing them will result in signing key conflicts.


Bitcoin blockchain search algorithm and consistency policy The blockchain looks like a double linked list, and all the transactions are stored into each block. What kind of algorithm does bitcoin use to find a specific transaction efficiently, since the blockchain is growing bigger and bigger?

The bitcoin network use its compute power to keep data consistency, if we simplify this model(write once read many, no update, no cheat) and use its consistency policy into the geographically distributed file system, does that work?

The blockchain is either a tree structure (with each block just referencing its parent), or a single path through this tree (a singly linked list).

Internally in software (at least in the reference implementation), indexes exist of course to find blocks (by height, and by hash).

Technically however, there is no indexing of transactions at all. They're not necessary for validation. Instead, a database is maintained with just the outputs of transactions that have not been spent yet (which is indexed by transaction hash and nothing more). Every block that is validated updates this database: its new outputs are added, the outputs consumed by it are removed. This database is tiny, compared to the blockchain (400MB vs 16GB as of march 2014).

In fact, earlier blocks themselves are not used during validation at all. We only need them for serving them to other nodes that are starting up - otherwise they would have no way to know the current state in a zero-trust manner.

This last point is important for Bitcoin's security model: full nodes never trust data they have not validated themselves. This is why we can't just copy the database of unspent outputs from someone and forgetting about the blocks before that point.

Regarding separation of data across nodes: such mechanisms typically have very bad DoS properties, where knocking out a few network nodes can mean that some data becomes inaccessible.

For just blocks, it is certainly possible to not have every node store and serve every block ever (and this will likely be implemented somewhere in the future). Again, all they are needed for is bootstrapping a new node.

The database of unspent outputs can also be sharded, namely by only retaining outputs of transactions within a certain range of hashes. However, this still requires each node to validate each block, and the result is technucally not a full node. You would need a set of nodes, that together validate the full range of hashes, to be sure blocks are fully valid.


How do I purchase Bitcoins? Way too complex. Give me an actual example as to how this works? For example;

How do I purchase bitcoins?
How much do they cost; is there an exchange rate?
How do I redeem them; turn them back into dollars?

A complex subject with an array of different possibilities results in answers of the same nature. If we provide simple answers, it won't be very helpful. For example:

Q: How do I purchase bitcoins?
A: Depends.

Q: How much do they cost?
A: Depends.

Q: Is there an exchange rate?
A: Yes.

Q: How do I redeem them; turn them back into dollars?
A: Depends.

Complex yet more helpful answers:

Q: How do I purchase bitcoins?
A: Depends on where you live, but I think it's safe to assume you are in the United States based on the details your questions. Coinbase and Circle are US friendly sites that will sell you bitcoins after your sign up and provide them with your personal and financials information. Or you can use a service like localbitcoins to find someone nearby that will meet you at a public place that will sell you bitcoins for your cold-hard cash. Or you can try to find a bitcoin ATM, that will turn your cash into bitcoins. The last two options will require you to have a bitcoin wallet, whereas coinbase and circle can also act as your wallet.

Q: How much do they cost?
A: Depends where you buy them from. Some places are more expensive than others.

Q: Is there an exchange rate?
A: Yes, there are many different exchanges resulting in many different exchange rates. See here http://bitcoincharts.com/markets/currency/USD.html

Q: How do I redeem them; turn them back into dollars?
A: Depends. If you use coinbase or circle they have an option for you to 'sell' your bitcoins back to them and they will ACH deposit the funds back to your bank account in dollars. Or you can find a person on localbitcoins and sell to an individual.


I inverted 2 digits to a wallet in a transfer Is there anyway to contact the wallet owner to retrieve the coins?  If the wallet doesn't exist, can the transaction be reversed?  Is there anything that can be done?

Normally a Bitcoin address is in the Base58Check or Bech32 format. Both of these formats have a checksum incorporated specifically designed so that wallets can detect if there is a typo in the address. It is strange that the wallet allowed you to submit the transaction.

There is no way to contact the owner of a wallet that can spend a specific Transaction Output (coins)

Transactions cannot be reversed. Under no circumstances. Even if you can proove that you are the owner.

BUT!!!
As we speak, October 30, 2020
The mempool is full, allegedly because miners in China are moving due to the rainy season. So the hash power has dropped and many low fee transactions have not been processed yet.
So, use a blockchain explorer to check if your transaction has been processed.
If not, then you can try to double-spend it by providing a higher fee for miners.
Higher fee transactions are processed first.


There are a variety of variables that affect Bitcoin pricing on the exchanges. Some are:

Market size
Exchange volume
Price of entry

Market size: Relatively speaking, the market for Bitcoins is small. In April of 2013 it was about 1.2 billion USD, and a few days later dropped to below 750 million USD. That's a small market cap, which means, among other things, that there's less consensus on the price to the BTC. This is the capitalization for all mined bitcoins and includes coins that have been lost, so the real value is something smaller. Each exchange is a subset of the total market, so those markets are even smaller, which allows for greater variation.

Exchange Volume: For all the coins that have been mined, the quotes are only from online exchanges, which are a small set of the total coins that have been mined. If only a quarter or less are in play, then the swings can be pretty dramatic. Since the volume is limited, and people don't take full advantage or arbitrage, different prices can and will exist on the different exchanges.

This happens with foreign currency exchanges too. However, with professional traders, billions of dollars, and serious automated trading the differences are in fractions of a percent.

Price of entry: It's relatively cheap to enter the BTC market and cheap to trade. Furthermore, if you mined BTC when it was trading for fractions of a dollar, or even $30/BTC, there's no issue unloading it. With a low price of entry people are less serious about how the trade their BTC.

Fundamentally, BTC is a small, highly speculative, irrational market. Each exchange is a small, highly speculative, irrational market. That's why the spread is so great.

As a crude example:
Consider two towns in the medieval period separated by twenty miles. They both have markets and people sell apples in both markets. In one market people really like apples. They pay 2 coins for the apples. In another market they aren't as enthusiastic, they only pay 1.5 coins for the apples. The economic thing to do would be to buy the apples in the second market and sell them at the first. But it's hard. It's a twenty mile walk, and all your friends are at the other market. Plus, the price could change by time you get there. It's just easier to stick with your current market, even if you're not maximizing your return.


lightning network funding transaction clearification Im trying to understand the funding transaction for a channel on the lightning network. I am wondering how the input looks like to the funding transaction. Does it require In_{Alice}(tx_{id}, tx_{index},redeem_script) and In_{Bob}(tx_{id}, tx_{index}, redeem_script) as inputs to the transaction or do you just see the first commitment transactions (like Ca1, C1b) from the multisig and and ensure they are valid then asynchronously submit funds to the multisig address? [0] just shows the output format as the multisig.

[0] https://github.com/lightningnetwork/lightning-rfc/blob/master/03-transactions.md

the input of the funding tx is just an input that is able to spend some UTXO which either Bob or alice controlled. Theoretically we could have Inputs from Bob and Alice but I believe that is not being implemented yet.

The workflow goes as follows. For example alice decides to open a channel by creating a funding tx. The output of the funding tx is a 2-2 multisig P2SH so before broadcasting the funding tx there will be 2 commitment tx created. one for alice and one for bob (in order to be able to ascribe blame in case auf malicious behavior) only if the commitmet tx are successfully signed the funding tx will be broadcasted to the bitcoin network and only if it has enough confirmations the channel will become operational.


Is there a way to create coinbase transactions with an RPC command? Is there a way to create coinbase transactions with an RPC command?

Yep, it is partially possible with the getblocktemplate RPC command.

This is what miners routinely use to obtain the information necessary to begin mining a block.
The exact parameters and response has been specified by BIP 22 and BIP 23 (an extension for pooled mining).

These output values will provide the information you need:

"coinbaseaux" : {                 (json object) data that should be included in the coinbase's scriptSig content
      "flags" : "xx"                  (string) key name is to be ignored, and value included in scriptSig
  },
  "coinbasevalue" : n,              (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)
  "coinbasetxn" : { ... },          (json object) information for coinbase transaction

Unfortunately, although specified, it does not appear that Bitcoin core provides the "coinbasetxn" JSON object for you, so you'll have to create it manually. However, this will at minimum give you the coinbase value and transactions to include in the block.

You can create the coinbase transactions just like any other transaction, however it MUST abide by the following rules:

BIP 34 which requires you to prefix the input script with the serialized height of the block.

For example, the input script of block 549,322 is:

------ Original ------
03CA6108FABE6D6D15B0663A60E46473FBA0C15DBEDCC466A5B71C741D9FFE721E38E9D161BCE45201000000000000000C65070100FB9B000013D7EC00082F736C7573682F

------ Decoded ------
03 -> Push 3 bytes
CA6108F -> 549,322 (height in littleEndian)
------ Remaining data is arbitrary ------
ABE6D6D15B0663A60E46473FBA0C15DBEDCC466A5B71C741D9FFE721E38E9D161BCE45201000000000000000C65070100FB9B000013D7EC00082F736C7573682F

Must have one TX input
Previous hash =  0x0000000000000000000000000000000000000000000000000000000000000000 (since coinbase is the first TX in a block)
Previous output n = 0xFFFFFFFF (-1 decimal since coinbase is the 0th transaction)
Output does not exceed (block reward + fees) or the coinbasevalue if you're using the RPC command with the provided transactions.

In our example block (549,332), the coinbase transaction's raw hexadecimal (the output found in createrawtransaction RPC command) is:

010000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff4503ca6108fabe6d6d15b0663a60e46473fba0c15dbedcc466a5b71c741d9ffe721e38e9d161bce45201000000000000000c65070100fb9b000013d7ec00082f736c7573682f0000000003b33eee4a000000001976a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac00000000000000002c6a4c2952534b424c4f434b3a8cca119e75a4d70a57346f0fb9facc55f00f150265095a92ca27a9b1b1ac6e000000000000000000266a24aa21a9edb8c0253a8b72023513b3f8c08591fb009e1b89d1651ee044d183a4c627399a710120000000000000000000000000000000000000000000000000000000000000000000000000

which decodes to:

01000000 -> txVersion
00 -> SegWit marker
01 -> SegWit flag
01 -> Input count (important that it is 1 for coinbase transactions!)
0000000000000000000000000000000000000000000000000000000000000000 -> Previous hash
ffffffff -> Previous output #
45 -> input script length
  03 -> Push 3 bytes
  ca6108 -> block height (littleEndian)
  -- arbitrary data --
  fabe6d6d15b0663a60e46473fba0c15dbedcc466a5b71c741d9ffe721e38e9d161bce45201000000000000000c65070100fb9b000013d7ec00082f736c7573682f
00000000 -> sequence
03 -> output count
  b33eee4a00000000 -> output 1 value
  19 -> output 1 script length
  76a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac -> Pay-to-Public-Key-Hash script

  0000000000000000 -> output 2 value
  2c -> output 2 script length
  6a4c2952534b424c4f434b3a8cca119e75a4d70a57346f0fb9facc55f00f150265095a92ca27a9b1b1ac6e00 -> provably unspendable

  0000000000000000 -> output 3 value (witness commitment)
  26 -> output 3 length
  6a24aa21a9edb8c0253a8b72023513b3f8c08591fb009e1b89d1651ee044d183a4c627399a71

01 -> number of witnesses
20 -> witness length
0000000000000000000000000000000000000000000000000000000000000000 -> witness
00000000 -> locktime

For more information on how to actually utilize createrawtransaction with these values, see this and this.


How can I get all transaction for a specific address using Nbitcoin? How can I get all transactions for a specific address using Nbitcoin?

var client = new QBitNinjaClient("http://api.qbit.ninja/", Network.Main);
            var address1 = new BitcoinPubKeyAddress("your --Address", Network.Main);
            var balance = await client.GetBalance(address1);


Trying to locate my bitcoins I was working with a broker, now my "bitcoins" are in "blockchain", and I have no trace.

How do I find them? How do I find said blockchain and bitcoins ?

I was working with a broker

There's no need to work with a broker to buy or use Bitcoin.

That's a bit of a red-flag. Often criminals call themselves brokers to trick people out of money.

  now my "bitcoins" are in "blockchain"

There are many businesses based on or around Bitcoin. I believe several of them use the word "Blockchain" as part of their name. One of them is Blockchain Access UK Ltd which is registered in London England. They were only registered 2 years ago. Their accounts are overdue which is not a good sign. They were nearly struck off last year which is also a bad sign. They are trading as Blockchain.com. Perhaps you refer to an account with them? Their website says their wallet service is provided by Blockchain Luxembourg S.A

There is no need to have an account with Blockchain.com, you can buy and use Bitcoin without having anything to do with Blockchain.com.

Blockchain is also the name used for the data-file that keeps track of Bitcoin movements. Every Bitcoin user has access to a local copy of the blockchain data file. Most wallets keep a copy or have access to a copy. But having this blockchain data file doesn't give you access to, or control over, any money. Generally you need a functioning wallet, a backup you can recover or something called a seed-phrase or a private-key. If you don't have any of these, you probably don't have any Bitcoin money.

  and I have no trace.

If you don't have account ID and password for Blockchain.com you almost certainly don't own any money at Blockchain.com.

If you don't have some sort of Bitcoin wallet program or app (there are many different Bitcoin wallets), you probably don't have any Bitcoin.

  How do I find them?

You find Bitcoins in a Bitcoin wallet. If you don't have a wallet on your computer or phone but have an account with some online business such as Blockchain.com, get in contact with them through their website.

You can find the company behind Blockchain.com at it's registered address (see above).