Bitcoin sent, confirmed on my end - never received on the other end I made a purchase and paid using bitcoin.  They sent me a link which took me to a coinbase processor.  I got the wallet address and sent the money from my Electrum Wallet.  I have 157 confirmations, Electrum shows it's there and complete, but the receiver says they had never received it.   I have been waiting a day for them to send me the wallet address they use so I can see if I sent it to the correct place.

Someone told me that if BTC is not claimed within 30 days it automatically goes back to where it came from.   I do not know if that is true since someone said: "once it's gone it's gone".  But I got some back that exact way.    I just want to know where it got screwed up.

If I know the money will come back, then I don't care if they help or not.   It's their loss.  I would have used it to pay for my purchase.

So where could the money be if they say they no longer use bitcoin?  isn't it still in that wallet?  They just have to get it right?

I hope this is not too convoluted.

They sent me a link which took me to a coinbase processor. I got the wallet address and sent the money from my Electrum Wallet. I have 157 confirmations, Electrum shows it's there and complete, but the receiver says they never got it.

One of three things has happened:

The receiver's wallet is not properly synced wit the network and hasn't seen your transaction
The receiver is lying about not receiving the transaction
You somehow sent Bitcoin to the wrong address (eg malware injected a malicious address into your copy/paste clipboard)

  Someone told me that if btc isn't claimed within 30 days it automatically goes back to where it came from.

This is incorrect. Perhaps there are custodial services that work this way, but if you send an actual Bitcoin transaction and it is confirmed in the blockchain, then the chance of it being reversed are basically zero.

  So where could the money be if they say they no longer use bitcoin? isn't it still in that wallet? They just have to get it right?

If you can link an address you sent to, or a transaction ID, someone could take a look at the blockchain to see where the Bitcoin ended up, but generally:

If you sent to a coinbase payment page, then the payment was sent to a Bitcoin address that Coinbase controls. Coinbase may have forwarded this payment on to the person you were paying, or it may still be sitting in that person's coinbase account. You would have to contact Coinbase and/or your counterparty to resolve the issue. There is nothing further anyone here can do to help you remedy the situation.


How do I recover from a disk read error (fread failed)? My full node daemon (bitcoind) crashed due to a disk read failure. The error is as follows:

"Deserialize or I/O error - CAutoFile::read: fread failed" etc.

How do I recover from this error? I don't want to have to download the whole database again.

I have seen a related question here: When should I use -reindex-chainstate and when -reindex <-- Read this for more info.

You could try

  -reindex-chainstate

If that doesn't work then try

  -reindex

Quoted from the linked question:

  You should use -reindex only when you were running in pruning mode, or if you suspect the blocks on disk are actually corrupted. Otherwise, when you only suspect corruption of the chainstate (which is far more likely), use -reindex-chainstate.


Is it possible to run bitminter on 2 computers with one account? I have 2 Ubuntu 12.04 machines. I'm running bitminter on both. But the website in the workers section only lists what one computer is doing.
Do I need 2 accounts for this setup or something?

You can use separate worker accounts if you want separate statistics for your machines. Otherwise just run all of them under one worker account.

If some of your workers are slow they may show as zero hashrate at the website. This is because pool websites estimate your hashrate based on how often you send in proofs of work (aka "shares"). For slow workers this does not happen very often and the website is unable to make a good hashrate estimate. As long as you see the worker statistics for accepted proofs of work going up everything should be fine. View the worker stats, wait a while, refresh the page - if the stats went up, it is working.


Did I lost the chance to get my BCH from Aug 2017 fork? I had some BTC before the BCH fork in my wallet, but I didn't know I could claim the same quantity on BCH too, I've just read about how "hard fork" works :(

Then I sell my BTC, that means now I cannot get my BCH anymore? or the BCH should be there even after selling my BTC?

Your BCH will still be at the same address your BTC were in as of the fork date. BCH is a separate chain, so if you send BTC transactions it will not affect the BCH balance.

In order to move the BCH, you will need to install some BCH wallet software, and then import the private keys/seed for the addresses that were funded at the time of the fork. You can obtain the keys/seed from your BTC wallet, but be warned: it is prudent to empty out your BTC wallet before doing this, in case the BCH software is malicious and attempts to steal your funds. (even if it is a small chance, better to be safe)

The BCH software will be able to communicate with the BCH network, allowing you to access those coins.


In what line of what file does the block reward depend on? I want to make an altcoin and since I am new, I wanted to know what sets the reward of a block after being mined.

main.cpp:

int64_t GetBlockValue(int nHeight, int64_t nFees)
{
    int64_t nSubsidy = 50 * COIN;

    // Subsidy is cut in half every 210,000 blocks which will occur approximately every 4 years.
    nSubsidy >>= (nHeight / Params().SubsidyHalvingInterval());

    return nSubsidy + nFees;
}

miner.cpp (within CreateNewBlock):

pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);


Creating a NXT/Ardor transaction using the NXT api via post I read the following wiki on how to make a transaction:

http://wiki.nxtcrypto.org/wiki/The_Nxt_API#Create_Transaction_Request

But is there a sample code of how to make such a transaction using only html and javascript?

Sure, connect to any public node or your local node using http://localhost:7876/test and use the resulting API test page as example.


Why are blocks serialized? and Is there any alternative way? Am I right that blocks are serialized because they're supposed to be sent to the network?

If yes, then all the data (regardless whether they are blocks or not) should be serialized. Then why do we mention that explicitly (e.g. in this post)?

Everything that is sent to the network is serialized. This includes blocks and transactions. Serialization is explicitly mentioned in the developer guide so that it is explicitly clear about what is sent and in what format.


Sent 95BTC to my client from Mt.Gox and it never showed I have had Bitcoin for some time now, but am relatively inexperienced. I have a Mac client, and yesterday sent 95BTC to it from my Mt.Gox wallet but it never arrived. I sent Mt.Gox a message asking for help they told me it would arrive when I reached block 160319 and my client is just at 124667 and not connecting at all! I can't get it to connect, have tried various suggestions from forums but can't make it work, please help! thanks

If you are not sure if your wallet balance is okay, search for your address in the Block Explorer. If you see your coins there, they are safe. I'm guessing it's this address, so everything should be fine.
Make sure your client is up-to-date. If it is too old it might not be able to communicate with the network. (remember to backup your wallet.dat beforehand)
If your updated client can't connect to the network (0 connections), check out this topic.
If your client is connected to peers, but after an hour you don't see any block progress, try closing down the client, deleting blk .dat files from your Bitcoin data directory, and then starting it again.
When you see your block count progressing, be patient. Leave your computer running the client over night. The procedure takes awhile, as Bitcoin needs to download and verify over 1GB of data.

If all else fails, you can try redeeming your wallet at MtGox (remember exactly if this is the only service providing this functionality) and using an online wallet service, like StrongCoin, to never have to deal with the problem again.


What's the difference between hashtx and rawtx in ZeroMQ of bitcoind? I'm trying to use ZeroMQ integration feature from bitcoind.

According to docs it supports four topic:

hashtx
hashblock
rawblock
rawtx

Sadly, they are not very well documented.

So, what is the difference between raw/hash topics?

After some investigation, I found out that RAW topics actually include entire body of transaction/block descriptor.

See, Raw Transactions.

Actually, you could explore the transaction descriptor content in JSON format by first converting binary data to HEX-string and then by pasting it to the blockchain.info tool or by using RPC call of bitcoind: decoderawtransaction.


A question about Proof-of-Work(PoW) I will describe my question using an example.

Let's say the network is working on adding block #100 to the blockchain. An attacker recreates block #99 with a combination of transactions that are "legit", meaning that they can be hashed to the same hash that the actual block #99 is using (and there is no double-spend).

Then, he broadcasts the block to the network. How does the network know that this block is fake and rejects it?

I think it has something to do with PoW, but I'm not 100% sure. Can someone explain to me the process of rejection with a detailed explanation?

Thanks in advance for any answers!

In your example, if block 99 actually did hash to the same exact value (infinitesimally unlikely), then there is nothing that distinguishes it from the actual block 99, so it would not be considered fake, and would not be propagated because it already exists in the inventory vector. The property of the hashing functions used to create the block hash would prevent this because without the same exact data, it will not result in the same block hash. See Digital Fingerprinting.

The block hash is created by creating a hash of all of the transactions (using a merkle tree), and hashing that along with the other meta data in the block header. Changing a transaction (even just the order of the transactions) will change the merkle root, and thus change the block hash. See https://en.bitcoin.it/wiki/Block_hashing_algorithm


Is calling the bitcoind RPC multi-thread safe? My application uses bitcoind RPC with a Python wrapper. I want to write one thread that periodically watches a number of addresses by calling "listtransactions". Other threads might need to call other API commands in the meantime.

Is it safe to use bitcoind in such a multi-thread setup? (maybe I will use multi-processing in the end because of Pythons global interpreter lock).

When I searched for an answer I found:

Are bitcoin commands resistant to race conditions and thread-safe?

