DashCoin insight setup in ubuntu system I have tried to installed dash insight ui & api in my local machine (ubuntu OS) and it is completed all the steps but I m facing issue while start services in frontground.

Let me share with you command, config file.

https://www.npmjs.com/package/bitcore-dash

But getting below error in my terminal:

    [2018-02-09T04:18:18.022Z] info: Using config: /home/dashcore/.bitcore/bitcore-node-dash.json
[2018-02-09T04:18:18.024Z] info: Using network: testnet
[2018-02-09T04:18:18.026Z] info: Starting bitcoind
[2018-02-09T04:18:18.028Z] info: Using bitcoin config file: /home/dashcore/.bitcore/data/dash.conf
[2018-02-09T04:18:18.030Z] info: Starting dash process
dashd: zmq/zmqpublishnotifier.cpp:101: virtual void CZMQAbstractPublishNotifier::Shutdown(): Assertion psocket' failed.
[2018-02-09T04:18:18.245Z] warn: Dash process unexpectedly exited with code: null
[2018-02-09T04:18:18.246Z] warn: Restarting dash child process in 5000ms
[2018-02-09T04:18:23.247Z] info: Using bitcoin config file: /home/dashcore/.bitcore/data/dash.conf
[2018-02-09T04:18:23.248Z] info: Starting dash process
dashd: zmq/zmqpublishnotifier.cpp:101: virtual void CZMQAbstractPublishNotifier::Shutdown(): Assertionpsocket' failed.
[2018-02-09T04:18:23.481Z] warn: Dash process unexpectedly exited with code: null
Warning: Failed to create backup, file already exists! This could happen if you restarted wallet in less than 60 seconds. You can continue if you are ok with this.

MY Config File  (bitcore-node-dash.json)

    {
  "network": "testnet",
  "port": 3006,
  "services": [
    "bitcoind",
    "web"
  ],
  "servicesConfig": {
    "bitcoind": {
      "spawn": {
        "datadir": "/home/dashcore/.bitcore/data",
        "exec": "/home/dashcore/.bitcore/data/dashd"
      }
    }
  }
}

Dash Config  (dash.conf)

server=1
whitelist=127.0.0.1
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://MyIPAddress:28332
zmqpubrawtxlock=tcp://MyIPAddress:28332
zmqpubhashblock=tcp://MyIPAddress:28332
rpcallowip=127.0.0.1
rpcuser=dash
rpcpassword=local321
uacomment=bitcore

Can you please help me with it? What is wrong in which step?

Try this configuration. It worked for me it might work for you too.

server=1
whitelist=0.0.0.0/0
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubrawtxlock=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcuser=dash
rpcpassword=local321
rpcport=9998
rpcallowip=0.0.0.0/0
uacomment=bitcore
debug=0
testnet=1


What is the best way to buy bitcoin for long term investment to sell for cash later? I apologize if this is a duplicate of this question, but it might be because of my ignorance about this topic that I think I am asking for different information.

I would like to buy some bitcoin. About $100 USD worth. From today's rate that is a little more than 0.1 bitcoin. I am fine with hanging on to it for a few years. Maybe five or longer. My concern is that there doesn't seem to be an easy way to sell bitcoin, like through mt.gox. Maybe I'm mistaken about that. I just want to make the purchase and have it to easily sell later, like I do with stock on Scottrade.

Also, if it is on topic, suggestions for litecoin and peercoin would be very much appreciated. It seems like it is on-topic according to some meta posts.

Exchanges work by letting you both buy and sell bitcoin (see How can I withdraw dollars from Mt Gox?). That's who is doing both the buying and selling in most cases: people like you who got their starting bitcoins by buying them.

When you're looking long-term, you should consider the stability and reputation of where you store your bitcoins. MtGox and Coinbase are two options for exchanges you could use, but as the above-linked question states, getting USD out of MtGox isn't straightforward at the moment, while getting it out of Coinbase is (but nobody really knows what the legal status of these exchanges and Bitcoin will be in 5 years). To eliminate the possibility of someone else losing your bitcoins (or you losing access to your account), instead of keeping the bitcoins in the exchange, you could transfer them to a wallet of your own (especially if you decide to buy a more significant amount of bitcoins).

Then the onus is entirely on you: print the private key and keep it somewhere secure (a bank's secure deposit box would be perfect, but too expensive to just store $100 worth of bitcoin), or encrypt it and remember (or write down, and secure the paper) the password while putting the encrypted file on various drives and cloud storages, or whatever else you decide to do. Of course, this means that you might accidentally lose access to your bitcoins if you aren't careful.

You can decide which risk you're more willing to take. I think I'd do the following: Buy it on Coinbase and transfer it to an offline wallet. Secure that as mentioned above, then when you're ready to sell, transfer it back into Coinbase (or whatever exists then) and to your bank account.


Do all Bitcoin alternatives need to have a coin limit? In the Netherlands, it was just in the news the e-gulden was launched.
Before we got the Euro (€) we had that currency in our country.

An E-gulden (EFL) is currently 50 EFL = €1,50

But is there for any cryptocurrenty a limit? Or could the creators just create as many as they like?

I know that Bitcoin has a maximum coin limit.

E-Gulden has a limit of 21 Million.

Most, but not all cryptos have a limit, for example DogeCoin recently announced that there would be a minimum reward of 10,000 doge for every block after the previously announced reward schedule was supposed to end.


Do payment channels have an address? And where are their transactions actually being written to? In the Lighting Network or with micropayment it's possible to open up payment channels that basically work like a smart contract.

At the beginning, the channel is funded by one or two parties with some initial coins (or "funds"), which is then transactioned to the blockchain. The question is: Where do these initial coins go to? Are they like stored in the blockchain-only? Or are they stored in some kind of virtual Bitcoin address for that channel?

So let's say one party is Alice and the other is Bob. The channel is single-funded by Alice (the very same as here). Now Alice sends Bob 0.2 BTC: Where are the transactions in the channel being written to? In other words, how can I make sure that Alice doesn't deliberately screw up the channel and gets back the 1 BTC instead of the 0.8 BTC? Does this even reliably work without a man in the middle? If not, who or where is this man in the middle?

The payment channel between Alice and Bob is encoded as a 2-2 multisig Adress the balance of that Adress is the capacity of the channel.

A channel is opened by sending funds to that multisig Adress via a funding transaction. These funds do exist (on the Bitcoin network) and are by no means virtual.

Alice and Bob each control a key of that Multisig Adress meaning they cannot spend from that address without the help of the other party.

The balance of the channel (not to be confused with the capacity) is encoded by a pair of commitment transactions. One for Alice and one for Bob. This is a spend of the funding transaction. And has at least two outputs. One for Alice encoding the amount of funds she has in the channel and one for Bob encoding his amount of funds in the channel.

Commitment transactions have exchanged signatures and can be published any time and encode the distribution of funds that alice and Bob agreed to.
When Alice sends funds to Bob a new commitment tx is negotiated.

Only problem is to invalidate or revoke the previously signed pair of commitment transactions. This is achieved by creating timelocks one the outputs of the commitment transactions, and allowing that output to be spend without the timelock if a revocation secret is presented. This incentivizes both parties to only broadcast the most recent commitment transaction.

All of this works as a protocol on top of Bitcoin as such it is nothing but a clever (?) way to use Bitcoin.

As for trusting a man in the middle. The trust model relies on the Bitcoin network (as hopefully became clear). As long as we trust the Bitcoin network to be honest operating a payment channel works as expected.


Sharing the lightning-rpc socket I'm using user "lightning" to start the daemon, but would like to have user "bitcoin" to make the lightning-cli calls. How do I share the lightning-rpc file to do so?

Thanks!
Francois

Have the users share a group, and write a wrapper it even a plugin to change the group and permissions on the rpc file. That's the normal Unix way...


Bitcoin open source web wallet with Bitcoin wallet service Where the user email and password are stored when user registered on the web wallet websites like blockchain.com ?

Is the blockchain.com directly interact with the bitcoin blockchain and store the email and password on blockchain ??

How the web wallet works ? How they are interact with the blockchain ?

Sorry for lots of questions in one , The main thing that i want to understand how the more secured web wallet interact with blockchain ?

Where the user email and password are stored when user registered on
  the web wallet websites like blockchain.com ?

In the ORDBMS database.

  Is the blockchain.com directly interact with the bitcoin blockchain
  and store the email and password on blockchain ??

The blockchain.com has full bitcoin node and interact directly with bitcoin node. They doesnt store users data(email, passwords and so on) in the blockchain

  How the web wallet works ? How they are interact with the blockchain ?

Web wallets is a plain middleware between full nodes and users, they are in the cloud.

  How the more secured web wallet interact with blockchain ?

Your wallet is protected, but there is always a chance what this web wallet(or any other web service which offers web wallets) will be hacked.


Can Bitcoin mining hardware be used for other Crypto coins? Can Bitcoin mining hardware be used for other Crypto coins?

You can do, if they are using the same mining algorithm. Bitcoin is using SHA256, here is a list of other coins using the same algorithm:

SHA256-Coins

Other coins like Litecoin are using the Scrypt algorithm, those are not compatible with bitcoin mining hardware.


Warning Newbie: How does a Ledger hold multiple currencies? So you startup your ledger, copy down your 24 words, and you now have a public and private key. (I think). Now you add the BitCoin App to your Ledger and you can add BTC to your "hardware wallet" using those keys. (Though phrasing it that way is a bit of a misnomer since the only thing your Ledger ever really stores is your private/public keys.)

So far so good for one currency. However, a Ledger will hold multiple currencies. That I can find there is no asking for another 24 words. You just add the second app and you now have a wallet in that new currency. So I assume that means that if you purchase Ethereum coins it is going to use the same public/private keys that you used on BitCoin?

That would also imply that you cannot have two BitCoin wallets on the same Ledger because attempting to do so wouldn't make sense without a second set of keys which the Ledger doesn't have.

Is what I am saying correct?

Frank

You've discovered that with a Hierarchical Deterministic wallet like the Ledger, a single 24-word phrase can be used to derive (essentially) infinite public/private key pairs and addresses.

This standard is a combination of:

BIP32 - HD Wallets

BIP39 - Mnemonic code
and

BIP44 - Multi-account hierarchy

Notice that BIP44 takes that seed phrase and standardizes a series of values that make up a "path" from the seed phrase to a specific key:

m / purpose' / coin_type' / account' / change / address_index

That coin_type value I believe is the answer to your question.

Satoshi Labs (developer of the Trezor hardware wallet) maintains a list of values for the coin_type field here: https://github.com/satoshilabs/slips/blob/master/slip-0044.md

This list is accepted as standard by many hardware wallet manufacturers and cryptocurrency software developers although it's important to note that there are no consensus rules around it - just compatibility standards between wallet applications.

SO, starting with your BIP39 seed phrase and using BIP32 derivation you can compute the first Bitcoin receive address for account 0 at this BIP44 path:

m/44'/0'/0'/0/0

Similarly, your first Ethereum private key will be computed from this path:

m/44'/60'/0'/0/0

That's how the keys for different currencies are all derived from the same single source of entropy.

The reason Ledger has this concept of "apps" is that many of these altcoins do not use the same signature scheme or transaction message digest as Bitcoin. So although the series of private keys for each currency can be computed arbitrarily by the device itself, once you have the key you need additional software for each use case to instruct the device what to do with that key.


Can't send the funds - encryption password forgotten. Copay I know my 12 word phrase but can't remember the encryption password. What is the procedure to recover the wallet? How many times can I insert the encryption password wrong before my account gets blocked? I've got several passwords which I'd like to test.

Simply delete the app, choose "import wallet", and you're fine. This procedure applies to all wallets with seeds. There are no limits, remember that Bitcoin's motto is "Be your own bank"

Or, just look for the "import wallet" button.


Without using something like Bitcoin Script, how NEM verify the transaction? From NEM's thread in bitcointalk, it mentions:

  NEM doesn’t use so-called “scripts” aka predicates.

I understand how Bitcoin use the script to verify the transaction. May I know where I can read how NEM is going to verify the transaction in detail, without using the script?

NEM uses some servers as the transaction validators called NIS. User signs the code and then the signed byte is sent over the network which is received and processed by the other servers. If you are not a server then all you need to do is to sign the transaction and send it to the severs and that is why NEM doesn't need a similar script language like bitcoin. However servers should have a complicated mechanism and code to verify transactions.

You can check NEM servers here and anyone with the server software running can be a server.

This creates a server-client architecture which eliminates some processes from the clients.

Resource: Makoto, a NEM core developer


Could someone explain how the TX operation here works? I know this is a BCH address, but it's the best example I could find. The same concept holds for BTC, so understanding what's going on is relevant.

https://explorer.bitcoin.com/bch/tx/5d0af59f43f8e8388839518243c743279e7c3dd526385fcc5bbcd907cd61bd2a

What one sees is one transactions with two inputs and two outputs.

How does it happen that there are multiple inputs/outputs in a transaction?
How did 12WsyKG89bxTGWV1iguxPWh6UX2ye1X8hD end up with 208.448 and 18Q43boBRU8Sk57SjSfjgFbjvXhBccBrKq with 18.816 - where in that transactional data does it specify which address gets what from the inputs?

Multiple outputs are usual, just like e-mail.
If one of your friends has sent you 5 BTC, and another friend has sent you 2 BTC, you should combine and spend them if you need to buy something for less than 7 BTC and greater than 5 BTC.

(By the way, do you know what a change is?)

There is no "This output gets its value from this input" All input values are summed, then spent.


how do I figure out the hash rate of my computer? My computer has

   AMD A4-5300 APU W/ Radeon(tm)HD  subscore 6.2
   Graphics AMD Radeon HD 7480D              4.7

If any one can help , thank you!

Bitminter has a Java test that, among other things, can give you an idea of your hash rate.


Bitcoin Client API-RPC: Efficient way to list transactions from a list of addresses In the API CallList:
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

You can pass an address as a parameter to "listtransactions" to get the latest list of transactions from an address. What if I would like to get the most recent 25 transactions from a list of 20 addresses. Does this mean I have to make the "listtransactions" call 20 times and then sort the end results?

Calling the API endpoint 20 times is fine, my problem is that if we needed to do pagination that will become very unmanageable very quickly, because it is really hard to determine what is transactions 26-50 from 20 different addresses

Thank you

EDIT:
I found that BlockchainInfo offers a very convenient endpoint for this:

https://blockchain.info/api/blockchain_api

Endpoint: http://blockchain.info/multiaddr?active=$address|$address (Multiple addresses divided by |)
However, this only returns "txs":[--Latest 50 Transactions--]
and, this does not allow you to do an offset (for example, to get transaction 51-100)

The most efficient way to get a list of transactions from multiple addresses is to store every wallet transaction in a database locally, something like MySQL or MongoDB, and then run your queries on that database.

You can sync your local database with the Bitcoin wallet via RPC by periodically calling listsinceblock() and keeping track of the last block or by running the client with the optional -walletnotify parameter to run a script to notify your database of new transactions.

Be careful with -walletnotify however. It will be called twice for every transaction and if you have a lot of transactions, it can happen a lot. So make sure the command -walletnotify calls doesn't use a lot of CPU/RAM.


What is the relationship between hash rate and accepted shares? Specifically this question is about Litecoin, but I suspect the answer would apply to both.

Say you have a rig mining at 700Kh/s (LTC). It seems that you get, more or less, a one or a few accepted shares per second.

My understanding is that when mining, you're iterating through 0 to ~ 4 billion for your nonce. One of those nonce's is the number you're looking for and will result in an accepted share.

On average, you'd expect to solve for the correct nonce in about 2 billion tries. But, if you're only mining at 700Kh/s, the math doesn't add up. If you're only trying 700,000 nonces per second, it will take about 45 minutes to find the right nonce.

What am I missing here?

There really isn't one when you are pool mining. Most pools these days use VarDiff to achieve the same number of shares per minute by changing your workers difficulty. Now, on a low end mining rig (lets say 20 kh/s) the number of shares accepted may vary greatly as you may have some great luck with your share or it may be bad luck. So as long as you have a "sane" level of hashing power you shouldn't see (m)any trends/changes (as long as the pool+VarDiff is properly set up).

That being said, when you are first connecting to VarDiff enabled pools you will start at a diff of 1, then it will adjust over a period of time to achieve a share per minute rate that was defined by the pool op.

Source: Me, I'm a pool-op

EDIT
At one time, the number of shares you submitted directly related to your hashrate, the more accepted shares, the faster you were hashing. AsicMiner products still use the protocol originally used by pools (and bitcoind) called "getwork". Most notable of the pool servers used at that time is pushpool.

With VarDiff you don't have the ability to calculate by the number of shares submitted. So you now calculate the hashrate based on the difficulty of the share submitted. I personally have found that when the hashrate calculation based purely on the number of shares submitted is slightly weighed in with your hashrate calculation based on the difficulty of the share submitted, the user's hashrate you calculate is more accurate than you would have if you calculated the hashrate purely on the difficulty of the submitted share.


Why does anyone use MtGox? Why would anyone buy BTC using MtGox when the price is so much higher than other exchanges (e.g. CoinBase)?  And why would anyone sell using MtGox if you have to wait an outrageous amount of time to withdraw the USD?  In other words why is MtGox getting any business at all?

The sole and only reason to buy there, is because you already have fiat stuck there and you want to get it out ASAP.

About selling, if you are optimist you can say that some people value that the risk of Mt.Gox defaulting plus the time they have to wait without their money is less than the price difference with the other exchanges.

If you are pessimist, you could say instead that they are simply stupid and do random things without really thinking about it.

Still, since there's no reason at all to send fiat there to buy BTC, yes, I agree it makes no sense for Mt.Gox to be still in business.


Why is a Payment Protocol Acknowledgement message not signed? The Payment Protocol (BIP 70) describes three messages passed between a payer and payee. The last one is an acknowledgement message sent by the payee.

This discussion talks about the acknowledgement being used as a receipt. In the event of a dispute, the payer can show the payee this receipt to prove payment.

However, unlike the payment request message, the acknowledgement message isn't signed. I may be missing something, but this looks like a weak form of receipt without a signature.

Although the acknowledgement attaches the payment message, the payment message doesn't reference the original payment request, which is the only message with a signature.

It seems like a signed acknowledgement message would provide strong proof of purchase, and would be very valuable from the perspective of consumer protection. Why wasn't this included in BIP 70?

This discussion talks about the acknowledgement being used as a receipt. In the event of a dispute, the payer can show the payee this receipt to prove payment.

I don't think it says that. Quote:

  When a payment request is signed it's not just the addresses. The memo is also signed. By keeping around the signed payment request, and the transactions you created to satisfy it, you obtain a mathematical proof of payment. The merchant cannot dispute what was paid for because the memo field contains a description, nor can they dispute that payment was delivered (unless they claim they lost control of their private keys, of course).

So, when going to dispute resolution, the buyer shows the signed PaymentRequest, which includes one or more Outputs, and shows a transaction to those outputs.

  It seems like a signed acknowledgement message would provide strong proof of purchase, and would be very valuable from the perspective of consumer protection. Why wasn't this included in BIP 70?

Well, the server isn't required to provide a signed acknowledgement. It could just terminate the connection after the Payment was received. At that point, you'd be in exactly the same boat.


How much time does it take to transfer BTC into btc-e hosted wallet? If i'm buying BTC in person from someone and he sends it to my btc-e hosted wallet, how much time does it usually take to appear in the account balance? Is it like any regular transfer or are they doing some extra confirmations? Thanks!

BTC-e waits for three confirmations, and then takes a minute or two more.

In my experience, it took 12 minutes. YMMV.

This is documented on the BTC-e website. Login, then click on 'finances', then click on the 'deposit' button on the BTC row.

The minimum incoming transfer is 0.0001BTC.  I don't know what happens if you transfer a smaller amount.


Publicly destroying bitcoins by setting high transaction fees I’ve been thinking about a system that allows you to publicly destroy bitcoins to let people build networks with some protection against Sybil attacks other than the difficulty of getting IPv4 addresses. As an alternative to destroying the coins, I’ve been thinking of giving all but one satoshi to the node that includes the transaction into a block. I mean, as long as you don’t control more than 10% of the network, it won’t really change how much it costs you to “destroy” coins.

Here’s the problem: Suppose a node creates one of these transactions, but doesn’t broadcast it. Instead, they wait until they manage to include it into a block, then broadcast the block. Even if they only control 0.1% of hashing power, they can find the block in about a week.

I can’t think of a good solution to this. Can you?

There can be no solution.

Even if you managed to solve the "allowing only nodes with %<X problem" (and I doubt it is feasible), you wouldn't solve anything, since one single person can create two small nodes, but he is actually owner of both (i.e. controls a combined hashpower).


How to find Values N and K given R,S and Z in ECDSA? How to find Value N and K ? I have the values for R, S and Z.

for example these:

BigInteger R =("00d47ce4c025c35ec440bc81d99834a624875161a26bf56ef7fdc0f5d52f843ad1"));
BigInteger S =("0044e1ff2dfd8102cf7a47c21d5c9fd5701610d04953c6836596b4fe9dd2f53e3e"));
BigInteger Z =("00c0e2d0a89a348de88fda08211c70d1d7e52ccef2eb9459911bf977d587784c6e"));
BigInteger X  =("00c477f9f65c22cce20657faa5b2d1d8122336f851a508a1ed04e479c34985bf96"));

Now, how to get these:

BigInteger K =("007a1a7e52797fc8caaa435d2a4dace39158504bf204fbe19f14dbb427faee50ae"));
BigInteger N =("00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141"));