But I am not sure if this answer applies to my problem (and I am also not sure whether Pieter's "yes" is a reply to the first or the second question).

Thanks.

It can be done safely but it can also be done unsafely. If each thread uses its own connection, then it is safe. If the threads "fight" over the connections, then it won't work.


What would happen if a private fork several hundred blocks ahead tried to merge back? Suppose mining pool has been off the main network for a long time so that they are 100 or so blocks behind, but managed to mine 200 blocks in the period (say, some combination of had 33% before, deliberately selecting easy blocks to extend, and ...).

Obviously, this can happen by choking down the difficulty, but I'd assume there are protections against such an obvious attack as that one. Update: assumption verified; reducing the difficulty doesn't work here as expected.

I found two roughly similar questions, but neither seems right:

Can a double spend attack be obfuscated by mimicking the transactions seen before the fork?

Countrywide Internet isolation, inevitable fork

The obvious answer, if it contained only mined transactions, would be to manually discard it, but I don't think that assumption would prove valid.

I am bothered by the belief that this is a duplicate of longest chain vs. highest difficulty. Marking this as duplicate pre-supposes an entire class of cryptographic attacks on hashes does not exist, and many other things as well.

One possibility, as hinted by Murch, would be to pre-build a long chain, then using an attack on the hash take a few hours to construct a block with exactly a given hash. This may require waiting until an exceptionally vulnerable block appears but that doesn't really matter.

I finally guessed what a no-malice version might look like and I found this: Scenario: disaster splits the Internet into dozens unconnected fragments Basically, bad things happen if the largest connected network is << 50%.

One possibility, as hinted by Murch, would be to pre-build a long chain, then using an attack on the hash take a few hours to construct a block with exactly a given hash. This may require waiting until an exceptionally vulnerable block appears but that doesn't really matter.

I don't see where I hinted that, but that would definitely not work.

  few hours to construct a block with exactly a given hash.

Block hashes are SHA-256d hashes. The space of 2^256 is too large to brute force for the foreseeable future. Definitely its impossible to do in "a few hours".

  exceptionally vulnerable block

What's that supposed to be? Blocks are not more or less vulnerable.

  pre-build a long chain

The whole chain would become invalid if you changed the first element. Each block builds on the block hash of its predecessor. Therefore, two blockchains cannot be arbitrarily appended to each other.

And as already described in the comments above:

  high number of lower difficulty blocks

It's not the count of blocks that counts but the total "weight" measured in summed difficulty.


Decentralized Data Storage System in NXT - How do you disable the 2 week data pruning? Currently the NXT platform has the ability to store data in its blockchain, whereby making it a decentralized data storage system. But the thing is that the data is purged from a nodes blockchain every 2 weeks to reduce bloat and only keeps a hash of the file only. I read that you can host nodes that disable this pruning of the data and keep the data indefinitely. How can this be done?

Yes you can disable data pruning by editing the config file at conf/nxt-default.properties

This would effectively make the node into an NXT Archival Data Node and I'd imagine you would be able to charge to retrieve old data in the future.

# Override the lifetime of prunable data to keep them longer, value in seconds.
# Set to -1 to disable pruning. Has no effect if set to less then the minimum
# required lifetime of two weeks (1209600 seconds) on mainnet, or 24 hours
# (86400 seconds) on testnet.
nxt.maxPrunableLifetime=0

# Always include prunable parts in transaction json, as long as still available,
# even if expired.
nxt.includeExpiredPrunable=false

Just change it to -1 and true in those settings.


Block data error, reindexing blocks Bitcoin QT finished syncing this weekend after d/l for Windows 7 on Thursday.

Today, probably 2nd or 3rd time running it, an error came up right away that index could not be found.

What would cause this to happen, and why would it have to reindex all the blocks on disk?

Thanks, Mike

When I've had this happen it's been because of a non-clean shutdown. Something about the disk state ends up being inconsistent and this (understandably) results in the system wanting to verify all the information it has on disk.


Why the bitcoin address is not valid in any of the testNet faucet I develop a simple Java/Maven/JSP app for bitcoin and generated the address
    167Bqf3Mi3gnfhw5DhCfoYNTMxqANt3Zky
I would like to send some money to this address from a bitcoin testnet faucet. I feel it weird that none of the testNet faucet out there seems to recognize the address and indicate it as invalid. Funny thing is I used the same code for generating the address that is provided in the BitcoinJ github page.

How should I approach from here?

Testnet uses a different address format than the main network. Testnet addresses start with an "m" or "n".
The address you are using starts with a "1" and is therefore for the main network. This is why the testnet faucets say the address is invalid.

From the documentation of BitcoinJ, it seems that you can configure your code to use the testnet with:

  params = TestNet3Params.get();


Blockchain gets stucked if no blocks are mined Yesterday I decided to fork a project, just for fun and to learn more about it. So, I forked a project, I generated my own genesis block, changed timestamps, nounce, keys, reset the min chain work. Everything was fine. Compiled it for Windows and Linux, it worked perfectly. I set up a wallet on a Vultr server, the other one in my own PC, mined a few blocks and then I went to bed.

The Vultr walllet kept running, but mine didn't, I closed it.

When I woke up and opened the wallet, it was trying to download blocks. getblocktemplate basically says it is downloading blocks, but there are no blocks to download. It says "8 hours behind".

I'm not sure if this is supposed to happend.

In my ignorance I'm going to assume it is normal: how do I fix it without having to delete everything and making a new chain?

If it's not normal: What did I do wrong?

In my ignorance I'm going to assume it is normal: how do I fix it without having to delete everything and making a new chain?

You can just comment out or remove the check in getblocktemplate so it won't error there.

You should also be able to bypass this by setting your computer's clock to around the time of the most recent block before you start the software. Once it has started, you can bring your computer's clock back to real time and then mine a block.


How do you get a job in the Bitcoin/Blockchain industry? I'm 18 and would like a job working in the Bitcoin/Blockchain industry but I wouldn't know where to start.  Economics degree?  Perhaps working for the fin-tech branch of a bank?

I'm interested to know about how people in this industry got there, what they think about it, and any advice.

Look at the backgrounds of the top Bitcoin core devs.

Here are the top 3:

Wladimir J. van der LaanUniversity of Groningen
Institute for Mathematics and Computing Science (IWI)
Pieter Wuillecomputer science degree at U. of Leuven
Gavin AndresenBachelor's degree in computer science from Princeton


How can I contribute to the open source Bitcoin project? Generally speaking, how can:

A) A programmer contribute to Bitcoin?

B) A non-programmer contribute to Bitcoin?

Essentially; which areas are in most need of programming work / non-programming work?

As a Programmer

You can contribute by acquiring the bitcoin source code at github.  Fixing bugs, adding features and creating a "pull request".  Here are guidelines for creating pull requests.

Gavin Andresen, currently the lead developer of bitcoin, has suggested that testing is a bottleneck, so it would be helpful to compile the existing pull requests on github and test them.

It should be noted that it is possible to safely test bitcoin transactions without using real bitcoins by using the testnet (see the -testnet command line option).  You can even create your own self-contained testnet-in-a-box.

As a Non-Programmer

Learn more about bitcoin. Try using them. Learn proper ways to secure them. When you become better versed in bitcoin technology help by explaining it to others.  If you have a business, experiment with accepting bitcoin. If you are a customer, ask if a business accepts bitcoin. Help to dispel the myths and misunderstandings of bitcoin whenever you talk about them. However, be careful to get your facts straight.

If you have talents in other areas such as design, business, or blogging, etc. then look for ways to contribute using those skills. It has been suggested that the client needs better interface designs, businesses have expressed interest in advice on bitcoins, blogging can help address all the misinformation and rhetoric.

Everyone has something they could contribute, so give it a try.


Hardware wallet can be used anywhere? I haven't yet traded any cryptocurrencies. I'm planning to buy BTC through Coinbase then exchange BTC for a small amount of XRP.

The main reasons for going with Coinbase is it's safe, well regulated and I'll always want an account there. For XRP, I'll use changelly.com since they are popular, have low fees, and haven't been hacked (yet).

A big concern is safety. Coinbase probably has a good wallet but I'd like to use a hardware wallet since I'll be using other exchanges for various alt coins not offered on Coinbase. I don't really trust other exchanges and hence the hardware wallet.

Is a hardware wallet the safest option in this case? Are there any issues using it at Coinbase and Changelly?

Do I still need to setup wallets at exchanges I'm using?

When using a hardware wallet, from what I understand, you plug it into your computer via USB and do whatever transaction at whatever exchange. Once complete, you unplug it. From this, it basically can't ever get hacked?

Hardware wallets are easy-to-use ways (compared to paper wallets (hard to use) and software wallets (not as safe as hardware wallets)) of being in control of your private keys hence the safest and the easiest way of using and storing cryptocurrencies.

When you use a (traditional) exchange as a wallet, you won't be in control of your private key so the exchange can steal your funds or get hacked and lose them etc.

There are decentralized exchanges where you don't need to deposit your funds (thus you don't need to trust, a.k.a trustless) like RadarRelay. You can use them with software wallets and some of them with hardware wallets directly.

Don't forget that cryptocurrencies' reason of existence is being trustless, don't hand over your funds to anyone, always be in control of your private keys.


What stops this style of attack on the Bitcoin network? I was having a look at the genesis block of Bitcoin earlier and noticed the difficulty was set to 1. I guess this was originally designed so just Satoshi's computer mining at this difficulty would produce 10 minute blocks.

However, if I put my GPU/ASIC to mine at the beginning of the chain at this difficulty I could find blocks incredibly quickly. Even if I could mine each block in 10ms it would take me around 12 hours to reach the current block height. I realise finding blocks this quickly would also ramp up the difficulty after 2160 blocks but I could just fabricate the timestamp on the blocks so it looks like they all came in at 10 minutes.

Then when my chain (which is essentially empty with just my mining address full of Bitcoin) is as long/longer than the current consensus I can broadcast it and nodes/miners should take the longer chain which will be mine.

What in the Bitcoin implementation prevents this?

Then when my chain (which is essentially empty with just my mining address full of Bitcoin) is as long/longer than the current consensus I can broadcast it and nodes/miners should take the longer chain which will be mine.

It won't.

To compare the "length" of chains for the purpose of determining which of two valid chains is to be accepted, Bitcoin Core (and I hope all other implementations) look at the amount of work that went into them. Roughly speaking, this means the sum of the difficulties of all the blocks in it.

The only way you'll have more work than the existing chain, is by doing more mining than what went into the existing chain, in a short amount of time. In order to not be outrun by the existing network while you're performing your attack, you'll need (significantly) more hashrate than all the rest of the network combined has. So, what you're talking about is a 51% attack.

That said, there is a related, and far less serious attack possible. You could mine thousands of short low-difficulty branches, that are all valid, but won't ever be accepted, and broadcast them. If nodes would accept them, they'd eventually go out of memory from storing all your headers. The solution to this is the client checkpoints that MCCCS talks about in his answer. Note that the scope of checkpoints has been reduced several times, as they used to protect against many types of attacks that are now prevented through measures that don't rely on hardcoded knowledge about the network.


As a full node, does limiting bitcoind bandwidth hurt the network? As the top answer to this post, Maximillian Laumeister claims:

"IMPORTANT NOTE: If you limit the bandwidth of Bitcoin Core far below your actual upload speed, it can actually harm the Bitcoin network instead of helping it."

It would seem to me as though every contributing full node would only help the network (regardless of ISP speed). Does limiting the bandwidth of Bitcoin Core actually hurt the network (compared to not running a full node at all), and if so, how precisely?

It would seem to me as though every contributing full node would only help the network (regardless of ISP speed). Does limiting the bandwidth of Bitcoin Core actually hurt the network, and if so, how precisely?

Not necessarily, but if everyone did it then yes.

If everyone actually trottled upload bandwidth so much that there is not sufficient bandwidth to bootstrap new nodes, then yes it is a major hindrance to future uptake.

In general, I believe the claim is applicable to the health of any peer-to-peer network, as oppose to just the bitcoin network. If the majority of users in Bitcoin are "leechers" and do not supply sufficient bandwidth to relay blocks and transactions, then clearly the bitcoin network will become less healthy as it will be harder for nodes to come into a consistent state and harder for new nodes to join the network.


How can I get the key of blockindex According to this post: What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?

One type of the keys in leveldb of bitcoin is formed in the following way

  'b' + 32-byte block hash

I wrote the following code in go but I got "not found".

genesisBlockHash := "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
hashBytes, _ := hex.DecodeString(genesisBlockHash)
keyBytes := append([]byte("b"), hashBytes...)
data, err := db.Get(keyBytes, nil)

Where did I do wrong? How can I add 'b' to the hash?

Tried a simple case:

  'R' -> 1-byte boolean ('1' if true): whether we're in the process of reindexing.

Go code

data, err := db.Get([]byte("R"), nil)

But I still got "not found". Why...

Tried file.

  'f' + 4-byte file number -> file information record.

I could get some data. I think the following code should retrieve the "blk00000.dat" block file information, right?

readFile(db, []byte{0, 0, 0, 0})

func readFile(db *leveldb.DB, file []byte) {
    data, err := db.Get(append([]byte("f"), file...), nil)
    if err != nil {
        log.Println(err)
        os.Exit(1)
    }
    // read data
}

Where did I do wrong? How can I add 'b' to the hash?

The block hashes need to be byteswapped. Instead of 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f, you should have 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000.

  But I still got "not found". Why...

This key-value pair is not always present.

  I could get some data. I think the following code should retrieve the "blk00000.dat" block file information, right?

Yes.


What would it take to create my own Bitcoin exchange? I'm looking into creating a Bitcoin / crypto currency trading platform (say, like Tradeking), as I've noticed there are a few sites out there already, except they all have pretty hefty fees.

So, to reduce fees, is it possible to create my own Bitcoin exchange? What is involved in setting one up? I'm pretty sure I'll need to develop an API, which I can do (I am an experienced software developer). I'll also need a business entity and a business bank account to use for transactions. What else? I see this thread...is there anything else I should consider?

Also, if I do set up an exchange, can I control of the fee rates? Other sites have rates averaging around 0.5%...can I set mine to whatever I want (considering my costs), or am I limited in some way by some third-party entity?

Setting up and operating an exchange can be quite involved.

A few tiers to start thinking about:  legal, banking, tech+security, and volume.

Legal

The first question is whether you want to operate globally (e.g. Bitfinex or BitStamp) or focus on a national market (e.g. FlowBTC, meXBT).  The next step is to seek legal counsel to help decide where you want to locate and how to incorporate/structure your business.
You want to think about how you can limit your liability and exposure to litigation, as well as what regulatory/compliance requirements are in your jurisdiction, and what they are likely to be in ther near term.
Merkle Tree offers a useful high-level global map of the regulatory landscape.

Banking

What sorts of banking relationships do I need and how can I secure them?
Note that banks can be heistant to provide services to digital currency exchanges.

Tech + Security

You or a partner need to build and maintain complex architecture that pairs orders, executes transactions, and manages deposits and withdrawals.  Major componets are:

Matching engine
Risk management system
Accounting/audit system
Wallet management
Payment gateways

Security is understandably paramount.  Some things to consider:

Sound internal security procedures among your team  - see, e.g.  CryptoCurrency Security Standard (CCSS) (incredibly important, and often overlooked)
Network and hardware security (secure data center, etc.)
KYC (Know Your Customer) + AML (Anti-Money Laundering) solutions
Two-Factor Authentication for users

Volume

Without lots of live volume, all the above is for naught.  It is well worth your time to actively consider all of the below:

Channeling liquidity from large exchanges like Bitfinex to your exchange
Messaging, media presence, brand creation and maintenance, ads and retargeting
User definition (is this a retail exchange, for advanced users?, etc.), and using this to inform UI design and to prioritize features for product differentiation

Hope this is helpful for getting started!

Disclosure - I work at a firm called AlphaPoint (http://alphapoint.com) - we provide white label tech to many of the largest Bitcoin exchanges in the marketplace, including full stack tech and hosting, as well as order routing for day-one liquidity.


Why is GDAX charging maker's fee when using API? Why are we getting charged maker's fee when creating buy orders on the GDAX API.

For example I deposited 100 EUR to GDAX account and wanted to place a limit buying order for size 0.5 ETH at the price of 200 EUR and received HTTP 400: "Insufficient funds" as a response.

I lowered the size to 0.4 and the order went through, but I was left with 19.80 EUR on my account - meaning that 0.25% was taken as well, but my order was at 200 EUR and 0.4 ETH, totaling 80 EUR not 80.2 EUR.

Looking at the API there shouldn't be a maker's fee.

Has anyone else noticed this?

Doing it manually in the GUI I am left with 20 EUR.

There is no maker fee using API, but when place new order, the default parameter for "post_only" is false, which means it is possible set a price to become a taker, hence GDAX will make sure you have enough funds to cover the fees.

Set post_only to true then GDAX will allow you to spend your entire account without reserves for fees.


Mnemonics but for Public addresses Are there any implemented ways for turning addresses into human-readable word(s)? If not, why? I.e., are there any known technological issues in implementing this?
Thanks

Are there any implemented ways for turning addresses into human-readable word(s)?

No

If not, why?

Because, copy-pasting works and no one has proposed a method for something that no one I'm aware of has needed.

I.e., are there any known technological issues in implementing this?

No


Can I mine bitcoin with a gaming computer? Awhile ago i built a rather nice gaming computer it has
CPU: intel i5 6600k
GPU: Nvidia GTX 1080
Ram: 16 GB ddr4
PSU: corsair Ax1200W
Water cooled system

Would this be a decent mining machine. If so what would you predict its stats to be. What should I upgrade.

It is not profitable to mine Bitcoin with computer(s) and GPU(s). If you just want to help secure the network and/or keep your place warm in a high-tech way, then you could mine Bitcoin ;)

It could be profitable for you to mine some other coin, using your computer and GPU(s). You could also set your computer up to rent its computing power to others by joining services like miningrigrentals.com

For GPU mining have in mind that the more GPUs you have, the better. Since you don't pay the cost of electricity, you might want to add more GPUs to your computer. Just make sure the Power Supply Unit (PSU) can handle them.


Monitor bitcoin transaction confirmation timestamps Well, i'm planning on developing a graph that shows bitcoin transaction average confirmation time per hour , but i have no clue where i can get transaction confirmation timestamps.

I'm running bitcoin core node with whole blockchain and sync up to date.

Any ideas ?

The time at which a transaction was confirmed can be found in the 4B timestamp in the block header (POSIX time encoding)

To compute average transactions confirmed/hour, you can consider the header timestamp and the number of transactions in each block in your considered timeframe. The first byte following the header represents the number of transactions in the block. However, you may want to exclude the coinbase tx from the transaction count for your purposes.

If you wish to compute the time between broadcasting and confirmation of a given transaction, you must have knowledge of when a transaction was specifically broadcast. Since this is only the case if you broadcast a tx yourself, you cannot compute this exactly. You can however, determine when a tx was first accepted to the mempool of your local node, and use that as a proxy. Bitcoind offers a tx subscription service which publishes newly accepted mempool txs over a zmq interface. By indexing these with local timestamps(time of mempool acceptance), your application can later determine the time passed to the confirmation of a previously indexed tx from a block which includes this tx and the block header timestamp.


Is it possible to configure the bitcoin daemon to only broadcast unconfirmed transactions with ZeroMQ? Currently, I am running a full node bitcoin daemon configured to publish hash transactions via ZeroMQ (ZMQ). I've been noticing that, as a subscriber to the hashtx topic, there are both confirmed and unconfirmed transactions being broadcasted. I only really care about the unconfirmed transactions. Is there any way to configure the bitcoin daemon (bitcoind) to just broadcast unconfirmed transactions?

There are long stretches of intermittent time, on the order of a few minutes, when ZMQ is broadcasting confirmed transactions, and this behavior is resulting in a "freeze" like state because no new unconfirmed transactions are flowing through (being blocked by the stream of confirmed transactions coming through).

At my application layer, I can filter out for the confirmed transactions, but still, I'd like to stop it at the source if possible.

On another note, why is ZMQ broadcasting both confirmed and unconfirmed transactions? Does this have something to do with the daemon having to update its local copy of the blockchain?

With the current Bitcoin Core Version (0.14.2 by the time of writing), this is not possible.
A quick hack in CZMQNotificationInterface::SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int posInBlock) would be simple (just add an if (!pindex)).

If you don't want to change the sources, you could call gettransaction over RPC and get the confirmation count.


Why does Bitcoin use two hash functions (SHA-256 and RIPEMD-160) to create an address? Why do we use 2 hash functions (both SHA and RIPEMD) to create an address? Why not just use one hash function?

RIPEMD was used because it produces the shortest hashes whose uniqueness is still sufficiently assured. This allows Bitcoin addresses to be shorter.

SHA256 is used as well because Bitcoin's use of a hash of a public key might create unique weaknesses due to unexpected interactions between RIPEMD and ECDSA (the public key signature algorithm). Interposing an additional and very different hash operation between RIPEMD and ECDSA makes it almost inconceivable that there might be a way to find address collisions that is significantly easier than brute force trying a large number of secret keys.

Essentially, it was a belt and suspenders approach. Bitcoin had to do something unique and rather than have to hope they got it exactly right, they overdesigned it.