How to get the values K and N ?
I am confused about how to calculate it, can somebody tell me how it is done?

k and n are not values that you calculate. k is randomly generated while n is predefined by the curve parameters.

n is the order of the curve G. It is defined by the curve parameters for the secp256k1 curve which are defined here: http://www.secg.org/sec2-v2.pdf. In those parameters, n = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141.

k is a randomly generated integer that is used only once for a signature. It is known as the nonce and acts as a source of randomness. If the same k is used to sign two different messages with the same private key, the private key will be leaked.


Why is bitcoind so slow on VPSs? Sometimes it takes bitcoind more than a minute to respond to basic RPC calls such as getbalance (and on average, it takes at least 5 seconds), even though the "STAT" according to the Linux 'ps' program remains "SLl" (Sleeping!). I've confirmed I was looking at the RPC server process and not the client process. How is this even reasonable?

It shouldn't be possible to run large-scale sites like Mt. Gox with those kind of response times. What special considerations need to be taken into account to get performance out of bitcoind?

bitcoind is often very slow when running over a remote disks (such as on a VPS), especially if that disk is slow.  Check the load of incoming transactions in debug.log, which lock cs_main during processing (which the RPC thread does as well).  If you have the memory, try tmpfs, or increase the bdb cache.


is the chain code considered secret? I'm confused by a statement in https://bitcoin.org/en/developer-guide#hardened-keys

  "For this reason, the chain code part of an extended public key should
  be better secured than standard public keys"

I'm confused because I thought the chain code was an intrinsic and easily deciphered part of an extended public key.  For example the top answer here explains how to derive the chain code from any extended public key:

Key derivation in HD wallets using the extended private key vs hardened derivation

So how exactly is one supposed to obey the advice from bitcoin.org to "secure" this chain code when it's openly exposed in the public key itself?  Does a "hardened" public key not likewise expose its chain code?

The idea is that you shouldn't reveal the extended public key (and thus the chaincode) unless you want people to be able to know all of your addresses and potentially recover the extended private key. It should be considered semi-secret; more secret than just the public key itself, but less secret than the private key.

Knowing the extended public key allows someone to know what all of your addresses are, so you lose security. But it does not allow them to know the private keys except in certain circumstances. Because of the extended private key could be derived from the extended public key, you shouldn't give out the extended public key.

However there are few use cases where others do need to know the extended public key, and if you avoid the insecure case, it is safe and secure to reveal the extended public key. You just need to be extra careful in the future to avoid revealing a child key.


How frequently should one update wallet backup? How frequently should one update a wallet.dat file backup?

The Bitcoin-Qt/bitcoind client's keypool has by default 100 Bitcoin addresses.  Each spend transaction that has change chews up one of those addresses.  Additionally each click on New Address will consume an address from the keypool as well.  So you should be able to get by without a new backup until after 100 spend transactions plus any requests for a New Address.

So if you do 10 spend transactions a month, and receive funds 5 times a month  you would be fine with a backup every 4 months maybe.

A backup plan should consider that backups fail, so multiple backups don't hurt anything.

The size of the keypool can be configured so that frequent use can occur without having to make backups as frequently.  For instance, weekly backups would be fine for a wallet that does 100 transactions a week but the keypool has size of 250.

When the wallet is encrypted, no keys are added to the pool until an action that requires the passphrase to be entered. Backup strategy should take this into account.

And finally, if you import a private key, that key will not exist in any previously made backups.


Add a transaction generated offline to the official client I have a transaction that I generated/signed using a custom tool.  I'd like to make sure it was generated correctly by submitting it to the official client and watching the logs to see if it is accepted.

What is the best way to manually submit a transaction to the official client (either json or binary)?  Thanks!

In version 0.7 you will be able to send it to bitcoind through a "sendrawtransaction" JSON API call.


Windows trading software Is there any advanced trading software available for windows platform? I came across goxtool, which is pretty much what I'd like to try, but runs only on linux.

I am looking for a client that offers more than just simple buy/sell orders - I don't mind if coding is involved (python, matlab, c++, whatever), I'd like to experiment with custom trading bots in small amounts of BTC.

You could probably run goxtool in Python under Cygwin, since that would give you a terminal.  I'm not sure if that's the only Linux-specific thing it'd need, but it'd probably be a start.


Difference between crypto coin vs crypto block? I have several doubts about cryptocurrency when I started(bitcoin) reading about it. I google it around and it only added to more confusion.

I am not able to understand the difference between a bitcoin transaction block and a bitcoin as a coin. Aren't bitcoin currency also a bitcoin transaction block in case of a newly minted bitcoin?

Bitcoins are mined after solving cryptographic puzzles, but in the initial days did the author(s) had to create lot of unnecessary transaction to solve the puzzles to create new coins until the general public picked it up? (Or how did they create currencies without any transactions in initial days)

I hope the questions are clear. Do let me know if it needs more editing/clarifications.

I am not able to understand the difference between a bitcoin
transaction block and a bitcoin as a coin. Aren't bitcoin currency
also a bitcoin transaction block in case of a newly minted bitcoin?

A bitcoin block contains the most recent transactions, i.e. Person A sends Person B 10 bitcoins. It works like an old fashioned record book, where all the transactions are written out.
The first record in a next block is a transaction that awards the winning miner (who completed the previous block) the newly minted bitcoins.

Bitcoins are mined after solving cryptographic puzzles, but in the
initial days did the author(s) had to create lot of unnecessary
transaction to solve the puzzles to create new coins until the general
public picked it up (Or how did they create currencies without any
transactions in initial days)?

The initial block does not contain any transactions, it only contains the reward to the miner of this block. The first block is also called the Genesis block.
Watch this video ("But how does bitcoin actually work?" from 3Blue1Brown), it explains it really well with more details.


python bitcoin public key to address code error import hashlib

b58chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def hex_open_key_to_hex_hesh160(hex_open_key):
h160 = hashlib.new('ripemd160')
h160.update(hashlib.sha256(('04'+hex_open_key).decode('hex')).hexdigest().decode('hex'))
return h160.hexdigest()

def hex_hesh160_to_hex_addr_v0(hex_hesh160):
return '00'+hex_hesh160+hashlib.sha256(hashlib.sha256(('00'+hex_hesh160).decode('hex')).hexdigest().decode('hex')).hexdigest()[0:8]

def hex_addr_v0_to_hex_hesh160(hex_addr_v0):
return hex_addr_v0[2:-8]

def hex_to_base58(hex_data):
base58 = ''
int_data = int(hex_data, 16)
while int_data >= len(b58chars):
    base58 = b58chars[int_data%len(b58chars)] + base58
    int_data = int_data/len(b58chars)
base58 = b58chars[int_data%len(b58chars)] + base58
for i in xrange(len(hex_data)/2):
    if hex_data[i*2:i*2+2] == '00':
        base58 = '1' + base58
    else:
        break
return base58

def base58_to_hex(base58):
hex_data = ''
int_data = 0
for i in xrange(-1, -len(base58)-1, -1):
    int_data += (b58chars.index(base58[i]))*58**(-i-1)
hex_data = hex(int_data)[2:-1]
for i in xrange(len(base58)):
    if base58[i] == '1':
        hex_data = '00' + hex_data
    else:
        break
return hex_data

hex_open_key = '5bd8834885082d9e9775f2084610bea79d2bd7acde2fc28b4dba85b0902ac786ef3a1fa082da527a3a51bcd71104b4e6ef91b62b2e93bcfdbc4ac7c35e9fddb'
print hex_to_base58(hex_hesh160_to_hex_addr_v0(hex_open_key_to_hex_hesh160(hex_open_key)))

above code to get bitcoin public key to address, some public key error happens

private key is 0x5c58d

public key pairs

x =  0x5bd8834885082d9e9775f2084610bea79d2bd7acde2fc28b4dba85b0902ac786L
y1 =  0xef3a1fa082da527a3a51bcd71104b4e6ef91b62b2e93bcfdbc4ac7c35e9fddbL
y2  =  0xf10c5e05f7d25ad85c5ae4328eefb4b19106e49d4d16c430243b5382ca15fe54L

public key x and y1 make an error

5bd8834885082d9e9775f2084610bea79d2bd7acde2fc28b4dba85b0902ac786ef3a1fa082da527a3a51bcd71104b4e6ef91b62b2e93bcfdbc4ac7c35e9fddb

Traceback (most recent call last):
   File "<module3>", line 45, in <module>
   File "<module3>", line 7, in hex_open_key_to_hex_hesh160
   File "C:\Python27\lib\encodings\hex_codec.py", line 42, in hex_decode
   output = binascii.a2b_hex(input)
TypeError: Odd-length string

public key x and y2 no error

5bd8834885082d9e9775f2084610bea79d2bd7acde2fc28b4dba85b0902ac786f10c5e05f7d25ad85c5ae4328eefb4b19106e49d4d16c430243b5382ca15fe54

address
    17MnDMuqhiTnQ1Yc38H2RYdSHkfUq6wmrq

You get the error because the hexstring you provided is 127 characters long. You need to pad with zeroes.

Even if you pad with zeroes 05bd8834885082d9e9775f2084610bea79d2bd7acde2fc28b4dba85b0902ac786ef3a1fa082da527a3a51bcd71104b4e6ef91b62b2e93bcfdbc4ac7c35e9fddb is not a valid public key. It must start with 04.

The coordinates y1, y2 of your public key also do not lie on the Curve. I do not know where you got your key from but it is invalid.

The Public Key corresponding to Private Key 0x5bd8834885082d9e9775f2084610bea79d2bd7acde2fc28b4dba85b0902ac786 is 04b302d50e6afaea3eb3194fced5b12ba45aa170d2d717d5a598511a96187a7a90e8c84b1f57a822bda9ecf111374c9e92fe0d1fb5a192a45790f437828d17f009 and the P2PKH address is 14pFAXD2uQpdpToL5LS4oh1bsSGXnVpA2r


How to utilise more cores when I am cpu mining? This is purely an experiment for fun. This is for litecoins but can bitcoin people help me too :)

I am using litecoinqt to solo cpu mine, on my windows machine. Threads set between 4 and 10, scantime of 99.

My main computer has 4 cpu cores. But I am noticing the same speed as when I use my laptop which has only one cpu core. This makes me think I am not using all the cores on my main computer?

Is there a way to force the miner to use more cores?

Thanks

I don't really know about Litecoin-Qt but for a better result and to configure correctly the numer of threads I recommend you to use a software dedicated to LTC mining.

You can use https://github.com/pooler/cpuminer for only CPU and https://bitcointalk.org/index.php?topic=150331.0 for GPU.

You must have a pool but you can solo mine with the arg '-server' when launchin litecoin-qt.

I know it's more difficult than just use the LiteCoin-Qt miner but it is also more configurable and more efficient.


What's the difference between an ASIC and an FPGA? Which is better for mining? I'm a software guy with only the most basic of hardware training/knowledge so while I understand the basic concepts of ASICs and FPGAs the details are beyond me. What are the primary differences and, more importantly to my purposes, how do those differences play out for bitcoin mining purposes?

I co-founded LargeCoin, Inc., and we really are developing an ASIC for Bitcoin mining. As earlier replies pointed out, the unit cost of ASICs is far lower than FPGAs once you get beyond a few hundred units. The up-front cost of ASIC production varies widely depending on the process you use. On the cheap side, there is so-called "wafer sharing," where your design gets populated on to a wafer with many other designs. Wafer sharing typically uses very old processes that aren't going to deliver the power and density benefits of newer processes. BTW, a "process" refers to a the physical process for making the transistors within the ASIC. Generally a process is referred to by its transistor geometry size - for instance 45nm is a relatively current process.

Next up is "Structured ASICs". A structured ASIC vendor provides an assortment of standard logic components on the bottom layers of the chip. You then add a few metal layers on top of these connecting up the basic components to implement your custom logic. Structured ASICs cost between $100,000 and $500,000 (very approximately) for the first prototypes.

Then there are "standard cell" ASICs, where the chip is designed using standard components that are sort of analogous to software libraries.

And finally, there is "full custom". With a fully custom chip, you are designing everything about the ASIC yourself. The NRE costs for a full custom design is in the millions of dollars typically - particularly if you want to use a modern process.

What process are we using? We're keeping that close to our chest at the moment. However, I can confirm that our detailed modelling at this point indicates we'll be able to mine 250 GHash/s in a single rack of mining units using 5kW of power. When you consider that this represents the computational power of about 400 AMD Radeon 6990 GPUs (which would consume close to 200 kW), you can immediately see the benefit of ASICs for Bitcoin mining.

By the middle of 2012, ASIC mining will be a substantial factor in the Bitcoin economy.


Why does bitcoin use public keys as pseudonyms? Why does bitcoin use public keys as pseudonyms? Is there any reason for that? What are the advantages of using public key as the pseudonyms? Highly appreciate if someone can give me an answer.

More accurately, the pseudonyms most commonly used are addresses, which are derived from public keys (not the longer public keys themselves).

In order for Bitcoin's idea to work, you must have coins that can only be spent by the owner of a given private key. This means that whatever you send to must be tied, in some way, to a public key.

Using arbitrary pseudonyms (e.g. user names) would mean that you'd have to then somehow link the pseudonym to a public key in order to enable public/private key crypto. This would remove the ability to securely create addresses/pseudonyms offline (e.g. before someone could send money to the user name "tdumidu", you'd have to announce in the blockchain that "tdumidu" is owned by public key "a1c...", and include a fee so others have a reason to announce it), reduce anonymity (by encouraging you to reuse pseudonyms), and needlessly bloat the size of the blockchain. It would also create a false sense of security that you're sending to who you think you are (if I take the name "Linus Torvalds" before he does, then it's mine and people might send money thinking they're paying the creator of Linux, not me).

Using a pseudonym that either is, or can be calculated from, the public key removes these problems: the mere act of sending the money also describes, in cryptographically secure detail, who can spend it. As the existence of vanity addresses shows, it also allows a small amount of customization.


How does Nano protect itself from transaction flooding attacks? RaiBlocks transactions do not have fees and are processed instantly, so what protects the nodes from being flooded of tiny transactions?

From the wiki page, each transaction will be required to do around 5 seconds of Proof of Work, which will only require around 1 microsecond to validate. This means that the attacker will waste a large amount of resources while the nodes waste a very small amount.


What is the state of Witcoin? There used to be a forum site called Witcoin. It was interesting in that in order to post, you'd have to pay bitcoins, and when someone replied or upvoted, you made bitcoins.

The site went away.

What is the current state? Are there plans to bring it back? Will there be a chance for users to recover their coins?

Witcoin was written and run by mizerydearia. At some point he became unable to run the site, but he was/is unwilling to give the witcoin database or wallet to anyone else. (Someone else owns the domain name.) Mizerydearia was very intelligent, honest, and active, but it seems likely that he's developed some sort of mental illness (as you'll see if you read his forum posts). It's very sad. Hopefully he'll someday recover enough to run witcoin again or at least refund the BTC.


Querying UTXOs with random key pairs As the number of transactions in the bitcoin network grows, the number of addresses with bitcoin will also grow. Is it possible for someone to “scavenge” for bitcoin by generating random key pairs and checking if the derived bitcoin address has any coins ? Is this likely to be profitable at any time in the future?
Even if the profitability of this attack is low, it could impact confidence in the bitcoin network, if a few bitcoin were stolen in this manner.

Is it possible for someone to “scavenge” for bitcoin by generating random key pairs and checking if the derived bitcoin address has any coins ?

Yes.

  Is this likely to be profitable at any time in the future?

No.

The number of possible addresses is extremely massive, much much too large for the human brain to comprehend.

For starters, there are 2^160 possible P2PKH addresses. Then there are 2^160 possible P2SH addresses. There are also 2^160 possible P2WPKH addresses and 2^256 P2WSH addresses. This means that the current total address space is 3(2^160)+2^256. The probability that you would randomly choose generate an address that has Bitcoin associated with it is so small that it is basically zero.

If we were to assume that 100 billion addresses have Bitcoin associated with them or will be in the future (that's an extremely generous estimate), then the probability that you would be able to find one of those is 8.636 × 10^-67. This probability is so small and so unlikely that it will never be profitable or have any probability of an address collision ever occurring.


Unable to decode input address It seems that some transactions, although having "prev_out" field in their "inputs", does not have "addr" in the "prev_out", i.e. they do not have input address. What is this kind of transactions for?

e.g. transaction hash: 38d4154f800cbbce0ac39772dd88d338424be21ba36ccb6a11110a029e6b5a1e

Yes, this tx has only the signatures in the V_IN part (unlocking script), no public keys directly behind it, or a redeemscript. The V_OUT part (locking script) has a redeemscript for a 2-of-3 multisig. Usually one would expect a redeemscript hash in the pubkeyscript, but here it is the plain hex codes.
So it is an old type multisig (not using P2SH). The unlocking script is the two signatures, and locking script provides the required pubkeys.

So what would happen on the stack:

<sig1>

<sig2>

<redeem script data> ("2" pk1 pk2 pk3 "3" CHECK_MULTISIG)

In a first step the unlocking script is executed, and if valid (results in a TRUE value, or no remaining operators remain on the stack), the tx would be marked as valid. It only pushes data (the signatures), so ok. Then the second step would clear the stack, and sigscript and pubkeyscript would be pushed and executed. As one can see, the three elements on the stack can be resolved to TRUE, and as such it is a simple multisig.
Decoding the pubkeys in the redeem script shows:

5221037BF122821AE522F67B7BC09387C2907607CDD66E6BD67BCB53F39D5346ADC74821033E81519ECF373EA3A5C7E1C051B71A898FB3438C9550E274D980F147EB4D069D21027AA4A8DAFFF9B6307899BB7762BF92C50ABDE14C3636719FFC4D4FABF3DC6B0F53AE

    52: OP_2
    21: OP_Data21 (= decimal 33)
        037BF122821AE522:F67B7BC09387C290
        7607CDD66E6BD67B:CB53F39D5346ADC7
        48
        bitcoin address:   18pvHhDLrGJpJ7SznnoxxFdwPnKCqjqVCj
    21: OP_Data21 (= decimal 33)
        033E81519ECF373E:A3A5C7E1C051B71A
        898FB3438C9550E2:74D980F147EB4D06
        9D
        bitcoin address:   1JXc8zsSeAPwqfAzLbBnZxNTfetZexH2bW
    21: OP_Data21 (= decimal 33)
        027AA4A8DAFFF9B6:307899BB7762BF92
        C50ABDE14C363671:9FFC4D4FABF3DC6B
        0F
        bitcoin address:   1BDp6sR3bHH8ACzbwZccY4y9GohG3KX828
    53: OP_Data53 (= decimal 83)
    AE: OP_CHECKMULTISIG

So just an "old type" multisig transaction.


Mining on Linux with an USB hard-deive I want to mine with my AMD gpu. However I don't want to install the amd sdk on my daily driver operating system because that too much dependencies and external debs for me. I have the idea to install Ubuntu 18.04LTS on a USB (not an installation usb, a real installed operating system). Would it make sense or is it not very efficent ?

That would probably work fine.  Mining doesn't generally require fast disk access, especially if you are mining in a pool.

Of course, you'll have to reboot into your Ubuntu installation each time you want to start mining, and you won't be able to use your "daily" operating system at the same time as mining.


Does running pruning node make the initial sync faster? Does running bitcoind with -prune option make the initial blockchain sync faster or not? I know it makes it smaller on disk, but is it faster?

I keep reading conflicting information online - some state that it is quicker because you need less disk operations, some state it is about the same.

No, pruning will not make the initial sync faster. The information that gets removed by pruning isn't accessed turning the initial sync.

Currently pruning makes the initial sync somewhat slower: more frequent flushes are performed in order to allow pruning to work, and the work of actually deleting things creates its own small slowdown. About the same is probably a fair statement in general.

The only configuration which can substantially speed up the initial sync is increasing the dbcache option.  If you have plenty of memory (e.g. >4GB) making this setting larger can radically reduce the sync time, esp. if your disk is slow. For 8GB ram I recommend setting dbcache=4096 during the initial sync.


Why won't bitcoind work correctly on windows 7? When I go to bitcoind using "bitcoind -daemon" in Windows 7, it won't run in the background. When I type that, it just sits there and does nothing. If I keep it like that and open another command prompt and use eg. "bitcoind getpeerinfo" , it says it can't get a lock on some directory.

What are you expecting it to do?  It is a daemon (server) that is waiting for RPC connections on port 8333.

Your bitcoin.conf needs to have configured the rpcuser and rpcpassword.  Then you can access the bitcoin API.

With Bitcoin-Qt version 0.7 and higher, the Debug window gives you access to run a console, so you don't need to run bitcoind if you are just trying to execute some commands interactively.


Difference between bitcoin-tx, bitcoin-cli, and bitcoind? I just pulled from the bitcoin github and compiled, and noticed that there were three executable generated:

bitcoin-cli  bitcoin-tx   bitcoind

I have not heard of bitcoin-tx before, what is it? What are the main similarities/differences between these three executables?

In addition, I would be interested to find out if there are any plans to further develop these into different, complementary, executables.

Thank you!


How to store a bit coin on my account? Can anyone tell me how bit coins are stored on my account?

I had a bit coin account long ago and not sure what happened? Can anyone explain in simple words what a bit coin account has? Is it a key ... I am totally confused about it after reading the bitcoin.org website.

My specific question are,

can we have a bit coin account like email account where I can store my transactions.
can I start stop this account wherever I am, say on my pc, on my laptop, on mobile or on an other PC.?
How to identify my account? what is the scope of portability?

Your bitcoins belong to an 'account' that can only be accessed by using a private key, which is in your wallet. You can have copies of that private key/wallet in many places. They all access the same account.

I like to think of it this way... The bitcoin network is like a massive bank full of billions, trillions, and so on of vaults. You can put coins into any vault without needing a key to that vault. You can only take coins out of a vault IF you have a key to that vault (your wallet). Your coins are never stored on your actually computer. Only the KEY to the vault is stored on your computer. That key is used to access your coins. Downloading the blockchain is simply a way of letting your bitcoin client know how many coins you have, who you sent coins to, and who sent coins to you. Its like a virtual copy of those billions of vaults, which mostly all you don't have access to. Only that vault whose key you possess. Good luck!


How do you calculate fees with bitcoind? Here is the transaction id as an example, please help me calculate using bitcoind: 10ff046cb00483c4b4222fe3d1798b98d5a17af55ff7fc0a6e1e2398b86c13bd

Fees are the difference between the total inputs and the total outputs.

To retrieve the total out: Let’s make a getrawtransaction request with this transaction id, and add all the "vout" values together to get the total.

The request will look like this (use "1" at the end to return JSON):

  bitcoin-cli getrawtransaction
  10ff046cb00483c4b4222fe3d1798b98d5a17af55ff7fc0a6e1e2398b86c13bd 1

In this example there is only 1 output:

  "vout": [
    {
      "value": 3.60555045,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 ccc497f13cf4c598201e4b12353649be44172b01 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914ccc497f13cf4c598201e4b12353649be44172b0188ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "1KfiMh5SDTYBGrDDHfSegrHkkWZQ2mSXtP"
        ]
      }
    }   ], ...