What format is this scriptPubKey? I'm running BitcoinUnlimited's giga_perf branch of bitcoin in regest mode, and I'm noticing a different format than P2PKH in the scriptPubKey when running listunspent over rpc.

Typically I see scriptPubKey's in the P2PKH format:

'76a914' + b58check_to_hex(address) + '88ac'

But with this implementation I'm seeing:

'2103' + ??? + 'ac'

Some examples below, what format are these scriptPubKey's in?

{
  "txid": "07ad742b0bab1c5e65fe720459747aa687d293fef0d0f168297bcaafbe73f17b",
  "vout": 0,
  "address": "mrjTCJGC7aYdZsy3gUJMpBesgtH1ymybsN",
  "scriptPubKey": "21031f5ce0854d50e632bd7002ae5aff977396376082e45329fcdf1af52ab68f766bac",
  "amount": 50.00000500,
  "confirmations": 101,
  "spendable": true
},
{
  "txid": "d7f623f59d8fa37eea5fafeb3819ecd76750bea9bb48d453e0eb13426c7e707e",
  "vout": 0,
  "address": "n2Faf95smgYu6e9aBVAwwzp6oULnL7SSSs",
  "scriptPubKey": "21039ff795e5433e67b418e100938ac72e2713a1661c15f48a5c198a5086d96285beac",
  "amount": 50.00000000,
  "confirmations": 108,
  "spendable": true
}

Those are Pay to Pubkey scriptPubKeys. P2PK is in the format <pubkey len> <pubkey> OP_CHECKSIG. The 21 is the pubkey length and the 03 is the first byte of the pubkey. The ac is OP_CHECKSIG.


Does value 'True' at the middle of stack is valid transaction? If at the middle of the execution of scriptSig + scriptPubKey we get the value 'True', while there are remaining values or operators in the stack, is the transaction valid? Or should the stack be empty + top result is 'True' ?
I believe it is not because someone can just send unlocking script with the 'OP_TRUE' and cause any UTXO to be unlocked.

Contrary to the book Mastering Bitcoin, there is no boolean value of "True" in Bitcoin Script. An executed transaction script is valid when the top item remaining in the stack at the conclusion of execution is non-zero. To combat transaction malleability BIP62 (transaction version 3) also introduces the additional validity requirement that the stack must contain no additional data elements, only the single non-zero value.


Does createrawtransaction have the ability to create a transaction with custom scripts? Does createrawtransaction always use the following script?

scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>

If so, how do you create a transaction that uses a custom scriptPubKey value? If not, what is the syntax for writing the JSON that enables custom scriptPubKey values for the transaction using createrawtransaction?

Yes that is correct.

What you can do is:

listunspent
createrawtransaction with receiver:amount and your change:amount

(make the amount differ to pay the fee)

Take the raw hex transaction and use it with http://brainwallet.org/#tx to be able to edit in JSON format. Don't worry, when your done you can sign the raw transaction in your local client.

About scriptPubKey, that is a little harder, and you should only experiment with this on testnet. You can try to understand this transaction https://en.bitcoin.it/wiki/Script#Transaction_puzzle and also try to understand how the stack works by playing around with jsforth


Electrum 2.7.9 setup never went through the password and seed setup, now I can't send coins I installed the Electrum 2.7.9 wallet and it never went through the password and seed setup. I ended up with a default standard wallet. I then uninstalled the Electrum wallet and then reinstalled it. Once again it didn't go through any password or seed setup and I had a default standard wallet on my pc. I made the dumb decision, because I am totally new at this, to go ahead and send my bitcoins from my coinbin wallet to the address associated with the standard default wallet and now I can't send anything because it wants a password. Please help!

Apparently, without either password or seed, an Electrum wallet is not recoverable.

But let's reconstruct how it happened and see what you perhaps could do:

Electrum doesn't create a new wallet during setup only when there is already an Electrum wallet on the system.

It therefore seems likely that you or another user of your computer had installed Electrum on that computer before. Perhaps you should try to figure out if the seed and/or password was recorded back then, but you had forgotten about it. Else, you should first try likely passwords.

If you cannot make any progress with that, you might want to consider getting in touch with https://walletrecoveryservices.com/. I cannot personally vouch for them, but they appear to have helped a load of people in the past. They may be able to help you recover your password, if you have any idea about what you may have used.

Thanks to #electrum on freenode for most of the above information.


Scan ports for my onion bitcoin node and RPC calls I'm getting to work my first bitcoin node, it is running P2P through Tor network.
1: How can it be scanned? how can I see if its exposing any port, or port 8333?
2: How can I make RPC calls through Tor?.... maybe this is not the best way because of security for the RPC API and calls in plain data...
Thank you!

This seems to be more a question about Tor than a Bitcoin specific question, but:

If your bitcoind is set up to use a Tor socks proxy, by default, it will not listen for incoming connections (because by doing so, you'd be listening on your real IP address, which defeats the security you'd gain from Tor). However, if you really want to help the Bitcoin network by making your Tor-protected bitcoind available on port 8333, you will need to configure it as a hidden service. Refer here for information about this: https://en.bitcoin.it/wiki/Setting_up_a_Tor_hidden_service

You should set up a hidden service for your RPC port if you wish to make RPC calls through Tor, then from the computer sending RPC commands, send those commands through a local Tor SOCKS proxy. Set up your bitcoind to allow RPC calls only from 127.0.0.1 port 8332 (this will ensure your bitcoind will only accept RPC calls made through Tor), then set up a hidden service for port 8332.


What is the database for? I see the block chain is stored according to the block chain format specification.  But I also see there is a database, which is currently a leveldb database.  Why is the block chain stored in two different ways?  Seems redundant.

There are basically four pieces of data that are maintained:

blocks/blk*.dat: the actual Bitcoin blocks, in network format, dumped in raw on disk. They are only needed for rescanning missing transactions in a wallet, reorganizing to a different part of the chain, and serving the block data to other nodes that are synchronizing.
blocks/index/*: this is a LevelDB database that contains metadata about all known blocks, and where to find them on disk. Without this, finding a block would be very slow.
chainstate/*: this is a LevelDB database with a compact representation of all currently unspent transaction outputs and some metadata about the transactions they are from. The data here is necessary for validating new incoming blocks and transactions. It can theoretically be rebuilt from the block data (see the -reindex command line option), but this takes a rather long time. Without it, you could still theoretically do validation indeed, but it would mean a full scan through the blocks (207 GB as of march 2019 - https://www.blockchain.com/charts/blocks-size) for every output being spent.
blocks/rev*.dat: these contain "undo" data. You can see blocks as 'patches' to the chain state (they consume some unspent outputs, and produce new ones), and see the undo data as reverse patches. They are necessary for rolling back the chainstate, which is necessary in case of reorganisations.

So yes, everything but the block data itself is indeed redundant, as it can be rebuilt from it. But validation and other operations would become intolerably slow without them.


Is there a list of "hardforks that will never happen in Bitcoin"? The Hardfork Wishlist lists some fork-causing changes that might actually get introduced (e.g. adding more decimal digits to allow units smaller than a satoshi).

Is there a similar list of forks that will definitelylikely never happen? (might happens in alts, but not in Bitcoin)

One such change is obviously changing the target limit of coin creation from 21,000,000 to something else. Another change might be changing the reward splitting to be continous - such a change is probably too complex without much concrete benefit to be ever implemented in core Bitcoin.

Here, I created a page about that: https://en.bitcoin.it/wiki/Prohibited_changes


How to unblock an account that is held to ransom I have a blockchain account with bitcoins in but the account is held at ransom. I have to pay 2140$ to get a private key. Is there any way to report this to Blockchain.

I did a trading agreement. The dealer put my profits into a mining account on Blockchain. To retreive my funds I need to purchase a key from the dealer to have the funds released. Hope I am making sense

I have to pay 2140$ to get a private key.

That is invariably a solid indication you were the victim of a scam.

I did a trading agreement. The dealer put my profits into a mining account on Blockchain.

This is typical of scams and nothing like what happens with honest businesses.
Blockchain don't have a type of account called "mining accounts".
That isn't how Bitcoin mining actually works.
The "profits" are fake. Probably the criminal "dealer" set up a watch-only / non-spendable wallet to fool you into thinking the money shown belonged to you.

To retreive my funds I need to purchase a key from the dealer to have the funds released.

You are being cheated by someone dishonest. Keys are free. There is no such thing as a release fee in honest Bitcoin businesses.
The money you gave to the dealer was given to a criminal. Now the criminal is trying to get you to give them more money. Every time they succeed in tricking you they will invent a new reason for you to give them even more money. They will continue doing this until you either have no money left or realise that you are being tricked.

Is there any way to report this to Blockchain.

Blockchain.com and Blockchain.info are domains owned by Blockchain Luxembourg S.A. There is also a Blockchain Ltd mentioned on some of their web-pages but presumably this is a subsidiary company.
You can contact that European company through this web-page:
https://support.blockchain.com/hc/en-us/requests/new
The domain registrant is
Name:          Blockchain Admin
Organization:  Blockchain
Street:        Rue de Merl 74
City:          Luxembourg
Postal Code:   2146
Country:       LU
Phone:         +44.07476822631
Email:         email@blockchain.info

Note that the phone number looks like a UK mobile phone (cellphone), not a Luxembourg land-line.
The founder is Nicolas Cary, an American businessman.

If the wallet at Blockchain.com was created by the dealer, it is possible that Blockchain Luxembourg S.A. in Europe would not want to get involved in a dispute between you (a third party with no business relationship to them?) and their customer (the dealer). If the account was opened in your name, that might help to get them involved.
If you believe a dealer is holding your account to ransom, you should probably contact a lawyer or the police.


OP_HASH256 of a negative number transaction 9 in block 251684 spends transaction 25 of block 249957. the script to be evaluated here is:

OP_PUSHDATA0(20) 16cfb9bc7654ef1d7723e5c2722fc0c3d505045e OP_SIZE OP_DUP OP_TRUE
OP_GREATERTHAN OP_VERIFY OP_NEGATE OP_HASH256 OP_HASH160 OP_SHA256 OP_SHA1
OP_RIPEMD160 OP_EQUAL

the problem i have is with how to sha256 a negative number. so far i have the following:

op: OP_PUSHDATA0(20) 16cfb9bc7654ef1d7723e5c2722fc0c3d505045e,
                    new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e]
op: OP_SIZE,        new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e, 20]
op: OP_DUP,         new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e, 20, 20]
op: OP_TRUE,        new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e, 20, 20, 1]
op: OP_GREATERTHAN, new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e, 20, 1] (since 20 > 1)
op: OP_VERIFY,      new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e, 20]
op: OP_NEGATE,      new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e, -20]
op: OP_HASH256,     new stack: [0x16cfb9bc7654ef1d7723e5c2722fc0c3d505045e, ???]

This is an extremely useful site for debugging bitcoin scripts: http://webbtc.com/script.

Bitcoin uses a custom way to serialize integers, shown here. This is confusing, but keeps the number of bytes on the stack small as possible. Let's walk through the basic execution:

exec : 20 OP_NEGATE OP_HASH256
stack:

exec : OP_NEGATE OP_HASH256
stack: 0x14

exec : OP_HASH256
stack: 0x94

exec :
stack: 0xaf462e245a0f463a93e23a54eb0b4d0d8da7a951e4d0b41015782a27e80a2e2c

The confusing step is really the OP_NEGATE. To negate an integer that fits into 1 byte without having the MSB set, you just XOR with 0x80. Hence, 0x14 ^ 0x80 -> 0x94.

The script debugger I linked to above verifies this result. This python code verifies the result as well:

import hashlib
import binascii

def SHA256d(string):
    bin = binascii.unhexlify(string)
    hash = hashlib.sha256(hashlib.sha256(bin).digest()).digest()
    raw = str(binascii.hexlify(hash))[2:-1]
    return raw

print (SHA256d("94"))

Prints:

af462e245a0f463a93e23a54eb0b4d0d8da7a951e4d0b41015782a27e80a2e2c


How do I make my coin seeds? I want to add DNS seeds – like bitcoin – to my alt-coin. Is bitcoins generate-seeds.py and makeseeds.py the scripts to register DNS-seed ips?

Is bitcoins generate-seeds.py and makeseeds.py the scripts to register DNS-seed ips?

No, not at all. Those scripts are for creating the hardcoded seed nodes list which is retrieved from an existing DNS seeder.

To add a DNS seeder, you would need to add it to the list of DNS seeders in src/chainparams.cpp. Furthermore, you need to have a running DNS seeder which requires special software. One such is https://github.com/sipa/bitcoin-seeder.


How can I test my receive address? I downloaded the original software of Bitcoin at bitcoin.org.
I just created a receive-address. How do I know it will work? How can I test it?

An easy test is to sign a message using your private key and then verify the message using your public key (your receive address).  This can be done using Bitcoin-Qt by selecting File->Sign Message.

Sign a message by entering your receive address and some message text (anything you want).  Select Sign Message.  Copy the signature to the clipboard
Verify the message by entering your receive address and the message text (exactly as you entered it for signing).  Then paste the copied signature into the signature field.  Select Verify Message.
If everything is working correctly, you should get a message verified status.


Using bitcoin for international travel Bitcoin as a meta currency seems very useful if travelling through multiple places using currencies. I had this very intention for when I travel around asia.

What is the best method people have discovered for having the most flexible use of bitcoin when switching back to native currencies in such a manner?

Obviously, keeping fees as low as possible would be excellent.

You should be wary when trying to travel only on Bitcoins, some people have failed in the past.

At the current stage of development, Bitcoin is not ready to be used to finance your local spending across multiple countries, as getting money to and from an exchange takes a long while. Moreover, you can't withdraw money easily this way into a foreign currency, so the model would work like holding all your money in your local bank and using a debit card to withdraw money at an ATM.

You could potentially have your fellow Bitcoin enthusiasts offer to sell you local cash for Bitcoins on the spot, but that would require a lot of preparation, contacting people, and trusting them to show up on time when you need the cash. Generally, not an ideal situation.

All in all, it can't really be done at the moment. Maybe in a couple years...

Update: BitInstant has announced that they will be releasing an international MasterCard funded by Bitcoins in a couple months.


Proof of Stake - double spending I'm unsure how Proof of Stake prevents double spending.
In PoW it's evident that I need 51% of the hashing power of the network, to "overtake" the real chain with my fraudulent fork. But what stops me in Proof of Stake to:

Save the current chain as is.
Send 1 coin to Bob
Go offline and add blocks to my backed up chain, excluding my prior transactions, and wait until it's larger than the real blockchain
Go online and broadcast the fraudulent fork.

Does the rest of the network have a way to see that I cheated by adding my own blocks? In PoW they could check the hash, but they can't here. I of course wouldn't get any fees or rewards for the "fake" blocks, but I would still get my money back, that I send to Bob.

Hope someone can clarify why this is not possible, and how the network can spot that I wasn't selected to add those blocks.

What you are describing is a well documented problem with Proof of Stake called Nothing at Stake theory.

  In PoW they could check the hash, but they can't here.

That's incorrect. You could produce a valid hash and still have double spend transactions in PoW. That is because bitcoin blockchain is designed to accept the longest chain (technically, chain with the most proof of work). However, to launch such an attack in a PoW chain, the attacker must either control >50% of hashing power to mine faster than the rest of the network or split his computing power in half if he wants to mine on competing chains. That is not economically sound decision and hence cannot be achieved with PoW. However, in PoS the shortcoming arises because it costs a validator nothing to validate transactions on multiple forks.

  How to prevent Nothing at Stake Attack?

There have been proposed theories that involves penalizing validators if they simultaneously create blocks on multiple chains, by means of including proof of misbehavior. This means malicious validator's deposit is deducted if two conflicting signed block headers are found into the blockchain as a later point in time. This can be achieved because, to qualify as a validator, nodes will have to lock certain in the chain through a smart contract.


How easily can asics be ported over to other sha algorithms? Let's say I want to rewrite the software behind the hardware of current asics. Would it still mine, for example, sha1 algorithms orders of magnitude faster than a normal cpu would?

Application Specific Integrated Circuits are hard set to only do one thing, and in the case of bitcoin ASICs, that's SHA256 hashes. You cannot re-write the software, you would need a new circuit built that only does SHA1 or whichever hash you're looking for.

https://en.wikipedia.org/wiki/Application-specific_integrated_circuit


used Sending funds address to receive bitcoins Is there any way to get bitcoins when i accidentally used Bitcoin Core's "send to address" to get them?

Blockchain.info shows that there is balance, but the client shows 0 BTC and dumpprivkey does not work either.

If dumpprivkey provides no private key, then your wallet does not have it. You are not the owner of that address, and those bitcoins are not yours.


How can I run bitcoin-cli with disabled syncing? I have synced about 200.000 blocks and that's enough for my purposes. So I want to use bitcoincli, but when it runs with enabled syncing (by default), my computer works to slow.

How can I disable syncing for some time? Probably I need to set up something in bitcoin.conf, but I don't know what.

You could use the invalidateblock RPC. Bitcoin will not bother checking validity of blocks past that an invalid block.


How to get Electrum 3.1.3 on bitcoin testnet? I'm building an application on bitcoin and want to use testnet instead of using real bitcoins to do my test. I'm mainly using Electrum-3.1.3 to do sweeping of addresses. But how can I switch this to be on the testnet chain instead?

General answer is running:
$ electrum --testnet

If you are using Mac OSX then open terminal an jump to:
 /Aplications/Electrum/Contents/OSX
there you need to run:
& ./Electrum --testnet


If Btc2x doesn't have replay protection does that mean all transactions can be automatically replayed in btc2x? I believe btc will have a lot higher economic activity at the time of the fork. If anyone sends funds in btc, what stops someone who don't like btc2x to just replay that same transaction on btc2x? This will shuffle around funds, to different adresses and cause lots of funds to end up in wallets that are never found.

One of the protections against replay attacks is to first move the other coin to a new wallet first, but if someone automatically moves the coins in the other wallet aswell by publishing the same transaction to the other network, this protection won't work.

Since 2x has decided not to implement replay protection, transactions will be indeed compatible to both chains. If a transactions is simply broadcast to the other chain, it will enter the mempools there as well and may eventually get confirmed. This doesn't mean that one is completely helpless though. Here are some methods of making transactions valid only to one chain:

Input derived from a coinbase transaction
Coinbase transactions will only ever be valid on one chain. Therefore, including an output that derives from a coinbase transaction will make a transaction only valid on a single chain. Coinbase transactions need to mature to 100 confirmations before their outputs may be spent, so transactions based dependent on a coinbase will become valid about 17 hours later at the earliest.
nLocktime and doublespend
If one of the blockchains has significantly more frequent blocks than the other, one can create two transactions sending to oneself: One with a nLocktime for the next block on the faster chain, and another that spends at least one of the inputs from the first transaction with a very high fee. First, you broadcast the transaction with the nLocktime which will hopefully get included in the next block on the fast chain. Once it is confirmed, the doublespend is broadcast with a very high fee to the slower chain, hoping that it will get confirmed before the height of the nLocktime of the first transaction is reached. After waiting some more confirmations for safety, the outputs of these two transactions can now be used to create transactions specific to only one chain.
Doublespending
Create a pair of transactions with different recipient addresses that you own that spend the same funds. Broadcast both at the same time and hope that one gets confirmed on one chain while the other gets confirmed on the second. If unsuccessful, repeat.

Generally, as soon as one has some unspent transaction outputs that are unique to one of the chains, these can be used to make other transactions safe as well.


Find specific transaction in merkel's tree We know the merkel tree is branchs of transaction hash so that root of tree is hash that show in block header. If i want to find a specific transaction, how i can?

In order to verify if a transaction is part of a merkle tree, you have to calculate the hash of the transaction id and it's sibling, and verify that the value is correct. For example,

Merkle Verification

We’ll start with a simple 2 leaf example (see the First Bitcoin Transaction):

Lets assume that hashes Ha and Hb have already been calculated from the data Ta and Tb and that:

Ha = b1fea52486ce0c62bb442b530a3f0132b826c74e473d1f2c220bfa78111c5082
Hb = f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16

First, we must reverse the bytes (they need to be little endian) because that is how Bitcoin calculates the hashes. You can use this python script, if you like:

#!/usr/bin/env python
line = raw_input("Input original hex string\n")
n = 2
orig_list = [line[i:i+n] for i in range(0, len(line), n)]
reversed_list = orig_list[::-1]
reversed = ''.join(reversed_list)
print reversed

We get:

Ha = 82501c1178fa0b222c1f3d474ec726b832013f0a532b44bb620cce8624a5feb1
Hb = 169e1e83e930853391bc6f35f605c6754cfead57cf8387639d3b4096c54f18f4

Then, the node (and root in this case) Hab is calculated by concatenating the two and hashing with sha256 twice (i.e. hash256):

$ printf "82501c1178fa0b222c1f3d474ec726b832013f0a532b44bb620cce8624a5feb1169e1e83e930853391bc6f35f605c6754cfead57cf8387639d3b4096c54f18f4" | xxd -r -p | openssl sha256
(stdin)= a24ee7fb7333f85c16560ed8850a1773d6977ce7a4936367eaf72f8fff33797e
$ printf "a24ee7fb7333f85c16560ed8850a1773d6977ce7a4936367eaf72f8fff33797e" | xxd -r -p | openssl sha256
(stdin)= ff104ccb05421ab93e63f8c3ce5c2c2e9dbb37de2764b3a3175c8166562cac7d

Now, reverse the bytes! (back to big endian):

7dac2c5666815c17a3b36427de37bb9d2e2c5ccec3f8633eb91a4205cb4c10ff

https://medium.com/coinmonks/how-to-manually-verify-the-merkle-root-of-a-bitcoin-block-command-line-7881397d4db1


Chainstate database verification When you download the blockchain, do you download the chainstate too or it has to be generated by your own machine (it says that theoretically can be rebuilt from the block data but it is time consuming)? If it is downloaded how do we verify the integrity of the chainstate database?

The chainstate is generated as a side effect of validating the blockchain.


Internet speed required to run the Bitcoin client What is the rough estimate of internet speed needed to run the standard client? Does a faster Internet connection increase the client performance (by that I mean how fast it updates its blockchain, sends transactions, and how well can it function as a node in the network)?

Internet connection speed has to be fast enough to download new blocks as they get mined. With current transaction rate it requires 1-2 Kb/s. But faster connection would help to reduce chance of double spend attack if you run retail business and accept transactions with 0 confirmations.


Looking for testnet coins Having a hard time getting the amount of testnet coins I need. Anyone know a way of getting a rather large amount of testnet coins?

If you can spare some:mvhTdSXUhs812vY5t1StAKohwid5GwALgK

Ditto. I found this and am trying to implement it.

Apparently, you create a private testnet with low difficulty. I guess I'll go to lunch, because it apparently takes about an hour to do my "genesis block."

https://github.com/freewil/bitcoin-testnet-box

Be clear to stay away from the SourceForge one! Its instructions are out of date.


Does the amount of the transaction fee affect the priority of a transaction? I've been reading about transaction fees here.

From the aritcle,

  Transaction priority is calculated as a value-weighted sum of input age, divided by transaction size in bytes:
  priority = sum(input_value_in_base_units * input_age)/size_in_bytes
  Transactions need to have a priority above 57,600,000 to avoid the enforced limit (as of client version 0.3.21).

There are rules for determining the transaction fees needed depending on client etc.
My question is does paying a fee increase the priority or else how does it increase the chances that the transaction will be accepted by the network. If it changes the priority, what is the formula for determining priority. If you pay more than the default fee does it increase the priority even more?

Currently no.  Any "required fees" are enforced only by the client not the network or protocol.

It is up to each individual miners which transactions to include in a block.  If forced to make a choice a miner would choose a paying transaction over a nonpaying one however current transaction volume is so low that all transactions (paying and otherwise) can fit into next block with significant room to spare.  If you used a modified client with no fees most miners would simply include your fee transactions.  Some pools (Eligius) will exclude free transactions that "should" (based on mainline client rules) have a fee.

As for what fee is the minimum to guarantee access to the next block.  Most miners and mining pools prioritize transactions by fees and then priority.  If you include any fee (even 1 satoshi) even if it is less than what is required by mainline client it likely will be included in the next block. Paying more is likely of negligible value as paying anything almost guarantees access to the next block.  The block size limit isn't much of a capacity constraint to warrant higher fees (and move further up transaction list ordering).  I can't see any miner excluding a valid paying transaction from any block at current transaction volume.

The current fee structure (or lack thereof) brings up some scalability issues when block reward aproaches zero.  The development team has indicated an improved fee structure is something planned for later releases.  It is an issue which will need to be addresses as left as it is now one could simply include 1 satoshi fee with every transaction and it would drive block fees down to ~ (transactions per second) / 166,667 BTC per block.  Even at high volume of say 1,000 tps it would be a tiny number and thus network hashing power would fall to a tiny fraction of current hashing power leaving the network vulnerable.


How do nonce and difficulty relate? Good morning,

I'm reading about Blockchain technology but I have a couple of questions about the nonce that I cannot find the answers for.  I'm hoping someone here will be able to answer them.

i)  In order to adjust for the level of computing power available, how is the difficulty of the nonce changed?  What is the mechanism that checks if this should happen and how?

ii) What is to stop a code-savvy miner from changing the difficulty of their generated nonce to something easy so that they are the ones to place the block in the blockchain and win the mined coins?

I'm finding this topic quite fascinating and so any help you guys can provide is always greatly appreciated.

The Nonce is not difficulty based, the hash of the block is difficulty based. First, the miner hashes the block and checks if the block is solved. If it is not then the Nonce is incremented. If the Nonce overflows (which it does frequently) then the extraNonce portion of the transaction is incremented changing the Merkle Root and the block hash again, so the miner continues and again cycle the Nonce value.

There is some information here.

There is nothing stopping a miner changing locally the difficulty of the block it's mining, but such block simply won't be accepted by the other Bitcoin nodes.


Why does segwit save space on the blockchain? I've had a hard time finding a good source online that explains segwit.
I've read the basic idea is to store the scriptSigs separately as the scriptSig is potentially malleable, and then compute the txid without the scripSig.
But the scriptSig still needs to be somewhere on the blockchain, so how does this save space?

It doesn't save space, as it still stores the witness data somewhere, but it allows the blocks (according to some canonical definition of "block") to increase in a subtle manner while being a soft-fork instead of a hard-fork (this basically means it doesn't break compatibility with previous Bitcoin clients).


Can you shutdown part way through synchronization process and start up again from the same point? Can you shutdown part way through synchronization process and start up again from the same point?  When opening bitcoin software again will the process start from where it left off or does it need to begin all over again?

Yes you can, as long as you don't close the client in some bizarre way (system crash, etc.). In such case, you can get a blockchain that will never synch (you'd have to delete it and start over). But in most cases, yes, you can close the client and start synchronization over without a problem.


Is this a problem that a pool found 6 consecutive blocks? Check this out:

The pool will not make the 51% attack of course, for they are counting money on the system;
but it's still a problem right?

It would be a statistical anomaly if this did not happen from time to time.

With pools having over 20% or so, they're bound to find 6+ consecutive blocks every now and then.

It's not a problem. They can't really abuse or corrupt the system like this, especially since they can't plan for this sort of thing to happen on purpose. Even if they'd have 30%, it's still a rare phenomenon (like less than once in a thousand tries).


GUIMiner - Don't seem to recognize my GPU. Where to set it up? Please don't be rude, I'm not looking for making a living on bitcoin mining, I'm just experimenting with it a bit. At least I would like to, but I can not use properly the GUIMiner. I reckon that I should be getting a bit better rates, like twice as good as now.

I don't see any option to enable processing by the GPU, I can only see my CPU in the list.
My hardware: Intel Dual-Core E5200, 2GB DRR2 RAM, Radeon HD7730 2GB VGA.

I've already installed the AMD developer tools/kit, it made no difference.

It really looks like to me, that it only uses my CPU.

Screenshot:

It is recognizing your GPU, as "capeverde". ATI has code-names for their GPU revisions, such as Cape Verde, Winter Park, Tahiti, and so on, listed here. Cape Verde matches your model on that list.


Check if multiple signatures match a specifc public key Suppose you have a company which has three main leaders called A, B and C also the company have 5 shareholders called S1 to S5. The decision rule for spending any coin from company's address is to either we present 1 of the main leaders signature and three other signature from shareholders.
For example following unlocking script works (since it contains one of the leaders):

<sig_S1> <sig_A> <sig_S2> <sig_S5>

but not this one:

<sig_S1> <sig_S4> <sig_S3> <sig_S5>

How I can check if amongst multi signatures there exist a signature which corresponds to a specific public key, in this case, I will learn that a leader's signature surely exists. for example, if we find out from 5 signatures provided the signature of A exists, and the locking code will look like follows:

(3 times duplicate of all signatures provided)
(check for the existence of A in signatures)
OP_IF
   4 <pub_A> <pub_S1> <pub_S2> ... <pub_S5> 5 OP_CHECKMULTISIG
OP_ENDIF
(the same as above for B)
(the same as above for C)

I believe it could work with a RedeemScript like this (haven't tested the scripts):

OP_IF
  3 <pub_A><pub_B><pub_C> 3 OP_CheckMultiSig
OP_ELSE
  1 <pub_A><pub_B><pub_C> 3 OP_CheckMultiSigVerify
  4 <pub_S1><pub_S2><pub_S3><pub_S4><pub_S5> 5 OP_CheckMultiSig

Explanation: The redeem script has two parts:
- OP_IF: this part could be removed, it is there to allow the "leaders" to spend the funds without needing the "shareholders" signatures. Depending on the purpose it could be removed (remove first 3 lines of RedeemScript and signature doesn't require OP_TRUE/OP_FALSE in it).
- OP_ELSE: this provides what you need with 2 multi-signature operations. The first one requires at least one signature out of 3 "leaders" signatures and performs a OP_CheckMultiSigVerify (there is no true/false remaining on the stack after the execution) and the second one requires 4 of 5 signatures from "shareholders".

To spend, either one of these signature scripts should be provided (OP_0 is mandatory due to the bug in CheckMultiSig OPs):

OP_0 <sig_A><sig_B><sig_C> OP_TRUE <RedeemScript>

or

OP_0 <sig_S1><sig_S2><sig_S4><sig_S5> OP_0 <sig_A or B or C> OP_FALSE <RedeemScript>


Plain text for the Bitcoin symbol It seems that the most widely used symbol for Bitcoin is a B with two vertical lines through it1. It makes sense, as a single letter with a line or two through it is common for many currencies. Is there a plain text printing for this symbol, or perhaps a font that can insert it into documents and the like? What about a hex code or something for HTML printing? I'm looking for other ways to denote the currency without using an image.

With the symbols found here, it looks like a circle around it might become part of the official symbol as well. Maybe I should ask that separately.

Like Murch said, there isn't a current text based symbol for it, but if you're going to use it on a web application, you can always use Font Awesome.

After you include the fontawesome library, you use the bitcoin symbol like this:

<i class="fa fa-btc"></i> fa-btc

Example output of the code above would be:

You can find more information regarding fontawesome bitcoin symbol documentation here.


How to find out the requirements for spending an output script? How do you find out the requirements to spend an output script?

Do you decode the hash?

I'm assuming you're talking about P2SH addresses here, since that's really the only time this matters.

For standard P2SH addresses, you cannot find the spending requirements by just looking at the address. Let's look at 3DzSVk4veMCkNbNT9CdETeE26uWxmNbBnD from a recent block as an example.

The output script of this address is a91486ed17bfa7bd80cf87cf7e80abd9289079b78c5b87. This alone simply amounts to HASH160 PUSHDATA(20)[86ed17bfa7bd80cf87cf7e80abd9289079b78c5b] EQUAL. This means that to spend the tx, you need to provide some input, that once run through HASH160 equals 86ed17bfa7bd80cf87cf7e80abd9289079b78c5b.

This is the general format for any P2SH output script. To actually know what kind of script it is, you need the redeem script, which can be found in your wallet. If the address is not one of your own, the redeemscript is revealed when an output to that address is first spent.

Looking at this tx for the above address, we can find the redeemscript as 5221038934160de8ad1dd529329f5bf51e3086cc0f6d19e10fb4120385f23d871c0c1d21021659435e23e3891d39ec2b0266b3c14a68cb4e45adb8543f31508310c98722d952ae (the final push in the script for the input).

Running the above redeemscript through the decodescript command gives us:

2 038934160de8ad1dd529329f5bf51e3086cc0f6d19e10fb4120385f23d871c0c1d 021659435e23e3891d39ec2b0266b3c14a68cb4e45adb8543f31508310c98722d9 2 OP_CHECKMULTISIG

This identifies the script as a 2of2 multisig.

This could very easily have been any other form of script, such as 2of3 multisig, or not multisig at all. It could even be a segwit address wrapped in a p2sh address. However, just by looking at the address, you cannot determine the type of script. You must have the redeemscript to determine the spending requirements.


Double spending UTXOs I know that the inputs for a transaction(which is not coinbase) are UTXOs.
Are UTXOs kept track of by some servers and also the owner's wallet?
If there are servers which keep track of UTXOs, is it not leading to some centralization? Because,the owner of these servers may tamper with the UTXOs.

If there are servers which keep track of UTXOs, how can one doublespend?
Is it the case that servers and wallets get updated of the existing UTXOs only after creation of the block by miners in which that transaction exists?
If there is a double spent transaction in a block then the whole block gets orphaned right?
Please correct me if my understanding isn't correct

Each node can choose to build and maintain its own UTXO set, which it can then verify incoming transactions and blocks against.

  If there are servers which keep track of UTXOs, is it not leading to some centralization?

The network remains decentralized as long as a sufficient number of users are running their own nodes around the world. Each node could be considered a 'server' in some sense, but I think you are talking more about industrial server farms, which is not the case for btc nodes.

  the owner of these servers may tamper with the UTXOs.

This is not possible, the other nodes would recognize that the transactions involving tampered UTXOs are invalid, and reject them.

  If there are servers which keep track of UTXOs, how can one doublespend?

Double spends are not possible, once a transaction is confirmed in a block, all of the nodes will update their UTXO set appropriately, and reject any transactions / blocks attempting to spend already-spent or otherwise invalid transactions.

  If there is a double spent transaction in a block then the whole block gets orphaned right?

No, the block would simply be invalid. Orphaned blocks are valid, but not included in the longest blockchain (likely because another valid block with the same blockheight was found and relayed through the network first).


Colluding miners attack: Is the Bitcoin protocol compromised? A very interesting academic paper has been recently published by two researches from the Cornell University (abstract, full PDF):

  Abstract

  The Bitcoin cryptocurrency records its transactions in a public log
  called the blockchain. Its security rests critically on the
  distributed protocol that maintains the blockchain, run by
  participants called miners.  Conventional wisdom asserts that the
  protocol is incentive-compatible and secure against colluding minority
  groups, i.e., it incentivizes miners to follow the protocol as
  prescribed.

  We show that the Bitcoin protocol is not incentive-compatible. We
  present an attack with which colluding miners obtain a revenue larger
  than their fair share.  This attack can have significant consequences
  for Bitcoin: Rational miners will prefer to join the selfish miners,
  and the colluding group will increase in size until it becomes a
  majority. At this point, the Bitcoin system ceases to be a
  decentralized currency.

  Selfish mining is feasible for any group size of colluding miners. We
  propose a practical modification to the Bitcoin protocol that protects
  against selfish mining pools that command less than 1/4 of the
  resources.  This threshold is lower than the wrongly assumed 1/2
  bound, but better than the current reality where a group of any size
  can compromise the system.

The article suggests that miners who group together can earn more than their fair share, which means rational miners will eventually group together into a pool whose size is larger than half the network's computation power and control the currency. The method was termed "selfish mining" by the media.

This seems to be the first serious cryptographic exploit of the Bitcoin protocol.

Do you think this poses a real threat to the stability of the currency?

The report is not heavily disputed.

In the hours following the paper's release, several developers are discussing solutions:

http://www.mail-archive.com/bitcoin-development@lists.sourceforge.net/msg03128.html

and

http://bitcointalk.org/index.php?topic=324413.0

There has not been any evidence that such an attack is imminent or likely even.  And remember, even an attacker with 51% cannot do much.  One risk is that a transaction could be canceled after it has confirmations, if the selfish pool is that much further ahead.


Bought BTC from Blockchain but Received Less Than Expected Recently, I bought £350 worth of bitcoins back when they where £37 the other day. They've taken over a day to get through to me and when I have received them I only have 7.7 (compared to the 9.1 that I need). I appears they have charged me at today's prices instead of the ones that where the current price the other day. Even though when I purchased the coins it said I was buying £350@37 a coin.

Is it normal practice to do this?

Right, just called up and it looks like Barclays (The owners of PingIt) where completely overwhelemed at the point and so where slow to process it. The person I talked to was very helpful and is going to send me the extra amount now. I contacted him at this number: (+44) 7525 431876.

In hindsight, I think they where just incredibly busy with orders and so where slow putting it through.


Difficulty based derivatives and insurance What would the basis of difficulty derivatives and insurance be? Like how could we structure someone such that if the difficulty goes above a certain amount there's a payout to protect miners, & stabilize their ventures?

Unlike a commodity which can limit speculation with a delivery requirement, speculation on the difficulty really is more suited for something like a predictions market like https://www.fairlay.com/event/category/bitcoin/difficulty/.

MPOe at one time had an options contract on future hashing but that is no longer offered.


Vouching for (or against) the reputation of a bitcoin user Since it's possible to link non obfuscated transactions to a "user" does is make sense, or it is possible for anonymized users with an established transaction history to "vouch" for another?

I'm thinking this would be similar to EBay's seller rating system, where people can prove they did a transaction with someone and then comment on the experience accordingly.

There is already three rating systems in existence from different trading platforms: #bitcoin-otc , Bitmit and Silk Road. Bitcoin users actively using their rated OTC identity to make their words more trustworthy.

I believe integration of rating system into Bitcoin Network won't be beneficial and developers will not ever try to implement that. It is possible that in future obfuscation will be enabled by default, at least it is feasible to do it : Automatic Coin Mixing Idea and P2P coin mixing.


RPC call to bitcoin node on local machine respond back with code: 401 I am trying RPC request to bitcoind node,using  Kotlin. My code looks like

import khttp.delete as httpDelete
val node_url = "http://rpcusr:rpcpass@127.0.0.1:18443"
val json_resp =  khttp.post(url = node_url,
                            headers = mapOf("Content-Type" to "application/json"),  //also tried application.json and text/plain
                            json = mapOf("id" to "curltext","jsonrpc" to 1,"method" to "getblockchaininfo","params" to arrayOf("")))
println(json_resp.text)

and its output -->

<TITLE>Error</TITLE>
<META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'>

401 Unauthorized.

bitcoin.conf -->

rpcuser=rpcusr
rpcpassword=rpcpass
rpcallowip=0.0.0.0/0
server=1

Using curl i am getting desired output

CURL  command-->

curl -v --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getblockchaininfo", "params": [] }' -H 'content-type: text/plain;' http://abc:pass@127.0.0.1:18443

o/p -->

{"result":{"chain":"regtest","blocks":0,"headers":0,"bestblockhash":"0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206","difficulty":4.656542373906925e-10,"mediantime":1296688602,"verificationprogress":1,"initialblockdownload":true,"chainwork":"0000000000000000000000000000000000000000000000000000000000000002","size_on_disk":293,"pruned":false,"softforks":[{"id":"bip34","version":2,"reject":{"status":false}},{"id":"bip66","version":3,"reject":{"status":false}},{"id":"bip65","version":4,"reject":{"status":false}}],"bip9_softforks":{"csv":{"status":"defined","startTime":0,"timeout":9223372036854775807,"since":0},"segwit":{"status":"active","startTime":-1,"timeout":9223372036854775807,"since":0}},"warnings":""},"error":null,"id":"curltest"}

  The reason why i am asking this question on this forum is, i took the
  same approach to get rpc response from Ethereum node and i am getting
  proper response,the error is occuring only with bitcoin & litecoin node

Any clue why it is behaving this way ?

You are not properly sending the authentication headers. From a quick reading of the documentation, you need to add auth=BasicAuthorization("rpcuser", "rpcpass") to your post request because the URL http://rpcusr:rpcpass@127.0.0.1:18443" is not sufficient for khttp to send the basic authentication headers.


bitcoin node: what is the difference between simnet and regtest? btcd, and presumably other bitcoin node implementations, seem to have 4 network options:

mainnet
testnet
regtest
simnet.

I get that mainnet and testnet both are "public" in that your node will communicate with other nodes and that both have an existing blockchain and genesis block.

However, from what I can tell, both simenet and regtest both create a local only blockchain, and both will create a new genesis block. I this case, what is the difference, and which is better (easier) for developing bitcoin applications?

This is what the documentation has to say:

--regtest             Use the regression test network
--simnet              Use the simulation test network

Simnet is only available for btcd (bitcoin node) and lnd (lightning node) afaik, while regtest is also available for bitcoind (bitcoin node), lnd and eclair (lightning nodes). The two modes are similar, according to documenation of LND:

  Simnet is similar to regtest in that you'll be able to instantly mine blocks as needed to test lnd locally

Both also are similar in the fact that the payment addresses are unique, to prevent confusion with the main network.

Where they differ, I think, is that simnet goes a bit further and also applies some network changes to disable things like peer discovery.

But I couldn't find conclusive evidence for this. Since I do a lot of tests with multiple Lightning clients, I tend to use regtest, since that's more broadly supported.


Would signature aggregation reduce the largest feasible blocksize If a Schnorr signature aggregation scheme were to be integrated into Bitcoin. Would the reduction in witness data versus non witness data (need less bytes for a signature therefore witness data usage would go down per tx) create a lower upper limit on potential blocksize (believe the realistic upper limit is 2.5 MB rn)?

SegWit blocks aren't limited in bytes anymore but rather in weight. The maximum weight for a block is 4M. The weight of non-witness data is 4x its number of bytes.

So, yes, decreasing the amount of signature-data frees up some weight which can then be filled by more transactions. Yet those new transactions also contain some non-witness data which is more costly. An average full block will still be 4M in weight, but reduced in size (bytes) while containing more transactions. Both are good news.


how to free up disk space after running bitcoind for the first time? I am following Antonopoulos' Mastering Bitcoin.  I have installed Bitcoin core and ran bitcoind for the first time. Although the book said it will remind me to create a configuration file, it did not.  It rapidly used up the disk space (I am running it on VM Ubuntu) and I had to interrupt it.

I want to free up the used space and try again with configuration file, but I do not know what to do.

Find the data directory: https://bitcoin.stackexchange.com/a/11210

Create a file named "bitcoin.conf"

Add
    prune=550
to that file.

Restart Bitcoin Core.


How did pay-to-pubkey hash come about? What is its history? We know that early blocks all used pay-to-pubkey (p2pk) and at some point, we mostly switched to pay-to-pubkey-hash (p2pkh). What is the history behind this? Who made the changes and when did p2pkh become standard?

Also, does this have anything to do with the move toward compressed keys?

Pay to Public Key Hash has existed for the entirety of Bitcoin's life. P2PKH addresses have existed since the earliest release of Bitcoin. Creating P2PKH addresses and sending to P2PKH addresses was possible to do with Bitcoin 0.1.0.

However these early versions of Bitcoin also supported a Pay to IP address feature where your wallet would contact the wallet at a given IP address and request a scriptPubKey to send to. The response would be a P2PK scriptPubKey and thus you would create P2PK outputs.

Blocks too were mined to P2PK outputs, and in fact, Bitcoin Core still does this. Bitcoin Core's internal miner (which is only used for regtest and testnet now), still creates P2PK outputs instead of P2PKH outputs.

Pay to IP eventually began being phased out in Bitcoin 0.3.13 when its usage was hidden behind a command line switch -allowreceivebyip in commit 172f0060 (note the author is Satoshi, however he appears to have also incorporated code from someone else). The ability to send to IP was removed in Bitcoin 0.5.0 with the last remnants of the networking code related to Pay to IP removed in Bitcoin 0.8.0.

It was known before Pay to IP's removal that it was insecure. Since the only other way to transact was via addresses, P2PKH was already widely in use with P2PK never seeming to get much use as it was only use for Pay to IP and for blocks created by the Bitcoin client.

Once external mining software came about, blocks began using P2PKH instead of P2PK because it was easier to enter an address from your wallet into an external miner than it was to get a pubkey and enter it. People were also accustomed to using addresses at that point, and addresses only work for P2PKH outputs.


Walletnotify not working Here's my bitcoin.conf:

server=1
rpcallowip=127.0.0.1
rpcuser=userrunningbitcoind
rpcpassword=passwordofuserrunningbitcoind
rpcport=7788
walletnotify=/home/userrunningbitcoind/transaction.sh %s

And here's my transaction.sh, which I've tried running manually already. This works without issue on its own:

#!/bin/sh
curl -d "txid=$1" http://127.0.0.1/api/process-payment

What else can I try to get walletnotify going?

EDIT:

I've additionally found this in my debug.log:

2018-01-19 05:49:22 Binding RPC on address 0.0.0.0 port 7788 failed.
2018-01-19 05:49:22 No rpcpassword set - using random cookie authentication
2018-01-19 05:49:22 Generated RPC authentication cookie /home/userrunningbitcoind/.bitcoin/.cookie

Remember to restart bitcoind again after you make any change in bitcoin.conf file. It seems as if you set an rpcpassword in the conf but didnt restart the bitcoind service. You have everything set up properly i guess.


What would the rough hash rate for an ec2 instance be - litecoin High-CPU Extra Large Instance

7 GiB of memory

20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each)

1690 GB of instance storage

64-bit platform

I/O Performance: High

EBS-Optimized Available: 1000 Mbps

API name: c1.xlarge

Above is the specification for an Amazon EC2 instance, I was just wondering if there is any information on what the hash rate would be for litecoins on this Amazon EC2 instance.

Is there any calculations you can use to find out the hash rate from the GHz of a processor?
I know none f the other specs apart from the processor really matter but I'm just not sure what the GHz for the EC2 processor would be.

It may not be as high as you expect with out compiling CPUMINER for multi core.
I can not tell if the last on the list is the same or a slower version of what you are referring to from this list online.

http://litecoin.info/Mining_Hardware_Comparison#Other
based on that page, each Amazon High-CPU Extra Large Instance, running Ubuntu 12.04.1 and using pooler's cpuminer 2.2.3, has a script hash rate of 38 Khash/second. Rounding down ( habbit, no real math reason other than the real world is usually slower ) to 19 times that makes it an estimated 722  Khash/second and possibly faster.


Is there an alternative to Bloom filters? There have been a few papers, online publications and discussion about the negative effects of bloom filters on privacy.

What are the alternative to using bloom filters?
(bonus question: Are there any improvements we can make to bloom filters?)

I assume you are talking about BIP 37 which uses bloom filters for SPV wallets.

Currently there are no alternatives to BIP 37 for SPV wallets. However roasbeef is working on a proposal for client side filtering, which you can read about here: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2017-June/014474.html. Client side filtering is an alternative to using BIP 37 and should work much better than BIP 37 does.


What is the command to sign a message using a segwit private key using electrum 3? I want to sign and verify a message using a segwit private key that i generated with another application. How can I sign and verify a message using electrum 3 cli?

Electrum provides signmessage and verifymessage commands that you can use to sign and verify messages.

For signing messages with a different private key, you will need to import it into the wallet.

Verifying a message does not require any additional work.


Signmessagewithprivkey result is different than txinwitness I'm studying segwit and I'm doing some experiment in regtest.
I create a raw transaction with P2SH address.

My Transaction data without signature is:

0200000001faf19017fe7e20747535ac41009922e4beb76e17a7fd5423bc60e75fbc8381c40000000000ffffffff01606b042a0100000017a914b63007b51b936175644dcf654f77c528e35f01178700000000

that's my message to sign, instead to use signrawtransactionwithkey I try to use signmessagewithprivkey and I expect the signature that I can find in txwitness field (first row).

signmessagewithprivkey return base64 signature then I convert it in hex.
result is:

20db4febb769c43c9072daf30934a345b2327b6107e701f21c7fe052a040180d4129dc3079dc7dad29db37c31fa6401013819e386beb9396e330b3b6e9f7fbcf5b

signrawtransactionwithkey return:

"txinwitness": [
      "3044022077f49ad0371ea5baf0ce60d3d15175c9bb5e37ff7f3bc023b76863b2a91d379e022073010deba5eef8619745cd79d94a73c4a4527391253731104fc734449322d85b01",            "02985586bf43d26229a97092f76086cfe6f9bf09d93bef16a92f65185c8f7f0b17"
      ],

I wonder, why the result of signmessagewithprivkey isn't equal at first raw of txwitness?

From Elliptic Curve Cryptography perspective everything you sign is a "message" but the term "message" in bitcoin context means a random string that user wants to sign with his key (usually used for proof of ownership or something similar).
This means when you use sign*message*withprivkey the code interprets the input as a string and signs it with a different method that generates and entirely different digest ("some_fixed_string" + UTF8.Decode("0200000001f...")). But when you use sign*rawtransaction*withkey the code interprets the given string as a transaction and signs it based on its input scripts with different methods ("Transaction.Decode("0200000001f...") then Serialize() based on BIP143 for SegWit).


Where can I find a list of merchants who accept bitcoins? Is there a list of merchants who accept bitcoins?

As well as the https://en.bitcoin.it/wiki/Trade page you could look at:

http://www.thebitcoinreview.com/

and

http://www.thebitcointrader.com/p/bitcoin-better-business-bureau.html

Both of these sites try to give some kind of rating or review but the data is limited at the moment.


You can find n by consulting a discrete log oracle, such as myself. N is 5. You're welcome.