To retrieve the total input: We need make an additional request for each input to get the input values. So in this example there is one input:

  "vin": [
    {
      "txid": "b13b4765e46228f3239858c9f18e766b72bed24a56c52b9692e7f021c376e7ce",
      "vout": 1,
      "scriptSig": {
        "asm": "3044022044ca9b69f8c14eccd400be62a5320c8938aee176033c91f4cb17f57b14a20de402206e520a6398b01467772395557415bde2b7879e0e554eb6306718aa81fae5247d[ALL] 0373b9e8c6bd75e3029c00d629baff141895a4444d55894d48f0426842608d8e4d",
        "hex": "473044022044ca9b69f8c14eccd400be62a5320c8938aee176033c91f4cb17f57b14a20de402206e520a6398b01467772395557415bde2b7879e0e554eb6306718aa81fae5247d01210373b9e8c6bd75e3029c00d629baff141895a4444d55894d48f0426842608d8e4d"
      },
      "sequence": 4294967295
    }
  ],
...

We are interested in the "txid" and "vout". We need to make an additional getrawtransaction request for this id, and look at the value of the 2nd ouput (since vout is 1). That output is here:

{
  "value": 3.61007045,
  "n": 1,
  "scriptPubKey": {
    "asm": "OP_DUP OP_HASH160 02952d768c840f30a49e20af5bd4219210a14d24 OP_EQUALVERIFY OP_CHECKSIG",
    "hex": "76a91402952d768c840f30a49e20af5bd4219210a14d2488ac",
    "reqSigs": 1,
    "type": "pubkeyhash",
    "addresses": [
      "1Ef4RcUBZfrFyoVxZeU7tH5dRd9SXcJHN"
    ]
  }
}

Now we can subtract the total inputs from the total outputs to get the fees: 3.61007045 - 3.60555045 = 0.00452 in fees


For the 3 bitcoin address types, which can send to each other? Can a valid tx be created that spends to an unspendable address? I'm just getting started with using bech32 addresses instead of legacy addresses, and I'm not familiar with how the legacy vs segwit compatible vs bech32 addresses play with each other.

Can I get an explanation or 3x3 square for the 3 address types on what can send to what, what would be lost forever, if any, and what the error messages or problem with sending from one to another would be?

(I'm interested in the deep dive, but probably just a description on how to avoid losing any coins would be most helpful.

If I give my friend a bech32 address, I want to make sure that when he sends to it, the worst case is that he gets an error. Is there any extra care I need to take, or is that how it generally works now?)

What you can spend, and what you can send to depends on the wallet software and nothing else.

There are no inherent restrictions on any combination.

In case someone uses old software, they may not be able to send to bech32 addresses. But they'll get an error that the software doesn't recognize the address; no funds will be lost.


Sending Cross Currency in Ripple I have been facing this issue for a while using Ripple JSON RPC, am actually working on a PoC for cross border transaction, as part of my use cases, I need to send transaction in NGN and be received in USD/EUR.

I have read your David Schwartz response here https://forum.ripple.com/viewtopic.php?f=2&t=15980 and here https://forum.ripple.com/viewtopic.php?f=2&t=8079 but still having issues with the transaction

Here is my request

{
    "method": "submit",
    "params": [
        {
            "offline": false,
            "secret": "sssssssssssssssssssssss",
            "tx_json": {
                "SendMax" : { "currency" : "USD",
                 "value" : "200",
                 "issuer" : "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc"
                },
                "Account": "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc",
                "Amount":{
                  "value": "100",
                  "issuer": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj",
                  "currency": "NGN"
                },
                "Destination": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj",
                "TransactionType": "Payment"
            },
            "fee_mult_max": 10000
        }
    ]
}

and I got this as my response

{
  "result": {
    "engine_result": "tecPATH_PARTIAL",
    "engine_result_code": 101,
    "engine_result_message": "Path could not send full amount.",
    "status": "success",
    "tx_blob": "1200002280000000240000005661D5038D7EA4C680000000000000000000000000004E474E0000000000CD2B28791E0BEB754A75AF8DB99BDEF21DD8D4A968400000000000000A69D5071AFD498D000000000000000000000000000055534400000000007A04D90FD6B8D1400B5CD796391444090AF06C1F7321031810282977B92281325F0AC5DAF4AB7EDB3FBBE5404A38D657E327B1A46B7897744730450221008269F1C23E2C719A73F7F41D484C0577C1EBF496D8BD6009AA975A852C627E7202207FBD5CBA3EF5F5BE7696FAF5C45F2E22BDCEA7FD48BA99D75897BF58C474BD0D81147A04D90FD6B8D1400B5CD796391444090AF06C1F8314CD2B28791E0BEB754A75AF8DB99BDEF21DD8D4A9",
    "tx_json": {
      "Account": "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc",
      "Amount": {
        "currency": "NGN",
        "issuer": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj",
        "value": "100"
      },
      "Destination": "rK6qNr9HV62gJPRvKGNen1qHi2LYyHSDvj",
      "Fee": "10",
      "Flags": 2147483648,
      "SendMax": {
        "currency": "USD",
        "issuer": "rU3BENzHa5SeB2HnwzovG5wdk7v8ChxXrc",
        "value": "200"
      },
      "Sequence": 86,
      "SigningPubKey": "031810282977B92281325F0AC5DAF4AB7EDB3FBBE5404A38D657E327B1A46B7897",
      "TransactionType": "Payment",
      "TxnSignature": "30450221008269F1C23E2C719A73F7F41D484C0577C1EBF496D8BD6009AA975A852C627E7202207FBD5CBA3EF5F5BE7696FAF5C45F2E22BDCEA7FD48BA99D75897BF58C474BD0D",
      "hash": "A658DE84ABFED32E0E52FBF02E60FBC81E32C5E6186427C33AEBD938188FE4BB"
    }
  }
}

I understand that tecPATH_PARTIAL means that the transaction failed because the provided paths did not have enough liquidity to send the full amount.

But I did not specify the path bcos I understand it's best when ripple choose the path.

I will appreciate any help in right direction

https://bitcoin.stackexchange.com/users/85/david-schwartz

So, after many days I was able to solve this problem. I was able to send transaction from one customer having (NGN) to another Customer who received it in (USD).

For others who may likely face similar problem in the future, this are the steps I took to solve this problem.

Step 1

I created offers for all the currencies. see example request and response below

{
  "method": "submit",
  "params": [
    {
      "offline": false,
      "secret": "snYothV5CFDMpMYStmL5VwMHzxHFr",
      "fee_mult_max": 1000,
      "tx_json": {
        "TakerGets": {
          "currency": "EUR",
          "value": "0.94",
          "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk"
        },
        "TakerPays": {
          "currency": "USD",
          "value": "1",
          "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ"
        },
        "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
        "TransactionType": "OfferCreate",
        "Fee": "12",
        "Flags": "65536"
      }
    }
  ]
}

and sample response

{
  "result": {
    "engine_result": "tesSUCCESS",
    "engine_result_code": 0,
    "engine_result_message": "The transaction was applied. Only final in a validated ledger.",
    "status": "success",
    "tx_blob": "1200072200010000240000001764D4838D7EA4C68000000000000000000000000000555344000000000045249D498FF76EF67DACD0958930DB02EE4A9D4465D46165400CE380000000000000000000000000004555520000000000C260B3831882A44608EE81C2F3726AA72D11CA9568400000000000000C732102272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A6542674473045022100CD7511B302ED7D0C299C0F2C1014EA5AA62F7584B361B940C0E8A98FBA04EDE10220047590E7A678818000B5B221EBBC3D21AB1FCE5C003F8F02AAC41F96D054F90A8114C260B3831882A44608EE81C2F3726AA72D11CA95",
    "tx_json": {
      "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
      "Fee": "12",
      "Flags": 65536,
      "Sequence": 23,
      "SigningPubKey": "02272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A65426",
      "TakerGets": {
        "currency": "EUR",
        "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
        "value": "0.94"
      },
      "TakerPays": {
        "currency": "USD",
        "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ",
        "value": "1"
      },
      "TransactionType": "OfferCreate",
      "TxnSignature": "3045022100CD7511B302ED7D0C299C0F2C1014EA5AA62F7584B361B940C0E8A98FBA04EDE10220047590E7A678818000B5B221EBBC3D21AB1FCE5C003F8F02AAC41F96D054F90A",
      "hash": "C35F98185CEBD03EEBCBDB6BB4364288DD8A0EDCF6FE137E9E3950524353AC8B"
    }
  }
}

Step 2
I Did a find path to get the path to use in sending the transaction, based on the offers earlier created in step 1

{
  "method": "ripple_path_find",
  "params": [
    {
      "source_account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ",
      "source_currencies": [
        {
          "currency": "XRP"
        },
        {
          "currency": "USD"
        }
      ],
      "destination_amount": {
        "currency": "NGN",
        "value": "305",
        "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD"
      },
      "destination_account": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ",
      "SendMax": {
        "currency": "USD",
        "value": "1",
        "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ"
      }
    }
  ]
}

Sample Response

{
  "result": {
    "alternatives": [
      {
        "paths_canonical": [],
        "paths_computed": [
          [
            {
              "account": "rntHFZfVgoCeBNYDxSejkPewViFow1Sz6r",
              "type": 1,
              "type_hex": "0000000000000001"
            },
            {
              "account": "rJHPyhod8HuZhps6Gerf7t3yLfinpVLXNT",
              "type": 1,
              "type_hex": "0000000000000001"
            },
            {
              "currency": "NGN",
              "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD",
              "type": 48,
              "type_hex": "0000000000000030"
            }
          ],
          [
            {
              "currency": "EUR",
              "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
              "type": 48,
              "type_hex": "0000000000000030"
            },
            {
              "currency": "NGN",
              "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD",
              "type": 48,
              "type_hex": "0000000000000030"
            }
          ]
        ],
        "source_amount": {
          "currency": "USD",
          "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ",
          "value": "1"
        }
      }
    ],
    "destination_account": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ",
    "destination_amount": {
      "currency": "NGN",
      "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD",
      "value": "305"
    },
    "destination_currencies": [
      "NGN",
      "XRP"
    ],
    "full_reply": true,
    "ledger_current_index": 3,
    "source_account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ",
    "status": "success",
    "validated": false
  }
}

Step 3
I used one of the paths returned in the response from above to send payment request.

Sample Request

{
  "method": "submit",
  "params": [
    {
      "offline": false,
      "secret": "sn1GPS42vNZXg6GYrsSXxYv2VrbkG",
      "fee_mult_max": 100000,
      "tx_json": {
        "Amount": {
          "currency": "NGN",
          "value": "305",
          "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD"
        },
        "Account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ",
        "Destination": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ",
        "TransactionType": "Payment",
        "Fee": "10",
        "Flags": "0",
        "Paths": [
          [
            {
              "type_hex": "0000000000000030",
              "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
              "type": "48",
              "currency": "EUR"
            },
            {
              "type_hex": "0000000000000030",
              "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD",
              "type": "48",
              "currency": "NGN"
            }
          ]
        ],
        "SendMax": {
          "currency": "USD",
          "value": "1",
          "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ"
        }
      }
    }
  ]
}

Sample Response

{
  "result": {
    "engine_result": "tesSUCCESS",
    "engine_result_code": 0,
    "engine_result_message": "The transaction was applied. Only final in a validated ledger.",
    "status": "success",
    "tx_blob": "1200002200000000240000000461D50AD5F57690A0000000000000000000000000004E474E00000000009B0C47828166D6258E8E7F0AA3B464FEA9C17E6668400000000000000A69D4838D7EA4C68000000000000000000000000000555344000000000045249D498FF76EF67DACD0958930DB02EE4A9D4473210336DF52033C6AE8F955A8AE89CE32793C0DB54A3DA2477A0F769EA9A4320D754D74463044022019DBE3D2C7ADF58AD35F1924889B8612EC46E8421492BDC591D50EEABCBC0BA9022046F9D34D8DAF24698B3B5A973AB575E5901A1C14EB80E8ABDC25B0D8010F0983811445249D498FF76EF67DACD0958930DB02EE4A9D4483146757FA04E0212B971F7F76E3E4A85A1B280EAE770112300000000000000000000000004555520000000000C260B3831882A44608EE81C2F3726AA72D11CA95300000000000000000000000004E474E00000000009B0C47828166D6258E8E7F0AA3B464FEA9C17E6600",
    "tx_json": {
      "Account": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ",
      "Amount": {
        "currency": "NGN",
        "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD",
        "value": "305"
      },
      "Destination": "rwRRz7yt7GXe2NjZjB9ruLs7r71fi1WNpQ",
      "Fee": "10",
      "Flags": 0,
      "Paths": [
        [
          {
            "currency": "EUR",
            "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
            "type": 48,
            "type_hex": "0000000000000030"
          },
          {
            "currency": "NGN",
            "issuer": "rE3FSvB4Q59WZUXcDyB8tgAFBTZMwCJ1FD",
            "type": 48,
            "type_hex": "0000000000000030"
          }
        ]
      ],
      "SendMax": {
        "currency": "USD",
        "issuer": "rfJbVE7tTrkbmuqTBvhdYDRExp9oamTzrQ",
        "value": "1"
      },
      "Sequence": 4,
      "SigningPubKey": "0336DF52033C6AE8F955A8AE89CE32793C0DB54A3DA2477A0F769EA9A4320D754D",
      "TransactionType": "Payment",
      "TxnSignature": "3044022019DBE3D2C7ADF58AD35F1924889B8612EC46E8421492BDC591D50EEABCBC0BA9022046F9D34D8DAF24698B3B5A973AB575E5901A1C14EB80E8ABDC25B0D8010F0983",
      "hash": "58906C7DEFCF60ED6AC55A646BE3BF50E32F7B633AC6CD62E1AA6799888AA5EA"
    }
  }
}


What Bitcoin Mixing/Laundry Services are availble today? A Bitcoin Laundry or Mixing Service is a service that accepts BTC payments, and returns the same BTC amount, only from coins that are unassociated to the original BTC. It is a privacy service that works well if it has massive usage.

What are some good mixing services? Is there any data on how well they actually anonymize (e.g. what size are their "stashes" or user base (bigger stash = bigger anonymity)?

The only one I'm currently aware of is "Bitcoin Laundry" operated by Mike Gogulski. They charge a 4.555% commission rate and do little more than accept a payment then re-send a payment. There is also (according to the Wiki) that the service is only lightly used and might not be adequate to provide any real anonymity. You might be better sending then withdrawing coins at Mt Gox with a decent delay between transactions - the sheer volume of Mt Gox's transactions as well as the size of their wallet would make them much more effective and there's nothing I'm aware of to stop you from creating an account with a throwaway email address and accessing Mt Gox through TOR/I2P/etc.


How can i sync only the last month of the blockchain with bitcoin core? Anyone have any idea how can i do with bitcoin core.

Thanks in advance.

You can do that with Bitcoin-core but it's not recommended, You may want to use electrum instead of Bitcoin-core.

You don't have to download the blockchain using electrum.org.


Locating bitcoin from 2009 In late 2009 maybe early very early of 2010 I was living at my parents and tryi to find a way to make money online.  It was all fairly new back then.  I remember looking at some computer coders site that spoke of stuff I didn’t understand when I found where someone was giving 25 bucks to download and run a program. I don’t recall if I clicked on a link, copied and pasted into browser. Idk. I do know that when I ran it it asked if I wanted to run it in the background. I chose yes.  And after it was all there the 25 was a huge number of bitcoin. The equivalent to 25 dollars worth of bitcoin back then.  I seen that and got irritated.  Mom told me to at least finish what I was doing.  So I did.
Later dad is annoyed at a program running that he couldn’t find.
He changed hard drives.
So years later I ask dad and yes he still has the hard drive.
The only thing I can find is where I copied and pasted the url into a folder.
But the url says bitcoin/stack.exchange or something like that followed by some characters.
Bitcoin stack exchange didn’t form for a few years yet.
Did the stack exchange have links or something to complete a bitcoin trade back then?
Does anyone remember back then how The word about bitcoin was spread? Oh and I do remember seeing peer to peer in something I was reading about the download I’d just done and I remember satoshi or something maybe even longer that began with satoshi

This sort of question comes up moderately often.
Bitcoin.stackexchange.com is a self-help Q&A website and has never provided Bitcoin wallets or acted as a custodian of money or as a register of Bitcoin accounts. It has always been no more than a place where people like you and I can answer other people's questions.
You need to do one of the following:

Find a file named wallet.dat. Find or remember any password you might have used to protect the wallet.
Find a piece of paper where you wrote a "private key" - a string of letters and digits similar in length to E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262.

Without something more definite than you wrote above, your $25 is lost forever.

Similar questions (not exactly identical) which also have potentially useful answers.

Recovering bitcoins
signed up in 2010-now trying to access
Bitcoin Recovery Email or Hard Drive


Can I use run Bitcoin Core in regtest mode in v0.8.1? I'm trying to run bitcoin-core v0.8.1 in regtest mode, but it doesn't work.
When placing regtest=1 in bitcoin.conf it starts to sync the mainnet.
I've not seen anything related in the code.

So I was wondering if there's any configuration different to run regtest mode in that version different from more recent ones.

When was regtest mode added ?

Regtest mode was introduced in version 0.9.0, via pull request #2632. That is why it doesn't work in 0.8.1, as you noticed. There is no other option to run regtest in that version, although testnet3 is supported by that version so you should still be able to use that if it suits your needs. Otherwise just upgrade to a newer version which will contain performance improvements, bugfixes and newer feature support :)


Why SHOULD the funding tx consume BIP 141 inputs? In BOLT 02 we read that the funding TX should only consume segwit inputs.

  The sender: when creating the funding transaction: SHOULD use only BIP141 (Segregated Witness) inputs.

What is the reason for that? If it was for preventing tx malleability it should be a MUST. Also I thought the inputs that are consumed don't matter for this context.

The following is my humble understanding, I am not an expert in BOLTs.

First, the reason to include this requirement is indeed transaction malleability. If malleable outputs are consumed for the funding transactions, then:

funding_txid may change after the transaction is broadcasted;
checking the status of the tx may fail (funding_locked);
the channel will never be established even though the funding tx is send.

Second, as to why this is a SHOULD instead of a MUST. This has to do with the IETF definition:

  SHOULD   This word, or the adjective "RECOMMENDED", mean that there
  may exist valid reasons in particular circumstances to ignore a
  particular item, but the full implications must be understood and
  carefully weighed before choosing a different course.

SHOULD is not critical to the specifications and some clients may have a reason to ignore this recommendation. For example, I may write a client that does not include on-chain BIP141-only bitcoin wallet and instead connects to an existing one. This will make setup easier and cheaper for some users (no additional on-chain transaction). But I need to understand the implications and handle malleable transactions in case their txid changes.


What is service or entity broadcasts transactions with OP_RETURN data starting with "LP..."? There have been quite a few OP_RETURN transactions recently where OP_RETURN data in the scriptPubKey starts with 4c 50 which is LP as ASCII.

For example these transactions:
 - ccce20a2b4c79d80fe57bd4008c398c548cefc7f353e71044353432f434d8e6a
 - 2d02e75f6f72a1e633e4f1b36066428f1904ca5859bc6a711806961b8b6fbfd3
 - f85a0efd449f193605048b73dd7bb0287c7a331ab92755497b4d77806090849e
 - b193bb721f21e2efc9dcfd9bb8ab8753f9a70f6ff7ce8bbffb0a173a45adf6b0
 - ... and a lot more (6447 in the last two hours at the time of writing this)

Since the first bytes are usually used as an identifier (e.g. omni for OmniLayer) I'd be curious if anybody happens to know where this could originate from.

The starting bytes 4c 50 has nothing to do with ASCII encoding. 0x4c represents opcode OP_PUSHDATA1 which indicates that the next opcode bytes is data to be pushed onto the stack. So in the examples that you have given, 4c 50 will indicate pushing the next 0x50 bytes onto the stack which is 80 bytes in decimal. The question you should have been asking is why the data that has been encoded on the stack for all the transactions that you have listed starts with 00 06 4e


Is there software or a service to let you manage multiple crypto currency exchanges from one interface? There are so many cryptocurrency exchange sites (binance, bittrex, kucoin, poloniex, etc...) these days. Is there a software or service that taps into the API call of all these exchanges to be able to manage trades, deposits, and withdraws from one interface?

check coinpayments API. supports trade(via shapeshift) deposits & withdraws with multiple currencies.


Who wins the race for multiple valid blocks mined at the same time? From my understanding, a SHA256 hash is generated by a miner and if the hash is less than a specific value, it is passed to its peers.  That said, It's possible for multiple hashes to be created at very close to the same time.  If this happens, how is the "winner" determined?  I see this has happened a lot (multiple orphaned blocks).

What can be done by the miner to see that their block wins the race, either honestly or through an attack?  The protocol stipulates that the block shall be recognized by which ever was received first.  Is it advantageous to set up peering with other miners?

When there's a fork, part of the network will mine to find the next block in one branch and part in the other branch. Whichever part finds the next block first will determine the winning branch.

A miner who finds a block will want to spread it widely and quickly. This makes sure there are many other miners who saw his block first, and thus a high probability that the next block will be found by one of those.


What would happen if two miners were mining two blocks with two different set of transactions? If two miners picked from the mempool two different sets of transactions, that were not dependent on each other.

Then could both miners, mine both blocks and not create a fork?

So miner 1 finishes the block and miner two sees that the block had nothing to do with his block, so he continues mining and adds that block onto miner 1s block after about a second?

I am assuming that forks only happen when both blocks mined have transactions that exist in both blocks

No, each block must reference it's predecessor block in the header, and the blockchain has only a single block at each height. The second miner must therefore modify the block template that they are mining with to build on top of the just discovered block. They need to update the hash of the predecessor block and the blockchain height in the Coinbase transaction. Otherwise the block they would be finding would be competing with the just published for inclusion instead of writing forth the blockchain.

The rest of the block template could stay the same, if none of the transactions got included in the blockchain already.

However, your question sounds to me like you're thinking that searching for a block has progress. Mining is a progress-less process, each attempt may or may not succeed independently. Thus, it would be a more profitable strategy for each miner to try including the juiciest transactions (by highest fee rate) and to switch to a new block template whenever a block is published with the new juiciest transactions.


How Bitcoin-Core does decide whether high fee during sendrawtransaction? I am testing commands through Bitcoin testnet and Bitcoin Core.

During the test, I intentionally attempted to create and broadcasts transactions by charging high fees.(1 BTC)

During the final phase, sendrawtransaction blocked the progress with error 256: absurdly-high-fee (code -26)

What exactly is the high fee that Bitcoin Core is talking about? Does this client have exactly fixed number?
Can I broadcast a transaction programmatically without any fee restrictions as intended if I use custom client?
If 2 is possible, can hackers make spamming attacks by setting fees lower than the current minimum limit(0.00001 BTC/kB)?

What exactly is the high fee that Bitcoin Core is talking about? Does this client have exactly fixed number?

Bitcoin Core has a hard limit for what it considers to be an absurdly high fee, which is 0.1. Other node software may not impose this limit, or may have a different value for it.

Note that this is not part of the standard tx rules. It is simply a check to limit the fees for a single transaction.

  Can I broadcast a transaction programmatically without any fee restrictions as intended if I use custom client?

You can remove the fee check from validation.cpp.

  If 2 is possible, can hackers make spamming attacks by setting fees lower than the current minimum limit(0.00001 BTC/kB)?

You can just change the minrelayfee flag to go under the limit. There is no flag to override the high fee parameter, as far as I'm aware.

There are plenty of nodes on the network that will broadcast a high fee tx. Indeed, there have been a few cases of very high fees in the past, such as 13.65 BTC, and even 200 BTC (this one was before the high fee check was added in 2015, though)!


How can I combine all the tiny amounts I've received to minimise transaction fees, and do I need to? Important parts in bold, for those who don't want to read the detail!

I've received lots of tiny transactions, in amounts sometimes as low as 0.000003BTC.
Even though I've also received (relatively) larger amounts, I'm worried that when I want to spend my bitcoins the transaction fees may be very high thanks to the large number of "input" transactions needed to make up the output transaction.

As I understand it, the network has an algorithm for determining minimum transaction fees, and the relationship between number of inputs and required transaction fee is non-linear. This means there is likely some optimum way to combine my inputs. This has already been discussed here and here, but neither question asks how it can be done, and how bad the consequences can be.

It might be best to somehow include as many tiny inputs with a larger input each time I spend a moderate amount, or perhaps it would be better to somehow combine all the tiny inputs in individual batches of some optimum size and send them to myself to prevent future problems.

If I were to combine the tiny amounts, I'd be happy to wait for the newly combined bitcoins to age, so additional fees which would be required by spending young bitcoins won't be a problem.

In most, but not all, cases, my tiny amounts have been received to a dedicated tony-amount address.

For the sake of the question, let's assume I've received 1000 tiny transactions of 0.001BTC each, and another 100 transactions of 0.1BTC each, all in the same wallet. This would give a total balance of 11BTC. Assume all amounts were received 6 months ago.

If I wanted to spend the entire 11BTC at once (with 1100 transaction inputs), how high might the fee be?

If I only spent 1BTC at a time, how high might the fee be?

How can I actually combine the tiny amounts without affecting the larger ones?

I'm running the standard (Satoshi) client, but other clients could be an option.

I have not actually done this, but here is how I understand it. With many tiny amounts, you probably want to consolidate them because the fees for transactions with lots of inputs will be high. Now you ask, by consolidating, won't I just be paying the fees in advance? The answer is that by planning ahead and consolidating them, you can use the low-fee mining pool Eligius to do it.

To estimate the cost of the transaction, I'm going to use only the transaction size (for large transactions, the fee is dominated by or entirely consists of the cost per KB). This is based on the number of inputs and outputs. If all your balances are the same (0.01 BTC), then it doesn't matter how much you spend at at a time, the fee grows linearly with the total BTC amount.

Assuming 180 bytes per input, 1000 inputs comes to 175KB, which I'm going to round up to 200KB for a safety margin. With the official client, at the default 0.01 BTC / KB fee [1], that would cost 2 BTC.

Eligius will mine transactions for a fee of 0.2 TBC (0.00008192 BTC) per KB [2]. So Eligius's fee would be 0.016384 BTC. Might as well round that up to 0.02 BTC or higher just to be sure.

If your coins are old enough (say, 3 months for 10 BTC and a 200KB transaction size) [3], then the official client might not enforce the minimum fee on your transaction. Otherwise you may need to use a modified client that doesn't enforce a minimum fee.

In any case you will need to point your client to Lightfoot Hosting's free transaction relay, which will relay any transaction to the network [2], so it can be picked up by Eligius.

It may take longer than usual, but Eligius should eventually mine it.

As for combining the "dust" while leaving larger balances alone -- you would have to find a client that allows you to choose the inputs to your transaction. I don't know which clients can do that.

[1] https://en.bitcoin.it/wiki/Transaction_fees (The fee calculations on this page are as of client 0.3, so they may be outdated.)

[2] https://en.bitcoin.it/wiki/Free_transaction_relay_policy

[3] Wiki link [1] above says that transactions with priority over 57,600,000 aren't subject to the minimum fee calculation. If this is true, then 10 BTC with an average age of 3 months in a 200KB transaction would have a priority of (1000000000 * 144 * 90) / (200 * 1024) = 63,281,250


blockchain.info does not want to import my bcc private key I imported my BCC private key into blockchain.info. But it does not ask me for the private key and lists the address as 'watch only'. I'd like to import the BCC amount into a blockchain.info wallet. All Tutorials about it do not correspond with the current blockchain menus.

Never mind, I used btc.com wallet instead of blockchain.com.
btc.com worked fine!


How to reissue a currency you own in NXT Monetary System (Sidechains)? I registered a monetary system currency on the NXT platform and made it exchangable as one of the properties. But now I want to make it reservable for a crowdfunding campaign. How do you reissue the same currency on the NXT platform? I dont see a reissue button anywhere.

If you have not distributed any coins, you can reissue the currency the same way you issued it by following this guide.


Trying to understand why hash value is more secure from hash algorithm I am currently studying in college in the US and was actually curious about bitcoin and cryptocurrencies as a whole. I started looking on free university sites like Stanford university and New York University and even attempted to do questions of their past papers. I answered most of the questions, but I am stuck on one of the questions:

Suppose your professor wants to award each student in the class a random priority for office hours help by giving them a number H(studentID||Bi)
where Bi is the ith block header in the Bitcoin blockchain.Would the scheme be me more secure if you instead used H(studentID||Bi-1|| Bi)? (https://cs.nyu.edu/courses/fall17/CSCI-GA.3033-019/assignments/practice_final.pdf)

I get that it maybe more secure if you use the Bi-1 because you have more inputs to generate an output, but I feel like that is not the reason.

giving them a number H(studentID||Bi) where Bi is the ith block header in the Bitcoin blockchain.Would the scheme be me more secure if you instead used H(studentID||Bi-1|| Bi)?

For this purposes of this question, the bitcoin header Bi = H(Bi-1 || other stuff).  Under a black box assumption of H()'s behavior, the two schemes are practically equivalent.

You can't really argue that H(id || Bi-1 || H(bi-1||stuff)) is more secure than H(id || H(Bi-1||stuff)) on the basis of 'more data' because H() might well have an internally bottleneck E.g. it could be implemented H(bytes[0 .. n]) = H(H(...H(H(H(bytes[0])||bytes[1])||bytes[2])...||bytes[n])  (and, in fact, sha256 does work kind of like this, though not one byte at a time).

Without out a more formal definition of "security" I don't think it's possible to just answer the question.  But guessing at a meaning "could someone more easily rig their office hours under one instead of the other"-- the answer would be no.


Bitcoin sendfrom and sendtoaddress I am using bitcoin daemon in my system to get and pass btc to users. So now I want to pass some btc to another users but I can not understand what is the difference between sendfrom and sendtoaddress. I have read about sendtoaddress command in
http://chainquery.com/bitcoin-api/sendtoaddress but could not understand where this btc is going from

According to the Bitcoin core developers reference, SendFrom is deprecated and you should use SendToAddress or SendMany instead.

Note that SendFrom sends from an account not from an address. The Account feature is being removed from Bitcoin core.

I assume the (HD) wallet rummages around for suitable UTXOs to use as inputs to the transaction.


How are the nBits of a block calculated? So I've been trying to figure out how the nBits of a block is calculated, but I can't seem to come up with an answer. I know (think) that it's based off the difficulty of the block, but I'm still not sure exactly how it works. The Genesis Block for example has a difficulty of 1.0, yet the nBits for that block was 486,604,799 (0x1d00ffff). Then if we look at the most recent block, it has a difficulty level of 21,434,395,961,348.92, yet an nBits of 386,736,569 (0x170d21b9).
So my question is, how exactly is the nBits of a block calculated and what is its relation to the difficulty of a block?
Thanks

nBits is a compressed representation of the target value that the block's hash must be less than. Bitcoin does not actually care about difficulty. Difficulty is just for humans to think about how much work is actually being done. Bitcoin only cares about nBits and the target value it represents. A block's hash must be less than that target value. nBits is recalculated every time the difficulty changes. The calculation takes the previous target (previous nBits) and scales it by the ratio of the actual timespan it took for that difficulty period to the timespan that is targeted for a difficulty period.
What it code does is (in pseudocode):
new_target = last_block.nBits.uncompress();
new_target *= actual_timespan;
new_target /= target_timespan;
this_block.nBits = new_target.compress();

So nBits starts at the value of the genesis block, and then scales up and down depending on how quickly blocks are being mined.

The relationship between nBits and difficulty is inverted. As nBits represents a smaller and smaller target, the difficulty value goes up. The computation is essentially just the ratio between the current target value and the maximum target value, which also happens to be the target value found in the genesis block. The difficulty is the current target divided by the the maximum target.


Are there any signatures where the recid (v) is equal to 29,30 (or 33,34 compressed)? Peter Wuille recently explained how ECDSA pubkey recovery is done, in response to my question.

So it's basically that for a given base64 signature, the value v in v,r,s provides the specific coordinates, hence the recid (recovery ID).

Example from BitcoinCore test vectors:

> sig =
> "H8PgOb/liZzt3QQHJn9kLBqH7E/i+SC6JTwYGtdNdOjnXzFqXnHMZqP7oZ1wb1QiQ3H/kF8xC9Yx7pK9ddlx8TA"
> addr = "1K5Z1nxN4mjUgCLpSXMRkeZxuAMpbn2CQB" wif =
> "KwfJTiKdcjNMjBu4ksgGd21EZXz6JomoZNbirP3nfd3K9ZMXMEUi"
>
> v,r,s = vrs = (31,
> 88597177789312009809148107221292570613390338668815747761545214128303675599079L,
> 43057030252916568867525408201971649068117337291455262356277580652864892694832L)

The value of v is 27 + recid for uncompressed keys and 31 + recid for compressed keys.

Ive run a Python loop using pybitcointools which signs a message using a random key, and I've yet to ever see v=29 or v=30. Why is this? Is it by design, or is it just a very low probability event?

For random signatures, it is an extremely low probability event. Around 1 in 2128, so it will likely never ever actually happen.

However, you can easily construct a valid signature that has one of those, and the recovery algorithm will give you an actual public key for it. It just won't be a public key anyone actually knows the secret key for.


Bitcoin P2PKH transaction - two questions Trying to learn the basics of the bitcoin's standard transaction script here. For a transaction where Alice has sent coins to Bob, who is now trying to redeem them, we have the concatenated scriptSig and scriptPubKey as below

<Sig> <PubKey> OP_DUP OP_HASH160 <PubkeyHash> OP_EQUALVERIFY OP_CHECKSIG

When we say that the recipient must specify the PubKey and Sig in scriptSig, what exactly is in Sig? My understanding is that Bob is signing the entire transaction with his private key and then this is what OP_CHECKSIG verifies. In this case, the inputs to OP_CHECKSIG are the transaction data and the public key. Please let me know if this is correct and if not, then what exactly are the inputs that OP_CHECKSIG requires?

Secondly, what is the point of the first part of the script that checks the match between scriptSig's PubKey and scriptPubKey? Could we not instead get a simpler script where the outputs of a transaction specify the public key itself instead of the hash of the public key? In this case, we would simply have

<Sig> <PubKey> OP_CHECKSIG,

where Sig comes from the Bob and PubKey from Alice.

The signature is mathematically generated using the private key and the message, but is not the message itself (it uses the hash of the message during the signing process, the message is not recoverable from just the signature). It's just a value (specifically, it is 2 numbers, called r and s) which can be verified against the public key and the message to see if it's a valid signature. In this case the message is the transaction data, which also protects the transaction from being modified because if it was modified, the signature would become invalid. If you're interested, you can read about the Elliptic Curve Digital Signature Algorithm (ECDSA) here.

Indeed it would be possible to use just the public key without the hashing steps, this is known as Pay to Public Key, P2PK and is also an acceptable output type. Please note, though, that a bitcoin address is not the public key itself. To create this type of output, the sender would have to know the public key, to put it in the output. It is not possible to obtain the public key from a bitcoin address because the address is a hash of that public key, to make it shorter and easier for common use, and is thus a non-injective trapdoor function.


How to detect a fork with bitcoin-cli? I'm keeping a simple log of blocks, and storing them in an array. When a new block arrives, I add it to the array.

Let's say this is my block chain array:

E    <- tip
D
C
B
A

Now, say a new block arrives, extending a branch:

     Z    <- new tip
E    Y
D    X    <- new branch start
     C
     B
     A

Now the blocks C and D have been replaced in the main chain by X and Y.

Questions:

Is there a way to detect that the latest block has extended a branch?

In other words, how can I detect whether blocks lower down in the array need to be replaced?

How frequently does this happen?

EDIT: Initial solution is to check if the previousblockhash of the new block is equal to the hash of the tip in the array. If not, update the old tip, and keep working down through the array updating each block until their is a match for the previousblockhash.

You can use the getchaintips RPC, which will list all tips of the known block tree, including branches that were never active.

You may see for example:

{
    "height": 420561,
    "hash": "000000000000000001cb02590846299c91794e9b9f422513cff4b9c1dd5c62a",
    "branchlen": 0,
    "status": "active"
},
{
    "height": 419698,
    "hash": "000000000000000004a3a78750438d0491b6335cbbe9c15099a6e55b6943e51a",
    "branchlen": 1,
    "status": "valid-headers"
},
{
    "height": 418868,
    "hash": "000000000000000000ba1d7d93ad1c7f04fb4a430fdee67c44fbdd3236f2b805",
    "branchlen": 1,
    "status": "valid-fork"
},

Here you can see that the current best valid chain we know of is at height 420561. There are also two forks:

One branching off at height 419697 and extending to height 419698. It has status "valid-headers", which means we heard about the headers for this block, but by the time they were verified, we already had an equivalent or better block available, so we did not attempt to download the forked block at height 419698.
One branching off at height 418867 and extending to height 418868. It has status "valid-fork", which means we actually heard about this block at a time when it was the best block, and proceeded to download and validate it, which was succesful. Later the branch was overtaken by the branch that is leading up to our current tip.

So this not only allows you to detect reorganizations, but gives information about all historic ones your node observed and/or went through.


What is a midstate? How does using a midstate speed up hashing? This defines "midstate" as the "precomputed hash state after hashing the first half of the data."

I've heard "midstate" used in the context of speeding up hashing. How does using a midstate speed up hashing?

People often talk about SHA256 like it's a single operation, but it isn't. Rather, the input is broken up into 64-byte chunks, and then each chunk is put into a compression function. The state of the hash partway through hashing something does not depend on future parts of the data. Since the nonce is found in the second chunk, changing the nonce doesn't change the the state of the hash function after hashing the first chunk.

This is useful in other applications. For example, if you're hashing a large file, it means that you can hash it without loading the entire file into memory at once or loading it from disk multiple times.

The practical consequence of this for Bitcoin miners is that 99.99999998% of the time, you only need 2 iterations of the SHA256 compression function to check a possible block solution, instead of 3. In other words, you can mine 50% faster. Of course, since everyone else does this, that just means that the difficulty is higher for everyone.

midstate is literally the state midway through hashing.

See also: Did Satoshi intend to allow midstate computation to speed up hashing?


Electrum 2.x sweep feature Could some explain how Electrum sweep feature works?

As I understand "sweep" can be used only after importing private key into wallet. But private key can't be imported into deterministic Electrum 2.x wallet.

So why it shows me sweep option?

It there any ways to sweep paper wallet into deterministic Electrum wallet?

The sweep function will send all coins related to the imported private key(s) to a new address (from the deterministic wallet). After sweeping, the private key is no longer capable of spending coins.

There is no need to "import" the private key in advance.

Mind that you need to pay a fee for the sweeping transaction (which is very little).


Can you help me see if I have an old Bitcoin account? I set up an crypto account & had different coins in it, but the computer died, updated to a current machine. Have also changed from AOL to Gmail, that was around 98 or 99, if that gives you any idea how long ago this was. Any info or direction would be appreciated. I do not know where or who to speak to see if I had a Bitcoin Acct. or a ledger, wallet or if it was thru Bitcoin? I don't even remember my AOL address, & they are no help? I was going to get back into it & thought maybe I could use the old account? Thank You

Do you remember writing down any kind of information, like 12 or 24 random looking words (or any other information regarding your bitcoin/crypto accounts)?
As @chytrik mentioned, there was no bitcoin or "crypto" (in the sense which the word is used nowadays) before 2009, and wallets that were able to store other cryptos besides bitcoin came into existence only a few years after that.
So what happened in 98/99 shouldn't be of any importance. Perhaps you are conflating something else with "crypto"?
In any case, if you think you might have had a bitcoin wallet, figuring out what kind of wallet/account you used would be a first step, and if you have any other kind of written down information would be very helpful as well (DO NOT SHARE THE ACTUAL CONTENT OF SUCH INFORMATION WITH ANYONE, in case you find it).


I have an hw.1 I want to access I have an HW.1 I had lost and finally found.  I tried to access but the new ledger software does not work.  i tried with electrum, but have managed to lock myself out of pin attempts.
What can I do to recover my bitcoin from this device?  I have searched and can't seem to find much on it.

What can I do to recover my bitcoin from this device?

If the device believes it is in the hands of thieves (many failed PINs) it should never divulge its contents to anyone under any circumstances. I don't know much about the HW 1 but I'd hope (and you should too) it would either self destruct or require some sort of full-reset to be usable again - losing all its contents in the reset process.
The way to recover control over the money is to use the recovery words you wrote down and kept safe back when you first set-up the device.
As one reviewer said in 2016:

The on-boarding process is quick and easy, asking the user to pick a four-digit PIN and to write down a series of ‘recovery words’ on a bundled informational sheet.

These words allow the wallet to be regenerated onto a replacement HW.1 should you lose or damage your original, and represent the device’s weakest link. When you’ve recorded the words, the card should be sealed away in a safe and treated with the same care you would furnish upon a stack of banknotes to the value of your Bitcoin hoard.

Ledger no longer provide support for the HW 1 but the recovery words will work with later Ledger devices.