Is Ripple's distributed exchange scalable? This question asks about the scalability of Ripple in general, and has an ok answer.

However, it doesn't mention the distributed exchange built in Ripple. How is its current/future architecture designed to cope with scale?

It is designed to be highly scalable.

Offers are aggregated with others offers of the same currency pair in the same direction of the same quality (rate). The ledger has a "next index" operation and offers are indexed by quality, so finding the best offer in an order book is as simple as computing the index for the base of the order book and looking at the next ledger entry.


Heartbleed bug and Altcoins Bitcoin recently released V 0.9.1 patching vulnerabilities from the Heartbleed bug, however I have not seen anything from any alt coin. What are the possible security risks associated with using these coins? And what are the risks to the coins themselves?

I've done a little research on this as it was a big concern, not to worry! This is only an issue if you have a bitcoin (or altcoin) daemon set up with RPC over HTTPS. This would only be used if say, you have a daemon running on one VPS and another node which asks it to send money. Source: http://www.cryptocoinsnews.com/news/openssl-heartbleed-security-bug/2014/04/08

This is disabled by default and unless you were using RPC over SSL there is no need to worry :)

If you have been using RPC for any coin I would say a good practice would be to generate a new wallet and send funds there.


Can I buy/sell a lot of bitcoins without moving the price? I am curious about how to acquire a lot of bitcoins (or similarly move a lot of bitcoins) without hitting the bid/ask

I don't care about blockexplorer, I am just curious about price discovery

are there any darkpools? could I just use an illiquid exchange and personally contact the counterparty and have them take the trade

options would be good too, this would make acquiring bitcoins at a certain strike easier as this is already a negotiation between the person on the other side of the contract

It won't work, no matter how you do it. If you acquire a lot of Bitcoins, that will mean that a lot of people who wanted to get rid of their Bitcoins no longer want to get rid of their Bitcoins. Thus, they will stop supplying them. The reduction in supply will move the bid/ask prices. It's fundamental economics and you can't change it.


What would kill Bitcoin? Other than banning it, what is the biggest risk to the price of Bitcoin? What circumstances may kill Bitcoin or bring it down to less than $10?

No one can determine the effect certain threats will cause, but some "popular" threats are:

Extreme government regulation.
Bitcoin losing to a competitor coin.
Technical attacks, including attacks on protocol (51% attack) or attacks on cryptography.
Intentional market manipulation to crash the price.

Some factors that can drive these events to be more likely to occur or enable them are:

Unresolved technical issues, such as blockchain bloat, or transaction limits within blocks.
End of or diminishing block rewards causing people to abandon mining.
Increased centralization for whatever reason (advanced technology, zero power costs, etc.)


Why does Github say that the Bitcoin project is 74% TypeScript? For the Bitcoin project on Github clicking "Show language statistics" shows that the source code is almost 74% TypeScript. Why is this so when ostensibly Bitcoin is written almost entirely in C++. Even Script, Bitcoin's programming language, has got nothing to do with TypeScript or Javascript. What am I missing?
Thanks.

That's because of the QT translation files, see https://github.com/bitcoin/bitcoin/search?l=typescript

I'm not sure why they are recognized as TypeScript (it's just XML), I guess it's because of the filename extension .ts.


Check Bitcoin address balance from blockchain I am a merchant that accepts bitcoins, and I'm building my own desktop client for receiving them in Java.

When I receive a transaction, I would like to be able to see in my client how much bitcoin is stored in the address that I am receiving from.

I have the full blockchain downloaded on my computer.

How can I access the balance of an address from the blockchain? I would like to be able to do this offline by accessing the blockchain stored on my hard drive.

Thanks in advance

Perhaps you can look at the source code of full-mode bitcoin implementations in Java, such as bitsofproof (BOF).

It seems bitcoinj also has a full-mode but it is experimental only and not really suitable for prod.

Hope this helps...


Interpreting results from "bitcoin-cli getmempoolinfo" A bit of a conundrum interpreting the results from "bitcoin-cli getmempoolinfo".

Straight from https://chainquery.com/bitcoin-api/getmempoolinfo:

getmempoolinfo
Returns details on the active state of the TX memory pool.
Result:
{
  "size": xxxxx,               (numeric) Current tx count
  "bytes": xxxxx,              (numeric) Sum of all tx sizes
  "usage": xxxxx,              (numeric) Total memory usage for the mempool
  "maxmempool": xxxxx,         (numeric) Maximum memory usage for the mempool
  "mempoolminfee": xxxxx       (numeric) Minimum fee for tx to be accepted
}*

Cool! So "size" returns the number of transactions in the memory pool! But the numbers don't add up. Straight from the same page:

"result": {
    "size": 9178,
    "bytes": 100859918,
    "usage": 216557216,
    "maxmempool": 300000000,
    "mempoolminfee": 0.00001070
},
"error": null,
"id": null*

Doing the math, "bytes" divided by "size" equals 10,989 bytes/transaction. I would expect sometime on the order of ~400 bytes/transaction. Hence my conundrum.

After some digging, I believe I have an explanation: the memory pool is clogged with 'junk' transactions.

Bitcoin Core's minrelaytxfee parameter defaults to 0.01 mBTC/KB, which is "too low" in the sense that it permits TONS of 'junk' transactions to enter the memory pool. I've bumped minrelaytxfee to 0.05 mBTC/KB and the results so far are very encouraging. The memory pool profile now makes sense, from the # of transactions to the size of each transaction.

And minrelaytxfee=0.00005 strikes me as "fair" as it is one-tenth the broadly recommended transaction fee of 0.5 mBTC/KB (backup up by the Pareto breakdown of real transactions on various websites).

I encourage everyone running Bitcoin Core can make their own decision on minrelaytxfee for their full node.


In Deepbit how do you get the Bitcoins transfered to your wallet? In Deepbit I've mined a fraction of a Bitcoin. How do I get the money into my wallet? Here it says "Instant payout button is shown when your balance is at least 0.01 BTC and you received less than 3 payments in last 24 hours." does this mean I have to wait until I have mad 0.01BTC?

Yes. Otherwise, the cost to transfer the Bitcoins (when you want to spend them) will wind up equaling or exceeding their value.


Why does mining profitability tend towards zero? Why does mining profitability tend towards zero?

Is it different for short term miners than it is for long term miners?

  Example: if I mine now and sell them next year, they may be worth more as next year they'll be harder to mine

Thanks

As with all things related to supply and demand, the market will eventually find its equilibrium, where the cost of generating the Bitoins will be close to their sale price. If the costs were bigger, less cost efficient miners would not mine. If the price was higher, there would be more room for investment that would increase the difficulty, thus increasing the cost to mine every Bitcoin.

If you want to calculate how profitable mining is, just put the data into any Profitability Calculator.


Where can i download latest stable bitcoin-core src files? i want to download latest stable bitcoin-core src files. and want to build it on my system from source.

here is latest src of bitcoin-core but its not stable for production ready environment.

https://github.com/bitcoin/bitcoin

https://bitcoin.org/en/download shows latest version as

Latest version: 0.14.2

so where can i download src files of version 0.14.2

As you can see here the latest version is now the more stable version. As the most recent changes are for bug fixes, etc.

  This is a new minor version release, including various bugfixes and
  performance improvements, as well as updated translations.

If you download a previous version this version may contain those fixed bugs.


RPC get free address Always when i need free address (not labled) i use:

getAccountAddress('')

And i want to know: Can it give me an already occupied address (by label)

I'm worried that I can get an already address in using (by label)

If you provide an empty string it will return the default account every time. Note getaccountaddress is deprecated, see https://bitcoincore.org/en/doc/0.16.2/rpc/wallet/getaccountaddress/.

getaccountaddress "account"

DEPRECATED. Returns the current Bitcoin address for receiving payments to this account.

Arguments:
1. "account"       (string, required) The account name for the address. It can also
be set to the empty string "" to represent the default account. The account does not
need to exist, it will be created and a new address created  if there is no account
by the given name.


Bitcoind and multiple users I was wondering if anyone had advice for running bitcoind for multiple users. I obviously don't want users to get into other users transactions. As far as I can tell I'll need to run multiple instances of Bitcoind, but this is a terrible waste of bandwidth. Can I at least share the blockchain across users?

Bitcoind allows you to house multiple and separate accounts in a single instance of the bitcoin client. Using the accounts feature is probably what you're looking for.

https://en.bitcoin.it/wiki/Accounts_explained


How do you send to multiple addresses by paying a one time fee? Which wallet supports this? I have 20+ addresses I need to payout to. How can I send to all of these addresses without having to do it one at a time and paying a fee for each?

Which desktop and mobile wallet supports this type of feature?

TL;DR: Just read the second paragraph of "Concrete Numbers".

Wallet Recommendation: Electrum

Doing this in Electrum is very simple. Just switch to the Send tab and then (in the menu) choose Tools → Pay to many. The "Pay to" field will become a text area and a popup will open, telling you how to send money to many addresses.

Note that the unit of the amount can be changed in the settings (Tools → Preferences → Appearance → Base unit) and is mBTC by default.

The amount field will be automatically filled in once you have at least one valid line in the "Pay to" field:

The amount field probably isn't grayed out from the beginning because you technically can switch between pay to many mode and pay to single address mode without choosing Tools → Pay to many by just hitting enter in the "Pay to" field which automatically makes it a text area.

The Fee

As the fee by default is paid per transaction – not per transaction output –, you only have to pay it once even if you send money to a large number of addresses. It can be adjusted as a linear function of the transaction size in Tools → Preferences → Transactions.

Adjusting the Fee in Electrum

Alternatively, you can check the box Dynamic fees in Tools → Preferences → Transactions to use Electrum's dynamic fees feature which changes the fee function to not only depend on the size of the transaction being submitted but also on the network conditions (the number of pending transactions and the current rate at which transactions are processed).

In any case, Electrum shows you the fee in a popup before the transaction is sent if you check check View transactions before signing in Tools → Preferences → Transactions (not sure whether it does if you don't). If you use the dynamic fees feature, you will receive a warning if the fees are currently unusually high due to inconvenient network conditions.

As an alternative even for that, you can check the checkbox Set transactions fees manually in Tools → Preferences → Transactions which lets you set the fee manually for every transaction.

The Amount of Fee

As for how much the fee will be, let's say you pay a fee of ρ/Byte where ρ is around 10 Satoshi. This is equal to what you mean by

  Would it be .0001 x 20 = .002 in fees?

if you mean ".0001 BTC/kB" by ".0001" because .0001 BTC/kB * 100'000'000 Satoshi/BTC / (1000 B/kB) = 10 Satoshi/B

You can inform yourself about fee recommendations in articles like this one.

For simplicity, let's assume you use P2PKH with compressed keys (which is standard), have a UTXO large enough for the entire transaction but not of just the right size, so you need a change address (which is almost always the case).

Under these assumptions, you have to use 148 Byte per input and 34 Byte. In addition to this, the transaction header needs 10 more Bytes.

We can now write down a function φ : ℕ×ℕ×ℝ → Satoshi which tells us the transaction fee provided the number of inputs and outputs as well as ρ. This function is: φ(ni, no, ρ) := (10 + ni*148 + no*34) * ρ * Satoshi

Let γ : ℕ×ℝ → Satoshi be the function which tells us the fee for a transaction with 1 input, 1 change address, and and n addresses you want to send money to. This function is defined as: γ(n, ρ) := (192 + n*34) * ρ * Satoshi

Concrete Numbers

If you pay the 20 people individually, you will spend 20*γ(1, ρ) = 4'520*ρ*Satoshi = 0.0452*ρ*mBTC as the fee. On the other hand, if you pay them all at once, you only spend γ(20, ρ) = 872*ρ*Satoshi = 0.00872*ρ*mBTC. If we assume ρ=10, that's 0.452 mBTC or 0.0872 mBTC respectively.

The difference is that you would spend (0.452 mBTC)/(0.0872 mBTC) = 5.18 times as much of a fee if you made individual transactions compared to if you made one cumulative transaction.

If you pay the 200 people individually, you will spend 200*γ(1, ρ) = 45'200*ρ*Satoshi = 0.452*ρ*mBTC as the fee. On the other hand, if you pay them all at once, you only spend γ(200, ρ) = 6'992*ρ*Satoshi = 0.06992*ρ*mBTC. If we assume ρ=10, that's 4.52 mBTC or 0.6992 mBTC.

The difference is that you would spend 6.46 as much of a fee if you made individual transactions compared to if you made one cumulative transaction.

Data Import

Furthermore, it's probably easier to make one big transaction than to make many small ones. If you have such a table in LibreOffice Calc, you can just save it as a CVS (comma-separated values) file and feed it to Electrum as it itself describes it in the popup seen in the first screenshot.


Bitcoin Miner Storage Issue I was installing a bitcoin miner on my surface pro 4 with 4 gb of RAM, and it took almost 14 hours before running out of space. I uninstalled bitcoin, but for some reason it's taking up like 100 gb of memory on my computer. It says it is in apps and data, but it won't show up anywhere! Please help. (I am also using windows 10)

I'm guessing that the uninstall didn't remove your wallet or block files.

Delete the folder C:\Users\YourUserName\Appdata\Roaming\Bitcoin to delete both of those.


New Blockchain.info wallet but where are my bitcoins? How to access them? I have/had a wallet with Blockchain.info containing 2 bitcoin addresses. One address contained 0.33 BTC.

Yesterday when I wanted to access my wallet, for whatever reason, I couldn't remember my password, so I thought, no issue, I just can re-enter my wallet using my 12 words, so I did. I tried to recover my wallet with these 12 words and I was given another wallet (another wallet ID I mean).

The problem here is that I cannot see my funds and my known bitcoin address! I can import the bitcoin address (as I can for any address but then it is 'read only').

Can someone explain me / help me how I can recover my funds? These funds have always been in my old wallet (former wallet-ID).

This method will only work if you didn't imported any addresses to your account. (Reason? "Please note that imported addresses are not backed up by the wallet recovery phrase. We strongly recommend you sweep funds from imported addresses." Source)

First go to Electrum and download the wallet from there.

Then install & open that wallet.

While opening, select "standard wallet"

Then select "I have a seed"

After that you will get a screen like this where you need to import your 12 word seed:

Then click on "options"

After that click on "BIP39 Seed"

Then the wallet will have your BTC with the same address.

Hope this helps you in some way.


getting balance from my address using bitcoinj I can get my bitcoin balance from private key but when i tried retrieving from my address its not possible posted below my code can any one tell me what i'm doing wrong

public static void main( String[] args )

        {
            NetworkParameters params = TestNet3Params.get();
            WalletAppKit kit = new  WalletAppKit(params, new File("."), "sano");
            kit.start();
            kit.isRunning();
            Address address = new Address(params, "mj255GgoGKN6uTjtWdNcF7obu88iLSTZdm");
            boolean add =kit.wallet().isAddressWatched(address);
            Wallet wallet = new Wallet(params);
            DumpedPrivateKey key = new DumpedPrivateKey(params,
                   "cTH6YyRZSqF8VvtjkfqABqjGF682cQkW3mMuageraH4CEzCrweqT");
            wallet.addKey(key.getKey());
            wallet.addWatchedAddress(new Address(params, "mj255GgoGKN6uTjtWdNcF7obu88iLSTZdm"));
            BlockChain chain = new BlockChain(params, wallet,
                   new MemoryBlockStore(params));
         PeerGroup peerGroup = new PeerGroup(params, chain);
         peerGroup.addPeerDiscovery(new DnsDiscovery(params));
         peerGroup.addWallet(wallet);
         peerGroup.start();
         peerGroup.downloadBlockChain();
         BigInteger balance = wallet.getBalance();
         System.out.println("Wallet balance: " + balance);
}

Edit 1: The below given code retrieves balance from address but each and everytime it is creating a new address.

public static void main(String[] args) {

    NetworkParameters params = TestNet3Params.get();

    String filePrefix = "forwarding-service-testnet";

    WalletAppKit kit = new WalletAppKit(params, new File("."), filePrefix);

    // Download the block chain and wait until it's done.
    kit.startAsync();
    kit.awaitRunning();

    List<Address> list = kit.wallet().getWatchedAddresses();
    if (list.size() < 2) {
        kit.wallet().addWatchedAddress(kit.wallet().freshReceiveAddress());
        System.out.println("New address created");
    }

    System.out.println("You have " + list.size() + " addresses!");
    for (Address a: list) {
        System.out.println(a.toString());
    }

    String balance = kit.wallet().getBalance().toFriendlyString();
    System.out.println(balance);
}

I can offer you the workaround for this problem. I used web API for this feature. For example https://www.blockcypher.com/dev/bitcoin/#address-balance-endpoint.

It will allow you refuse block chain downloading part and make your code more simple.


How can one redeem a Casascius Physical Bitcoin? These physical coins are supposed to be worth 1 BTC each - they have a hologram and a private key that somehow gives access to a real (digital) Bitcoin.

What is the process of claiming this real (digital) BTC for the physical one?

The first 8 characters of the public address are on each coin, which allows you to obtain the full address or check the balance at FirstBits or a similar service. Beneath the tamper-evident holographic sticker on each coin is the private address which corresponds to the public address. Once you've obtained both the public and private address, the process for importing this information into an existing wallet has already been documented in this prior question.

Edit: On a side note, it's probably worth noting that this process is almost identical to the process used to redeem BitBills

Edit 2: Apparently these coins use a different private key format than standard. Casascius has published a utility to convert these private keys to standard addresses and more about the "mini private key" format can be found at the wiki. For those lacking a copy of Visual Studio, I've compiled a copy for your convenience. These keys may also be computed using any calculator or code capable of generating an SHA256 hash:

SHA256("S4b3N3oGqDqR5jNuxEvDwf") = 0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D

Of course that's still in hex and needs to be converted to Bitcoin's modified Base58 but many wallet import tools will accept hex as well.

Edit 3: Just heard from Casascius that we may be able to redeem these coins, as well as any device bearing a mini private key directly at MtGox in the near future.

Edit 4: Support has officially been added


Determining total blocks solved How do you determine the total blocks solved among all clients in the source code of an Altcoin? Is there a file in the code that can be viewed to see how many blocks have been solved in the meta data? How can this be determined or where can one look in the source code?

To determine the current blockheight of any coin, you will need to pull data from the network itself. The source code that runs a node for any coin will not include this information.

A full node will download the blockchain history, so your node could then report the current blockheight back to you. The source code basically contains instructions telling your computer how to do this, but the explicit block height is not contained within the source code.


When installing libbitcoin there are checks of the code, why is this? When installing libbitcoin from here with $ ./install.sh --prefix=/home/me/myprefix --build-boost --disable-shared after most of the compilation is done there seem to be checks of the sourcecode with warnings like thise one:

In file included from ./include/bitcoin/bitcoin/machine/operation.hpp:159:0,
                 from ./include/bitcoin/bitcoin/chain/script.hpp:31,
                 from ./include/bitcoin/bitcoin/chain/output.hpp:28,
                 from ./include/bitcoin/bitcoin/chain/output_point.hpp:25,
                 from ./include/bitcoin/bitcoin/chain/input.hpp:27,
                 from ./include/bitcoin/bitcoin/chain/transaction.hpp:30,
                 from ./include/bitcoin/bitcoin/chain/block.hpp:31,
                 from ./include/bitcoin/bitcoin.hpp:24,
                 from test/chain/transaction.cpp:20:
./include/bitcoin/bitcoin/impl/machine/operation.ipp:136:15: warning: ‘size_t libbitcoin::machine::variable_uint_size(uint64_t)’ defined but not used [-Wunused-function]
 static size_t variable_uint_size(uint64_t value)
               ^~~~~~~~~~~~~~~~~~

On my Raspberry Pi 2B this goes on for several hours now. Can someone explain why such a huge amount of tests would be usefull?

These are not tests. They are simply warnings generated by the compiler indicating there may be an issue with the code being compiled.

Most likely, it's just being overzealous and the developers are aware of this.


Are transaction comments public? Can other people see the message attached to the bitcoin transaction? Or is it only for receiver/sender to be seen?

Comments that you add to transactions are for your wallet only. No one else will see them as transactions do not have anywhere to have comments. Comments on public blockchain explorers (such as tags on blockchain.info) will only appear on those websites as they are comments specific to those websites. They are not part of the transaction itself.


Can I 'un-import' private key? I'm checking out the test net and a friendly person gave me access to his private key so that I didn't need to generate coins, so I importprivkey the key, sent me some coins and...

Well, I understand that now my wallet contains those 2 addresses, how can I remove his address, if possible?

Why do I want to do this? Because I'm testing stuff out and I don't want his transactions / tests cloud mine.

Thanks

There is no way to 'un-import' a private key in the core client. What you could do instead is:

Make a list of all the private keys you do care about.
Close your client.
Move the wallet.dat out of the data directory to some other location.
Start the client.
Re-import all the private keys that you do want in your wallet.

This is sort of a work around, and it may be kind of tedious, sorry there isn't a better solution currently.


How do I securely store different CryptoCurrencies? I may be seen as a newcomer and and a non-tech-savy person for asking this, but after serveral hours combing the internet, I now have to admit my defeat and ask the question instead of just finding the answer myself.

For long I have been wanting to invest in more "exotic" crypto currencies. What is the most secure way to do long-time investments in crypto currency?

I don't like the idea of having my currency lying at a broker, and ideally I would like to buy a currency, transfer it to a cold wallet, and then let the wallet and backups thereof sit offline until I believe it's time for selling the currency again.

Is this possible to do for anything else than BitCoins and Etherium?

Short answer: Yes, it is possible. But depends on every coin. The majority of the top coins has his own wallet where your funds can't be stolen.

First of all, taking into account that cryptocurrencies are a developing technology I wouldn't use the word "securely". But if you want to minimize the risk, I recommend you to diversify your portfolio, for example:

50% BTC
20% ETH
10% LTC
10% XMR
5% IOTA
5% MAID

That would be pretty much my choice, you can make your own.

In any case, for a long-term investment I recommend you to research the core technology of each coin. And of course guard the funds on your own wallet.

If you want to invest on really new cryptocurrencies that doesn't have a wallet yet, you'll have to let the money on the exchange until a wallet is launched. There's no other way.


How can I integrate Bitcoin payments into my website created in C#? I am new to Bitcoin. How can I integrate Bitcoin payments into my website which is designed using ASP.Net?

Here is a book which teach you some basics of bitcoin programming https://programmingblockchain.gitbooks.io/programmingblockchain/content/


Matching KeyPath in application with Wallet32 Keypath for Bip44 wallets I have an application where I create an HD wallet with a passphrase and save the public master key to the database for the user.

Then, I want the user to be able to back up the wallet to their own wallet, in this case I am using Wallet32. I restore the account in Wallet32, which uses a key path of m/44'/0'/0'/

On my application side, I am creating the keypath like so (in c#):

KeyPath newKeyPath = new KeyPath("44/0/0/0/0" + nextDerivation);
var childKey = pubkey.Derive(newKeyPath);

The nextDerivsation variable just increments with each purchase. When the derived public key is created on the application side, it doesn't match up with a derived public key in wallet32. So, if a payment is made through the application, Wallet32 doesn't pick it up.

I am using the C# NBitcoin library. When I try to add the apostrophes in the keyPath string like so:

KeyPath newKeyPath = new KeyPath("44'/0'/0'/0/0" + nextDerivation);
var childKey = pubkey.Derive(newKeyPath);

Then I get an "invalid input format" error. I am unsure as to whether those apostrophes are necessary or not, but when I input that same derivation path into the Bip32 generator, then I can create the same public keys. I can send a payment to the derived address and wallet32 picks it up.

Can anyone point me in the right direction on what I need to use for the KeyPath in the NBitcoin library to obtain the same results?

Response on stackoverflow https://stackoverflow.com/questions/27299204/matching-keypath-in-application-with-wallet32-keypath-for-bip44-wallets/27627358#27627358

Short answer : now the "44'/0'" notation has been implemented, just update your package of NBitcoin.


Live Blockchain Backup What is a good strategy for backing up bitcoind's blockchain files (not its wallet file) without having to take (e.g.) a bitcoind that is powering a counterparty-server instance offline?

Copying the blockchain from a running bitcoind may result in a corrupted copy (https://bitcoin.stackexchange.com/a/25260/1660),

To avoid this, is it best to run a separate bitcoind that pulls the blockchain from the first instance (by adding it as its sole network connection using addnode) and periodically stop that then rsync out any changes? Or is there a less circuitous way of getting a coherent blockchain backup from a live bitcoind?

The easiest way would be doing a snapshot, but this method depends mainly on OS or Hardware support.

Another option is creating a bootstrap.dat file, which is basically a concatenation of all blocks in a single file. When the node finds this file in its data dir it loads all blocks from it before connecting to the network, so the initial load can be much faster (again, depending highly on your IO and processing capacity...).

You can create a bootstrap.dat file using the tools here. To restore, see https://bitcointalk.org/index.php?topic=145386.0


huobi.com API to get latest trade price, bids and asks? I'm looking for a simple API description to get some basic stats from the huobi.com exchange. Mainly the last trading price, and current orderbook (bids & asks).

They seem to have an API: http://www.huobi.com/help/index.php?a=api_help but this page doesn't help me much (even after translating it with Google, as I can't read Chinese).

Does anyone know how to use this API?

I had some trouble finding it there but then I found it in "reference"
https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference

You can use normal http queries like on other exchanges so to get an orderbook you use this for example: https://api.huobi.pro/market/depth?symbol=ethbtc&type=step1


can one verify with certainity that pool is not cheating? Can miner validate with 100% certainty that pool operator is not cheating like claiming that your share is smaller compared to other participants? i.e. telling you that your share is smaller than what it actually is.

I'm not telling about big percentage. But lets say can 5% difference remain unnoticed?

I believe that in the simplest, "spherical cow" setup that you could indeed know if you're being defrauded.
In my answer, I'm assuming no variance, no blockchain reorgs, really I'm not considering any variables which might skew calculation.

I'm also assuming you do know your own true hashrate -- that is, you count your valid shares yourself and can figure out what percentage your own mining is relative to the rest of the network.

Suppose you know that you should constitute for 10% of the network's total hashrate (you can learn an approximation of the network's hashrate by looking at the rate which blocks are discovered, and the current difficulty), but then the pool pays you less than 10% of the total bitcoins minted during a timespan (minus pool fees), then it's likely that you're not getting paid for all your work done on the pool.

Again, when the percentages are very small, or when other factors come into play like reorgs, selfish mining and natural variance, it will be increasingly harder to determine.


Does mining in a pool with a bigger hashrate mean more bitcoins? Will someone with a 800 Mhash/s device earn as many bitcoins in one day as someone with a 10 Ghash/s device?

(I can't add a comment to
Mining pool hashrate effect on a miner's income
so I'm asking here.)

No, payments are distributed proportionally to the contributed work.

The chance to find a block is proportional to the hash-rate of a mining entity. So, if watched sufficiently long you could expect to get the same percentage of all rewards as the portion of the total mining power you contribute. This principle remains the same whether you solo mine or pool mine (minus any fees the pool costs you).

However, the pool combines its power to find more rewards, which it distributes among its contributers according to the size of the contribution of shares to the pool. I assume the operator gets a percentage of the reward in some fashion. That way you gain a steady small income instead of winning the lottery every few decades.

So, whether we are talking about mining pools in the network or participants in a mining pool, if watched for a sufficiently long period of time the entity with 10 GH/s will earn 12.5 times the amount of the entity with 800 MH/s.


Bitcoin Segwit was released in the summer of 2017 to reduce the blocksize congestion. Why is it still congested? Segwit was released in the summer of 2017 to resolve the network congestion. Why is the network still congested? Didn't it enable 1MB blocks to become 2MB blocks? Or do you have to wait for wallet providers to make use of the segwit portion of the software?

SegWit cannot, and was never designed to "resolve network congestion". It:

fixes the third-party malleability issue that Bitcoin has had since its creation, vastly simplifying many multi-transaction smart contract constructions (like Lightning).
fixes the O(N2) signature hashing problem.
adds amount commitments to signature hashing, simplifying design of hardware signing modules ("hardware wallets")
adds script versioning, making it significantly easier to add new features later as a soft fork
introduces a scripthash mode with 128-bit security (P2SH only has 80-bit security against certain attacks)
introduces a discount factor 4 for signatures w.r.t. block size accounting, partially rectifying the issue that creating an output is far cheaper than spending one.

All of the points above are improvements to Bitcoin in the long term w.r.t. scalability and security. In addition, the last point also indirectly provides a modest capacity increase - allowing a bit more throughput for those who choose to use new-style transactions. This is justified by the fact that simultaneously some of the worst-case costs to the network are removed (the O(N2) sighashing), and technological improvements for block relay (see BIP152). It is by no means a blanket "let's double capacity" - more an improvement in the accuracy in counting the cost of transactions, which happens to make things cheaper for the most common ones.

Regarding network congestion, that's just a fact of life if the network is operating sanely. It's both necessary for the system's survival (as the miner subsidy diminishes, fees more and more directly define the incentive for miners to secure the network), and a logical result of any restriction in capacity - whether that is 1MB or 2MB or 100MB blocks. If capacity in blocks isn't being used, the price of block space will drop, and new use cases will develop. For example, if the available space isn't being used for extended periods of time, I expect the feerate to go so low that people will start to try to put their backups in those blocks - burdening the whole world. Essentially, what you call network congestion is just a sign of a functioning fee market: if you don't limit the price, the demand will become infinite.

Disclaimer: I designed a significant part of SegWit.


Error validating transaction using BLOCKCYPHER I recently followed the steps on the answer by StephenM347 to the following problem:

Cannot access my bitcoins because my wallet is still synchronising. What can I do to spend them immediately?

However, on the last step (broadcasting my transaction on https://live.blockcypher.com/btc-testnet/pushtx/) I got the error message:

Error validating transaction: Transaction eddxxxxxxxxxxxxxxxxx orphaned, missing reference 00350a8xxxxxxxxxxxxxx.

I am very new to this and all I want is to have my bitcoins on a MultiBit wallet (where I sent the Bitcoin Core bitcoins to).
Could anyone point me in the right direction here?

When a transaction is orphaned it usually means that it is part of an orphaned block. This happens occasionally so there is no reason to panic :)

According to Anonymous in this answer, orphaned transactions are not lost and are returned to the memory pool where miners can pick it up again and attempt to confirm it.

In short, as long as the transaction has a high enough fee (which it should have considering it was added to a block already) it should confirm eventually.

You can also keep track of it using this service:

https://mempool.observer/


How much on-chain activity is to and from exchanges? Are there any data services which provide metrics that show how much of the transactions on the Bitcoin blockchain are to and from exchanges?

Blockchain.com show charts of "The total USD value of trading volume on major bitcoin exchanges."

Doubtless there are other publishers of equivalent data.


What is the dust limit on Bitcoin Cash transactions? I understand from another question here on Stack Exchange that the dust limit for Bitcoin transactions is 546 satoshi, meaning that no transaction output may be on an amount less than that. What is the equivalent dust limit for Bitcoin Cash transactions?

Bitcoin-ABC (the reference implementation of Bitcoin Cash) is a fork of bitcoin core, there are no big changes to the settings.

so bitcoin cash dust limit is exactly the same as Bitcoin which is 546 Satoshi.

To make sure you can review Bitcoin-cash-ABC/transactions_test/ file code on GitHub line 546

And on transactions file here

/**
 * "Dust" is defined in terms of CTransaction::minRelayTxFee, which has
 * units satoshis-per-kilobyte. If you'd pay more than 1/3 in fees to
 * spend something, then we consider it dust. A typical spendable
 * non-segwit txout is 34 bytes big, and will need a CTxIn of at least
 * 148 bytes to spend: so dust is a spendable txout less than
 * 546*minRelayTxFee/1000 (in satoshis). A typical spendable segwit
 * txout is 31 bytes big, and will need a CTxIn of at least 67 bytes to
 * spend: so dust is a spendable txout less than 294*minRelayTxFee/1000
 * (in satoshis).
 */


Bitcoin-Qt source code walkthrough Has there been content published which provides an overview of how the Bitcoin-Qt software is architected?

I would like to dive into the source code, but going from scratch is somewhat taxing. Can someone help me?

https://bitcointalk.org/index.php?topic=41718.0
Don't miss the threads it links to at the bottom of the post.

But I wouldn't recommend diving right in if you don't know the basics of how bitcoin functions. You are going to need an okay understanding of cryptography used and C++, networking and program design.


Who obeys discouraged blocks? I just found this gem - Discouraged Block. It proposes a method where miners "will" (are requested to?) ignore chains with certain blocks at the tip.

It's not like anyone can dictate the behavior of all miners, but if large parts of the network choose this discouragement strategy, then it becomes unprofitable for any single miner not to join in.

Are any current miners/pools for or against this discouragement policy (currently, the only policy is "ignore forks where the coinbase of the block at the tip does not contain the block height")?

I suspect what will happen is that most of the mining pools will use the official client, and so will use the discouragement policy as set by Gavin et al.  This will make it in each pool's best interest to not have their blocks be discouraged.


Can I earn transaction fees by running as a full node, verifying transactions, but not mining? As I understand it, by running a full node (i.e. Bitcoin-QT) , I am helping confirm transactions and contributing to the Bitcoin network.

When transaction fees are offered, do I receive these, and if so, how? Or do I need to be a fully fledged miner?

Nope, transaction fees of a transaction can only be collected by including it into a valid block. And to be able to include a transaction in a valid block you have to mine a valid block.


What is the relation between the bitcoin address and the corresponding private key? Just wondering how do get the address given that we store only a public key? What is the relation between them? Is address a simple hash of private key? If yes, what hashing algorithm is used?

A Bitcoin address is a hash of the public key. The Bitcoin wiki explains the exact (complicated) procedure in great detail. In brief, it involves hashing the public key and includes a checksum. The private key and public key are mathematically related.

If you have the private key, you can easily calculate the public key and address.
If you have the public key, you can easily calculate the address, but not the private key.
If you have the address, you cannot calculate either key.


How to get started with building an fpga mining device I plan to make an fpga mining device for bitcoin mining just for the fun of it. I thought understanding bitcoin as  whole would be the first step to take. However I realize that understanding the whole verification and transaction process in bitcoin would take a lot of time. Time that I really dont have. So I just wanted to know what would be the most important things to know related to bitcoin before getting started as only solving the nonce would be the part that I write in verilog/vhdl. The remaining part related to understanding how bitcoin uses Script and processes transaction would be quite unnecessary to know since I am not going to use it for the project. Having said that knowing how the whole system works is important and I will do it but from the point of view of an fpga mining device I would like to know on what to really focus on?

See: Open Source FPGA miner and additional info


What stops a miner from including arbitrary transactions in their block? Suppose there is a miner who consistently cheats. That is, she will include "Alice sent me 100 bitcoins" in every block she creates. If she became the first miner to find a passable hash, then she would get 100 coins. This scenario is not impossible. How does the mining algorithm prevent this?

This isn't possible because every node in the network enforces the consensus rules.

A miner is only allowed to include 1 transaction that moves coins with no previous inputs, which is the coinbase transaction. The output value of the coinbase transaction must not exceed the block reward plus any transaction fees from transactions in that block. If the value exceeds this amount, the block will be rejected by the network, and the miner loses the work they did to create it.

If the miner includes the "Alice sent me 100 bitcoin" tx by using previous outputs from Alice as inputs, they must be part of a valid transaction. That is to say, Alice must have signed those inputs to prove that she wants the BTC to be spent. If the miner includes them as unsigned inputs, the transaction is invalid, and any block they create including it is also invalid.


Acces Casa full node with Python I have a bitcoin-core full node running and I want to access my node in Python, how can I retrieve the blockchain info?

You can use RPC bitcoin framework for creating the request to the node to get information.

With python exist more library, I preferer this python-bitcoinrpc but a list the library is here

For configuring the node to accepting the request look this reference

other util references

Complete bitcoin.conf file
Gui generator bitcoin.conf
Api reference with other language
Official documantation command rpc


Why coinbase doesn't address callback? I am using PHP cURL to generate new address from coinbase. As per this documentation we get notification on the callback url when any transaction is made on the generated address. But I am not getting any callback from coinbase when I receive any payment.

I want to achieve the following:

Generate a bitcoin address
Store the the generated address & the amount with it's user who paid it.

I am facing the problem in getting callback. I get payment in the coinbase & email saying that you received this amount etc., but no callbacks.

Also please suggest me that whether the coinbase is secure or not.
If not, what should I go for? I want to get the above things done.

Give your website address in Merchant Settings then check by clicking Test


Is the tenebrix client safe? I'm fairly proficient in C++ and wondered if the tenebrix client was safe to use?

Also if I wanted to review the code myself, are there any warning signs I should look for without studying the code in detail?

Thanks

There are a lot of people who are hostile to any new crypto-currency, usually because of their vested interest in previous currencies. They tend to audit any new currency's code, looking for things that can embarrass the developers. There's a very good chance that any back door or serious problem would be widely publicized on sites like the Bitcoin forums.

You can certainly audit the changes yourself. Find the closest trusted code base (the one the code you're trying to evaluate is based on), and run a diff. Then look closely at all changes.

Alternatively, you can rely on the wisdom of crowds. Just wait at least a week or so before accepting any updates published by the development team. And search forums likely to be hostile to that project, such as the Bitcoin forums.


Can I use Blockchain API to get number of transactions at BTC address? When I go to blockchain to look at a BTC address I can see a count of the number of transactions that have been sent to that address.

So can I use the blockchain API to get this information?

I have taken a look at the blockchain API documentation and cannot see anything about it there.

It also looks like there is no support email at blockchain I could reach out to with a query like this.

You sure can!

Send a GET request to this address:

http://blockchain.info/address/$bitcoin_address?format=json

You'll get back something like this:

{
    "hash160":"660d4ef3a743e3e696ad990364e555c271ad504b",
    "address":"1AJbsFZ64EpEfS5UAjAfcUG8pH8Jn3rn1F",
    "n_tx":17,
    "n_unredeemed":2,
    "total_received":1031350000,
    "total_sent":931250000,
    "final_balance":100100000,
    "txs":[--Array of Transactions--]
}

The n_tx field will tell you how many transactions deposit or withdraw from that address.

Source.


Can multiple different addresses in a wallet be linked easily? Is it easy to link multiple transactions each with a different receive address to the same wallet?
What if after going to this wallet the Bitcoin was converted to Monero?

Chain analysis companies use many heuristics to link addresses into wallets.
The most popular being:

common input heuristic where all addresses are grouped by the premise of being inputs to the same transaction
change analysis heuristic which looks at the transaction outputs trying to group them by recipient and change address
other methods, like grouping through SPV vulnerabilities, time analysis, pattern analysis

But the easier way of getting the identity of the address is (for the law enforcement) to subpoena the exchange, which will link your identity to any address you used to interact with this exchange. You can't just "convert" bitcoin to Monero without using service like an exchange, or if you are really lucky you may try doing it P2P but this poses another set of risks.
But if you are looking into privacy features, I'd point you to implementations of coinjoin (Samourai, Wasabi, Joinmarket) which may help with breaking said heuristics.

Sources: https://en.bitcoin.it/wiki/Privacy


Why do so many Bitcoin websites have such bad reviews I'm very interested in starting out trading with a cryptocurrency but I've noticed every single website seems to have a low Trustpilot rating, full of one stars claiming the website is fraudulent etc. Is this just a common, untrue thing amongst Bitcoin trading sites?

There are indeed a lot of fraudulent online exchanges and wallet providers. The same is true for displeased customers.

I suggest you take a tour at https://bitcointalk.org and get to known which providers are trustworthy.
For trading cryptocurrencies, I'll suggest you start with Coinbase/GDAX or blockchain.info. Then based on what coins you are interested in, find another exchange that support them.

This page is also very helpful, it list the biggest online exchanges.
https://coinmarketcap.com/exchanges/volume/24-hour/


How do you derive the private key from two signatures that share the same k value? I wrote my own ECDSA signature algorithm just for the purpose of creating unit tests.

With it I created two signatures which went into transaction 56ec7ca7df..., sending from 1GXFXm3es.... These signatures used the same k values, although k values must never be reused.

Later on, someone was able to steal 0.0016 btc from 1GXFXm3es.... and send them to 17WRjamox6VhTUaHsTWfFnMNDYHvwCtWio.

So someone must be monitoring the blockchain for mistakes like this and stealing funds if they encounter them.

How do you derive the private key from two signatures that share the same k value?

ECDSA signatures are pairs (r,s) where r=(kG).x mod n, and s = (m + rx)/k mod n, where x is the secret key, k is the random nonce, and m is the message.

If you have two s values s1 and s2 for the same secret key and with the same nonce k (and thus the same value r), the following holds:

s1 = (m1 + r*x)/k
s2 = (m2 + r*x)/k

From that we can derive:

s1 * k = m1 + r*x
s2 * k = m2 + r*x
(s1 - s2) * k = m1 - m2
k = (m1 - m2) / (s1 - s2)
x = (s1 * (m1 - m2) / (s1 - s2) - m1) / r
x = (m1*s2 - m2*s1) / (r*(s1 - s2))
(all mod n)

So not only did you make it trivial to detect signatures with the same nonce (they have a recognizable r value), there is a trivial formula to compute the private key once someone sees two signatures.

This kind of attack has been known and actively exploited on the Bitcoin network since at least 2013: https://bitcointalk.to/index.php?topic=271486.0 . Don't reuse k values. Use RFC6979 to deterministically but securely generate them.

Also note that it's not sufficient that the nonces are different. They also can't be related in a known way. For example, you can't use k for one signature, and k+1 for the next work.


Who implemented BitcoinPayment at the Bitcoin wiki? Who was the technical person who implement/integrated BitcoinPayment at the Bitcoin wiki? How can he be contacted?

The history of the page suggests that Nanotube, MagicalTux and Rdymac were the last that edited the page.

The first two of them have contact instructions on their Wiki profile, only the latter does not.


What is the min relay min fee code -26? What is this code ?

66 : min relay fee not met  ( code - 26 )

I received this code after trying to send my
rawtransaction.

It seems that the fee provided by you is too low and it's total amount is lower than relay fee (==the minimum fee amount that can guarantee that your transaction would be retranslated to the net). You can find this amount by calling getinfo function and taking "relayfee". Currently "relayfee" is 0.00001000 at BTC Mainnet.


Running full node on OSX, how to tell if its working correctly? I'm running Bitcoin-QT 0.15.01 on an iMac (4 GHz Intel Core i7, 40GB RAM). It seems I am receiving the latest blocks, but is the rest working as it should?

I have opened port 8333 on my router and bitnodes is reporting that my node is accepting incoming connections.

Core reports 19 connections to the network but the log has a lot of errors like these:

09:20:08' progress=1.000000 cache=64.8MiB(478821txo)
2017-10-01 09:21:26 connect() to 65.130.52.89:8333 failed after select(): Connection refused (61)
2017-10-01 09:21:36 receive version message: /Satoshi:0.14.1/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1634
2017-10-01 09:21:44 receive version message: /Snoopy:0.2.1/: version 70001, blocks=0, us=N.N.N.N:8333, peer=1635
2017-10-01 09:21:44 socket recv error Connection reset by peer (54)
2017-10-01 09:21:46 receive version message: /Satoshi:0.14.1/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1636
2017-10-01 09:22:28 receive version message: /bitnode.lee/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1637
2017-10-01 09:22:49 UpdateTip: new best=000000000000000000792640fb97fb9a8ed07ba99b37479a48ebbeff3b1c1044 height=487782 version=0x20000000 log2_work=87.201974 tx=258394764 date='2017-10-01 09:22:42' progress=1.000000 cache=64.8MiB(479294txo)
2017-10-01 09:23:27 ProcessMessages(version, 111 bytes) FAILED peer=1638
2017-10-01 09:23:37 receive version message: /bitnodes.21.co:0.1/: version 70015, blocks=487780, us=N.N.N.N:8333, peer=1639
2017-10-01 09:23:39 Pre-allocating up to position 0x7000000 in blk01013.dat
2017-10-01 09:23:39 UpdateTip: new best=000000000000000000a86b2c788d7d3acd3493b05b2e8a626d7a5aca20a3ecc1 height=487783 version=0x20000000 log2_work=87.202013 tx=258397039 date='2017-10-01 09:23:00' progress=1.000000 cache=65.1MiB(482014txo)
2017-10-01 09:23:51 UpdateTip: new best=0000000000000000004927be61b84dc22202b49e55e635ce746023436c1ed14d height=487784 version=0x20000000 log2_work=87.202051 tx=258397146 date='2017-10-01 09:23:51' progress=1.000000 cache=65.2MiB(482144txo)
2017-10-01 09:24:04 socket recv error Connection reset by peer (54)
2017-10-01 09:24:07 receive version message: /bitcoin-seeder:0.01/: version 60000, blocks=350000, us=N.N.N.N:8333, peer=1640
2017-10-01 09:24:18 receive version message: /bitcoinj:0.14.4/: version 70014, blocks=437811, us=127.0.0.1:8333, peer=1641

Those are not errors/are benign errors. You have multiple connections and your node can be found on bitnodes. Your node is fine and working correctly.


Are there any super nodes in the network? Similar to BitTorrent trackers. Or are all peers equal in ability and importance?

There is a node that will relay all transactions, regardless of whether a fee is paid:

http://en.bitcoin.it/wiki/Free_transaction_relay_policy

There are well-connected nodes that are recommended for use by merchants to avoid risk to a race attack.  Some of them have inbound connection whitelists so as to lessen the risk of intentional address list poisoning.


What can make an unconfirmed transaction (0-conf) an invalid one other than Double-spend? It's obvious that inputs that already been spent will make the transaction invalid (pure double-spend scenario), but is there's anything else that could make a tx invalid?

Invalid inputs?
Invalid signature or other data?

For example, if I have a program that manages a wallet (keypairs are exclusively managed by it, and not by any human, and it's source is public) and it sends payments, can the recipient be insured that even 0-conf tx will be eventually valid and processes?

There are a lot of things that can make a transaction invalid. Note that an invalid transaction cannot be confirmed as the block that contains it would also be invalid, thus there is no such thing as a confirmed or unconfirmed invalid transaction.

Things that make a transaction invalid:

Spending an input spent by another transaction that is confirmed
Spending an input that does not exist
If signatures are required and must be valid, providing an invalid signature
If some data must hash to something provided (e.g. pubkey hash, scripthash), providing a piece of data that does not hash to the correct hash.
In general, any input script not validating to true
Negative output values
Sum of the output values is greater than the sum of the input values
A coinbase transaction outside of a block
A coinbase transaction that is not the first transaction of a block
A coinbase transaction where the sum of the output values exceeds the block reward

There's probably a few more that I missed, those are just a few that I can think of off of the top of my head.

  can the recipient be insured that even 0-conf tx will be eventually valid and processes?

No. There is no guarantee that an unconfirmed transaction will eventually confirm, even if it is valid. Note that transactions do not become valid; they are either valid or invalid upon creation.


Is there something like Mt.Gox Live but for Intersango? Is there something like Mt.Gox Live but for Intersango?

I don't expect the same quality, but at least to be better than this horrible bugged mess which is BitcoinCharts/BitcoinWatch.

There does not seem to be a chart like that for this website. Not every exchange provides a live chart on its own, and asides the two websites you mentioned, there aren't any other that would provide access to a more "live" feed.


How does Bitcoin protect against inflation? In an economy where the prices of goods keep inflating, like a car going from $10,000 to $20,000 in 1 year, what would be the incentive for people to put their money in Bitcoin? Wouldn't the price of a bitcoin stay the same or decrease because people need their fiat money even more?

Inflation is increase in price without increase in utility. A car with similar features helps you get from point A to point B just like it did one year ago (same utility). However, the cost of the car increased by 2x one year later (higher price) indicating that the currency in which the price has been quoted has been reduced to 0.5x versus its value last year.

In an economy, we have economic output and wealth generation that happens over the course of years. This is represented by increased technological progress that brings in new jobs and as a result improves consumption of goods in the economy. In traditional economics, government tends to stimulate this growth by printing money and spending it on projects like infrastructure, research etc. However, most of the times the increase in economic output trails the value of currency that has been printed. This means slightly higher economic output is now being represented by much higher money in circulation, which results in devaluation of the currency.

In Bitcoin, the supply is capped at 21M. As Bitcoin gets used in almost all of our day-to-activities, it will indirectly represent the global economic output. As technological progress increases outputs, the same number of bitcoins will represent a higher economic output every year. Thus value of a bitcoin tomorrow is worth more than what it is worth today. On a relative basis this means Bitcoin appreciates in value with respect to other fiat currencies.


How do I pay Utility Bills anonymously with Bitcoin? I can get my salary with Bitcoin: https://bitwage.com/
I can get loans with Bitcoin: https://bitbond.com/
Can I pay my utility bills with Bitcoin? If the naming pattern follows, there's a https://bitutility.com out there for me. I just haven't found it, yet.

So far, I've found bitwala.com, but I can't tell if they require a name on the payment.

Say, hypothetically that a Bitcoin user had reason to ensure his name goes with his physical address on as few documents as possible.

Assuming that a Bitcoin user has a pseudonymous account, how can that user, in general terms, use Bitcoin to pay utility bills with Bitcoin anonymously?

Alternatives:

Anonymous PayPal
One of those $200 prepaid VISA debit cards
Cash at the Utility's office

I imagine that the issues are mostly logistics, as the companies do not care who pays a bill as long as it's paid, right?

If you are in canada, Bylls.com is exactly what you are looking for. It is for Canadians only though.


"stable-coins": A formal definition? In crypto-currency news, we might heard about term of "stable-coins".

Can we define a stable-coin as follows:

  A crypto-currency that is pegged to a fiat / formal currency to minimize the volatility of its price for having more stable price.

(1) Is this definition true?

(2) And if yes, Is it possible to pegging a crypto-currency such as Bitcoin to a fiat/formal currency?

(3) And if yes, How to do it ?

(4) Which technical characteristics does a crypto-currency need to be a stable-coin ? (In the sense of consensus mechanism, transaction validation process etc)

(5) And are stable-coins decentralized and trust-less like Bitcoin ?

(6) What are the most well-known stable-coins crypto-currencies ?

Related questions:

Can the price of Bitcoin ever be stable to the USD?

What are the obstacles to pegging the value of bitcoin to an established stable currency?

Lets tackle them one by one:

1) Is this definition true?
Not entirely. Stable coin need not be pegged only to fiat currencies. We can also peg a stable coin to exchange traded commodities like precious metals whose price remain fairly stable. You can also have stable coins linked to cryptocurrencies via smart contracts.

(2) And if yes, Is it possible to pegging a crypto-currency such as Bitcoin to a fiat/formal currency? (3) And if yes, How to do it?
The value of bitcoin is not linked to any physical or virtual asset. It has a value of its own. Until the whole Bitcoin community that is involved does not decide to abandon the decentralized approach and peg it against an asset, it is not going to happen.

(4) Which technical characteristics does a crypto-currency need to be a stable-coin ? (In the sense of consensus mechanism, transaction validation process etc)
(1) In order to maintain the one-to-one peg ratio, Tether uses the Bitcoin blockchain, Proof of Reserves, and other audit methods to prove that issued tokens are fully backed and reserved at all times. The Tether transactional ledger is embedded in the Bitcoin blockchain as metadata via the embedded consensus system, Omni. (2) TrueUSD work with multiple trust companies. User needs to pass a KYC/AML check, and send USD to a trust company with an escrow agreement. When they verify the funds, their API instructs TrueUSD's smart contract to issue the equivalent TrueUSD to user's public Ethereum address

(5) And are stable-coins decentralized and trust-less like Bitcoin?
Physical asset backed cryptocurrencies are centralized as you need to hold a portion of physical asset for every stable coin you issue. Since asset backed stablecoins need to involve trust in the issuer (say US govt for USD) and the custodian (say Tether for showing they have the reserves) it is necessarily centralized. However, you can make stable coins which are decentralized. But those coins need to be backed by a decentralized cryptocurrency like say Bitcoin or Ether. The reason these stable coins are decentralized is because you can lock them in a smart contract.

(6) What are the most well-known stable-coins crypto-currencies?
(1) Tether, TrueUSD are examples of stablecoins linked to fiat currencies. They have a physical backing of USD for every coin out there. (2) DGX is gold backed stable coin. Tiberius coin is backed by a baset of industrial and precious metals. (3) DAI coin offered on MakerDAO platform is an example of crypto backed by crypto. The DAI is issued by depositing the collateral (pooled ETH) into a smart contract called CDP (Collateralized Debt Position) in accordance with the liquidation ratio of the CDP.


blockchain says Not enough funds i have 30-40 $ in my account

now i have pay for something but when i add 20$ amount i say Not enough funds.

and when i click on maximum it fill the field by 4.15$

what is the problem and how can i send money !?

as @mcccs mentioned i changed the network fee to a custom value and it show more fund to transfer

when i set the fee to max (137) the transferable fund is 4.15$


How to create an omnilayer transaction by myself? As far as I understand from reading a specification and this blogpost, creating Omnilayer transactions is a rather tough thing to do yourself, because format is quite intricate. Are there any examples on how to create and decode omni transactions in javascript/python? Or maybe there is even some lightweight library for this?

What I'm trying to do is to send my custom omni transactions to blockchain.info testnet and later discover them by another app. That's why I need to be able to both create and decode them. However I couldn't find any helpful resources on how to accomplish this.

A was able to do that. I posted a small snippet:

https://gist.github.com/caffeinum/f64a51ce55d5ac9075bb2f5f2f439c0d

If you're familiar with bitcoinjs-lib, the omni-specific piece of code for tx creation:

  const simple_send = [
    "6f6d6e69", // omni
    "0000",     // version
    "00000000001f", // 31 for Tether
    "000000003B9ACA00" // amount = 10 * 100 000 000 in HEX
  ].join('')

  const data = Buffer.from(simple_send, "hex")

  const omniOutput = bitcoin.script.compile([
    bitcoin.opcodes.OP_RETURN,
    // payload for OMNI PROTOCOL:
    data
  ])

  tx.addOutput(recipient_address, fundValue) // should be first!
  tx.addOutput(omniOutput, 0)

  tx.addOutput(alice_address, skipValue)

If you're insterested in working towards publishing small library, feel free to tap me at https://bykhun.com


Wallet takes way too much time to keep up to date? I would like to start using bitcoin more for day-to-day transactions. However, it takes way too long to keep my wallet up to date to be practical. I am using Bitcoin Armory, though I have had this problem with every bitcoin wallet software I have tried so far.

I don't have a super powerful machine, 64 bit OS, 8 core CPU @ 1.6 GHz each, 6GB RAM, Radeon 6570m GPU, no SSD. My laptop becomes noticeably slower and almost unusable when the bitcoin software is running. Thus I have to turn it off when I need to use my computer. But if I leave it off for 12 hours, it takes on the order of 12 hours to resync.

I feel like I MUST be doing something wrong. Does everyone using bitcoin really have a 24/7 dedicated box (possibly in the cloud) to keep their wallet up to date? This isn't practical for me at all, especially since it takes longer and longer to sync each time as the number of transactions per day increases.

Note: for security reasons I am not willing to use an online service that holds my wallet.

How can I make using bitcoin more practical? I have heard about using clients that don't download / maintain the full blockchain, but doesn't this defeat the purpose of being able to verify the transaction ledger myself?

Try Multibit. It's a light-weight client.


how are lightning network payments instant and secure at the same time? I have a question regarding lightning network. It's a bit of a long question so please bear with me.

If have 1 bitcoin in my wallet and buy an item costing that amount from a shop. I leave the shop before they have a confirmation (before it's put into a block).

It's my understanding this would put the shop at risk as i still have the 1 bitcoin technically in my wallet as the transaction with the shop is still floating around in the meme pool.

I could at this point create a new transaction sending the 1 bitcoin to another wallet owned by myself. I could attach a relatively large miner fee to this transaction.

This transaction would probably then get put into a block before the shop transaction. If this happened the shop transaction would now be considered invalid as according to the block chain i now have 0 bitcoin in my wallet.

This is why the shop needs to wait for 1 confirmation before allowing me to walk out of the shop with the purchased item.

The problem here is i could potentially be waiting for around 10 minutes before confirmation is received. Bitcoin isn't exactly user friendly from the shops point of view.

I have heard lightning network solves this issue but i don't fully understand why.

My understanding is to open a LN channel with the shop a transaction is created on the main bitcoin block chain.

This transaction would be saying to take 1 btc from my wallet and 0 btc from the shop's wallet and open a multi sig wallet. My understanding being the multi sig wallet is a temporary address which will remain active until the LN channel is closed. When it's closed a new transaction would be created distributing the funds to my wallet and the shop's wallet depending on where the funds were in the LN channel when the channel was closed.

My question is how do confirmations work with regards to the initial transaction which opened the LN channel? When the LN channel is opened presumably this transaction is in the meme pool.

Can i send the 1 btc to the shop in the LN channel while that transaction is still in the meme pool? If yes then surely it's the same situation as before where i could then create another transaction on the main blockchain for 1 btc and if that transaction gets put into a block before the LN transaction is put into a block then the LN transaction would now be invalid.

Basically i don't understand how LN allows instant payment in a shop while maintaining security of that payment from the shops point of view.

I know i must be not fully understanding how this process works. Can anyone shed some light on this?

This is a very good question and I will give a quick summary of what is happening here. The longer version can be seen on my educational video on how to create payment channels starting at 33:41 (though I would recommend to watch from the beginning to review bitcoin and notation.)

  My understanding being the multi sig wallet is a temporary address which will remain active until the LN channel is closed.

yes this is true! The key is a multi sig address which already prevents the attack setting to the shop which you discribed in the onchain bitcon setting without confirmations. If only you need a key for a double spend you can double spend. In the setting of the multisig you would need collaboration from the victim (shop) which would not do help you

  When it's closed a new transaction would be created distributing the funds to my wallet and the shop's wallet depending on where the funds were in the LN channel when the channel was closed

I think this is where you might not have the concept fully right. While it is true that the funds from the multisig wallet will be moved according to the distribution of funds to the two channel partners the initial transaction that spends those funds will be created even before the channel is opened by sending funds to the multisig from which this commitment transactions spends.

All that being said. the funding transaction is not in the mempool as you guessed but in fact confirmed within the blockchain for the channel to be open and operational. So for an initial channel opening (unless using the somewhat special setting which allows turbochannels) one also has to wait for a couple of confirmations to use the channel safely. The setting with the shop also would not require you to have a direct channel with the shop. As soon as both you and the shop have channels connected to the network you should be able to pay the shop over a path of channels without the necessity to open another channel with the shop.


How can you check the amount in your blockchain or bitcoin address online? How can know or check your blockchain or bitcoin account address to know amount on it?

You can look up an address on a block explorer such as http://blockchain.info.  Just paste the address into the search box, and you will see a list of all transactions going in and out of that address, and its current balance.


Is there a way to accept bitcoin payments and verify the identity of the people who paid without asking for any other information? I have a website and I am considering supporting bitcoins, but I would like to do this without asking the users to log in nor give me their email or details before buying.

Is there a way to accept bitcoin payments and verify the identity of the people who paid without asking for any other information?

I would like the buyers to claim their product after they pay, using the transaction id, the confirmation number, the address... or something like this, so I do not have to ask for any other information before they buy, but I can be sure that I deliver the product to the right person.

That is, you can pay directly using my btc address (that will be different for each transaction) and you do not have to enter anything else.
After the transaction is confirmed, you can come back to the website and you can claim the product entering a "code". (Only then you'll be asked for the email or more details).

Can I use the pair of transaction addresses as this code? Is this secret or other people will be able to claim they paid?

Thank you very much!!

You could have the customer send a message signed with the Bitcoin address used. This can be done with most Bitcoin clients or with most of the online wallets. This proves they have access to the private key for that address and are the owner.

Where they send the email from is not important as long as you can verify the message.

https://blockchain.info/wallet/features

  Sign Message - Sign a message to prove you own a bitcoin adddress.

https://bitcoinarmory.com/start-page/what-is-armory/features/

  Message signing with your Bitcoin addresses:   sign messages using the private keys of your bitcoin addresses, that can then be verified by someone else.  For instance, you pay someone 200 BTC for merchandise to be shipped to you.  You send the seller your postal address, but someone intercepts the message and replaces it with their own address!  This is avoidable by using signed messages:  the seller sees the money came from address X, so you send them a signature block, which tells them your postal address, and sign it with address X.  If someone tries to change the address, the signature will become invalid!


How proof-of-work detects Sybil attack in Bitcoin? I read in several paper that PoW deters Sybil attack in Bitcoin. However, there is no enough explanation about how proof-of-work detects Sybil attack in Bitcoin?

PoW does not detect sybil attacks, it prevents them. Sybil, or sockpuppet, attack means that an attacker can spawn a large number of nodes which they control.

If your full node suddenly finds itself connected to fake nodes spawned by an attacker which claim that difficulty of the block they are sending you is much less than it was upto now, your node will know something is wrong and discard those blocks. The idea is that those fake nodes would have to mine at the current difficulty, but at that point they are not fake/sybil nodes, they are miners.

Similarly, when you run a full node for the first time you need to be able to connect to other nodes in the network to receive all the blocks that occured in the network so far. If by some chance your node connects to attacker's nodes they could try faking the transaction history. But since each block contains the difficulty at which it was mined, fake nodes being regular pc's or something like that would produce blocks at very low difficulties. If you ever connected to a real node, you would quickly discover that your node is under attack and receive the real history.

The point is that if the fake nodes wanted to produce blocks at anything close to the current difficulty, they couldn't be just regular PC's and just fake the difficulty. They would have to be miners like the rest of the network, but then they are entering the race with other miners to produce blocks (or are trying to pull off a 51% attack).


Why are all popular crypto currencies deflationary? There is a lot of criticsm and debate over whether bitcoins will ultomately fail because of its deflationary nature.

I don't want to debate if that's the case or not and I also understand that the goal of bitcoin was to have a fixed amount of coins so that there is no risk of (hyper)inflation.

What I'm wondering is, would it be technically possible for a crypto currency to have a fixed target inflation rate? For example the european central bank has a target inflation rate of 2% (I think) which is supposed to stimulate growth while at the same time avoiding over-inflation.

So I guess my question boils down to: Why are all popular crypto currencies deflationary? Is it a technical problem that cannot be solved or is there another reason it was designed like this?

There's no technical problem with making an inflationary crypto-currency. For Bitcoin, just changing the block reward schedule would do it. And there do exist crypto-currencies that have perpetual block rewards.

The thing is, the set of people who believe that inflationary currencies are good doesn't significantly overlap the set of people who think that currencies don't need to be managed by central banks. So there's not much of a market for such currencies. It's kind of like a veggie burger with bacon.


Bitcoin core installation I need to configure the bitcoin core and synchronize the bitcoin network.
I have bought a server with 1GB ram and 20GB hard disk space is it possible to run bitcoin run in this machine ?

Can someone help me to install and configure the bitcoin
Thanks in advance.

Since you mention a server, you'll probably want to run the daemon, bitcoind.

The size of the blockchain has eclipsed 20 GiB a long time ago, so you'll want to run with the flag -prune=<n> which gives a limit for the storage used for the blockchain data. The blockchain data will still be downloaded and verified, but old parts will be discarded once the limit is reached. n is given in MiB. There are some other data requirements, so you should leave some space, e.g. -prune=5000 would leave you with approximately the last five weeks of blockchain data. If you want to access all transaction data, you would need to invest in more hard disk space to be able to run without pruning.

Unless you want to actively use it for transacting, you should run it with -disablewallet to save some resources.


Intuition for Simplicity's CheckSigHashAll So, I downloaded Simplicity and started a REPL using cabal new-repl Simplicity. Then I enabled type applications using :set -XTypeApplications.

Consider these invocations:

> (pkwCheckSigHashAll @CommitmentRoot @() lib (Schnorr.PubKey True (read "0")) (Schnorr.Sig (read "0") (read "1")))
CommitmentRoot {commitmentRoot = Hash256 {hash256 =
"\CAN\r\201\231\SO0:1\183\130a\DC3m4u!\193\247e\EOT\194nO\US\208\150\&2\182\ACK\203\151>"}}

> (pkwCheckSigHashAll @CommitmentRoot @() lib (Schnorr.PubKey True (read "1")) (Schnorr.Sig (read "0") (read "1")))
CommitmentRoot {commitmentRoot = Hash256 {hash256 =
"\215\222oj\251&\134\SOZ\202@N\161(\185j2\DELt\156\147\136Nz\183\179\EOTH\166\FS\141F"}}

> (pkwCheckSigHashAll @CommitmentRoot @() lib (Schnorr.PubKey True (read "1")) (Schnorr.Sig (read "0") (read "0")))
CommitmentRoot {commitmentRoot = Hash256 {hash256 =
"\215\222oj\251&\134\SOZ\202@N\161(\185j2\DELt\156\147\136Nz\183\179\EOTH\166\FS\141F"}}

If I understand correctly, the commitment root goes into an transaction output. Since the signature shouldn't play a role, the output from Haskell makes sense since I change the sig and it doesn't affect the commitment root. The example above seems consistent with this intuition. Are both my intuition and the example code correct?

Now, I can call the same method with WitnessRoot:

> (pkwCheckSigHashAll @WitnessRoot @() lib (Schnorr.PubKey True (read "0")) (Schnorr.Sig (read "0") (read "0")))
WitnessRoot {witnessRoot = Hash256 {hash256 =
"\185\FS\176\179\b{Xc2\216\n\240\186\205v\208\164NW\\\DLE\193:\ETB\bMO\211\152*I%"}}

> (pkwCheckSigHashAll @WitnessRoot @() lib (Schnorr.PubKey True (read "1")) (Schnorr.Sig (read "0") (read "0")))
WitnessRoot {witnessRoot = Hash256 {hash256 =
"\240h\NUL\188z4\ACK\200\ETX\151\DC1&Y\253\t\152\176P\146\186\137\NAKm!\STX\DC3\182\148\193\246\172O"}}

> (pkwCheckSigHashAll @WitnessRoot @() lib (Schnorr.PubKey True (read "0")) (Schnorr.Sig (read "0") (read "1")))
WitnessRoot {witnessRoot = Hash256 {hash256 =
"\205\DEL\132Q\245\166!\196\178\248\136\194aO\243+\145T\200E\129I#\253F\134\173i\243K\154J"}}

Again, if I understand correctly, the witness root goes into the spending transaction input. It seems like the witness root is affected if I change either signature or public key, which corresponds to my intuition. Simplicity uses BIP-Schnorr which doesn't allow for pubkey recovery. Again, is my intuition consistent with the above code?

I assume these hash values contain mock transaction metadata like nLocktime, embedded in the lib, correct?

Now, let's say I wanted to do a 2-of-2 MAST-based multisig with Simplicity, how would that look like? There must be a way to compose two different calls to CheckSigHashAll. And the spending transaction would surely need to provide a MAST path through the script, how do I pass that to Simplicity? With oooh?

Your understanding of the commitment root is correct.  Taking advantage of Haskell's laziness, feel free to put undefined into the signature when computing the commitment root.

At the moment, the witness root is not used in the protocol.  There are some ideas on how to use it in more sophisticated protocols, but those ideas haven't been realized yet.  However, the witness root has some uses in testing and development regardless.

Simplicity doesn't use BIP-Schnorr per se.  Rather checkSigHashAll is a Simplicity expression that implements an old draft of BIP-Schnorr.  If you want a signature scheme that supports key recovery, you could implement such a scheme in Simplicity.

Neither the commitment nor witness roots contain any transaction data, mock or otherwise.  Instead the checkSigHashAll Simplicity expression contains primitives that, during Simplicity execution, return the transaction's locktime and version

To make a simple 2-of-2 multisig you could write something along the lines of

 pkwCheckSigHashAll <pubkeyA> <sigA> &&&
 pkwCheckSigHashAll <pubkeyB> <sigB> >>>
unit

Since both branches are used in a 2-of-2 multisig, there are no MAST branches.

To make a 1-of-2 multisig you have some options.  One way is

 witness <value of type (Bit, Sig)> >>>
 cond (scribe <pubkeyA> &&& iden) (scribe <pubkeyB> &&& iden) >>>
 checkSigHashAll

However, even after pruning (turning the case within the cond into an assert), the program appear a lot like a 1-of-2 multisig.

Another implementation could be

witness <value of type Bit> &&& unit >>>
cond (pkwCheckSigHashAll <pubkeyA> <sigA>)
     (pkwCheckSigHashAll <pubkeyB> <sigB>)

In this case after pruning it looks like a 1-sig-or-something else.  Pruning transforms the above expression into something like

witness <0> &&& unit >>>
assertl (drop (pkwCheckSigHashAll <pubkeyB> <sigB>))
        (commitmentRoot (drop (pkwCheckSigHashAll <pubkeyA> <sigA>)))

where only the commitment root of the untaken branch is revealed.

Be aware that as of the time of writing this, pruning has not been implemented, nor is it the case that pruned expressions are yet enforced by the implementation.  You can still prune expressions by hand though.


How to recover an old wallet.dat file Back in 2011 when bitcoin started to make the news, I created a wallet and let it run for a bit (no pun intended). It almost fried my computer so I stopped. In the process, I think I remember I mined 0.05 BTC. Before deleting the app from my Mac, I've saved a file called wallet.dat somewhere.

Today out of curiosity I googled the conversion rate and saw that 0.05BTC are worth about 45 USD.

What can I do to recover that file? I've opened a Coinbase account but I don't see anything about importing files. I'm on Mac OS, if it matters...

EDIT: I've now installed Bitcoin-Qt. I've replaced the wallet.dat file. It says

"wallet out of sync", balance = 0.05BT

It also says "synchronising network" but it's been 15 minutes and the progress bar barely seems to be at 1%.

Bitcoin-Qt is a full p2p network client, so to work, it needs to sync with the network. Basically, it will download every transaction that was done with the currency (~15 GB in total at the moment). Might take one or two days, then you'll be good to go.


NoClassDefFoundError when using Java Coinbase API I've simply downloaded an API .jar file of a Coinbase. I've created a project dynamic web project. I added successfully into a reference library that API.

Here is my simple program:

import com.coinbase.api.Coinbase;
import com.coinbase.api.CoinbaseBuilder;

public class Main {
    public static void main(String[] args){

        try {

            Coinbase cb=new CoinbaseBuilder()
            .withApiKey(System.getenv("My API KEY"), System.getenv("MY API SECRET"))
            .build();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

As i run this program, it says:

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/type/TypeReference
    at com.coinbase.api.CoinbaseBuilder.build(CoinbaseBuilder.java:16)
    at Main.main(Main.java:11)
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.type.TypeReference
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more

Do I need to put something here? I'm did checked thrice, My API key is correct!

Well the problem is that the Coinbase Java Api depends on the Jackson JSON processor, along with several other dependencies that can be found here, and I'm assuming that the jar that you download didn't come with all of these dependencies packaged inside it which means that they won't be on your classpath just because you've added the coinbase jar. You could either try to resolve these dependencies manually, which would be incredibly tedious and unnecessary, or you could use a build automation tool. Considering that the Coinbase Java API was built with it in mind I would recommend setting your project up to use Maven.


Which wallet application lets you send to multiple output addresses with just 1 fee? Which wallet applications lets you send to multiple addresses from one output? I'm looking to build a physical bitcoin kiosk faucet and was looking to see how I would avoid miner fees if i combined all the faucet output addresses into just 1 transaction.

I'm sure you can do it with bitcoin core, but was wondering if other wallet apps like blockchain.info and others can do the same?

And what would the command be to send a transaction with multiple output addresses for bitcoin core?

You asked two questions, I can answer only your second question: the command for sending to multiple addresses using bitcoin core.

It is done by building a "raw transaction". This sounds and looks much more difficult than it is in practice. It involves the following steps:

Select enough unspent outputs to fund your transaction
Select the addresses and amounts you will be sending
Add an extra txout with your address and change minus the fee (to prevent sending all change to the miner)
Build a raw transaction using the unspent outputs and list of addresses and amounts
Sign the raw transaction
Send the raw transaction into the bitcoin network

You will have to do some programming for step 1,2,3.
Bitcoind will handle step 4,5,6.

You can follow the steps in this excellent demo: https://people.xiph.org/~greg/signdemo.txt

Good luck!


Why was the RIPEMD-160 hash algorithms chosen before SHA-1? Bitcoin uses both SHA-256 and RIPEMD-160 hashes. Most often a double-round SHA-256 is used, but for address generating, RIPEMD-160 is used because it generates a shorter hash value. RIPEMD-160 has a 160-bit or 20-byte hash value while SHA-256 has a 256-bit or 32-byte.

So RIPEMD-160 is used for it's shorter hash. However, SHA-1 also produces a 160-bit hash. RIPEMD-160 is a less popular algorithm but in fact achieves exactly the same as SHA-1 does.

The only real difference I can find on the internet is in the following fragment from RIPEMD-160's Wikipedia page:

  RIPEMD-160 was designed in the open academic community, in contrast to
  the NSA designed SHA-1 and SHA-2 algorithms. On the other hand,
  RIPEMD-160 appears to be used somewhat less frequently than SHA-1,
  which may have caused it to be less scrutinized than SHA. RIPEMD-160
  is not known to be constrained by any patents.

Are patent issues the reason? Why is SHA-1 a problem but SHA-256 not? I know that SHA-1 and SHA-2 (of which SHA-256 is a part) are different iterations of the SHA initiative and so probably have very different legal implementation.

Does anyone really knows why RIPEMD-160 was chosen before the more popular SHA-1?

There are a multitude of reasons.

As @ThePiachu mentioned, there is a theoretical 2^60 bit attack that is possible on SHA-1, meaning that the algorithm is weaker than designed.

RIPEMD-160 was designed in the open academic community, in contrast to the NSA designed SHA-1 and SHA-2 algorithms.
It is worth noting that Satoshi could've used SHA2-256 twice and truncated the second digest to 160 bits as this is equally secure. The fact that he didn't is some evidence to show that his decision was a conscious decision to use RIPEMD-160 over the NSA suit of algorithms.

Lastly, I believe RIPEMD is based on a different design to the SHA1/SHA2 algorithms, and thus attacks that apply to one may not be transferable to the other (which is good).


Convert a list of 64 hex keys to private import format Is there a python script that i could use to convert a list of private hex keys to there import format in bulk?

How would I go about this..

Could this be adjusted to take a .txt list of hex addresses and convert the to private import format, then print the results to a txt file?

In [1]: import base58
In [2]: hexstring= "00010966776006953D5567439E5E39F86A0D273BEED61967F6"
In [3]: unencoded_string = bytes.fromhex(hexstring)
In [4]: encoded_string= base58.b58encode(unencoded_string)
In [5]: print(encoded_string)
16UwLL9Risc3QfPqBUvKofHmBQ7wMtjvM

You should consider using this (or a similar) python library to import your keys, as straight conversion from hex to base58 can have a few gotchas:

https://github.com/vbuterin/pybitcointools

Check the examples in the README and you should be on your way to making your script.


Transforming private key into address How do I get to the value in the 'scriptPubKey' part of the transaction ? shows a great example of going from address to scriptPubKey.

I'd like to do something similar: go from private key (ECDSA) to address.  How do I do that? References to libs or code, as in the above question, would be appreciated.

From a privatekey (ECC, 32Byte) to an P2PKH address:

Ensure the private key is a valid ECC privat key (libsecp256k1 function)
Calculate the public key from the private key (complex math. function, use a library)
Calculate the RIPEMD160 hash (aka Hash160) from the public key
Do a base58check encoding of the hash160 with a prefix byte 0x00 (for mainnet) or 0x6f for testnet

C code to explore:
https://github.com/libbtc/libbtc/blob/3331ec47ca4ad33e8f2e46e6f01dfbeae090c53d/src/toolfunc.c#L22


Getting a bitgold prepaid debit card Can someone tell me what the process is of getting a bitgold prepaid debit card and if I can use it just about anywhere? Does anyone have one of these cards and what is your experience with them?

Getting a prepaid card on BitGold is pretty easy, you just have to sign up for an account, make sure you have you deposit 1 GAU (gram of gold) on it and request one by providing an id document and a proof of address.

You can use wherever they accept a MasterCard, pretty much everywhere. I personally tried it in Canada and Italy, and it worked flawlessly.

Please note that, even if you can get GAUs by depositing your BTCs, you cannot currently load them directly on the card, since you can really deposit only on the Dubai Vault, and you cannot load the card with the gold in Dubai.

This is intended, and you can ask to the customer support for more information on why is that so.

As a reference, you can check the FAQ on the website.

And this article on how to apply for a prepaid card.

Enjoy your BitGold account :)


Does the BFT solution from lamport guarantee liveness? Solution: https://people.eecs.berkeley.edu/~luca/cs174/byzantine.pdf

Although there is a lot of material about this, I am still not sure what the answer is. I found two different statements:

Yes, it does guarantee both liveness and safety as long as 66% are honest.
No, if there is a certain amount of delays, it cannot guarantee safety.
https://cs.nyu.edu/rgrimm/teaching/sp07-os/bft.pdf , slide 9

If it is 2., what is the intuitive reason for this to happen? Is it because if the some messages never reach the nodes, they cannot know what the majority of the other nodes are doing/communicating and therefore cannot forward their own decision?

Note: I know this is not a bitcoin specific question but there is no general blockchain forum here.

Lamport et al's paper describes multiple problems, each with a unique situation. Liveness is solved for all of those situation as long as the network is synchronous. The original paper doesn't attempt to solve for asynchronous networks, and in fact later work proves that it is impossible to solve consensus in asynchronous networks (FLP).

A latter paper figured out how to guarantee liveness in partially synchronous network (PBFT).

So the accurate way to restate your two bullets:

Yes, it does guarantee both liveness and safety as long as 2/3rd +1 are honest and there is a known maximum to the delays (aka the network is synchronous).

The intuition on why asynchronous networks make the problem hard is that an honest node A who has yet to receive a message from a different node B can't be sure whether B has decided not to vote, or, if B does plan to vote eventually.


Why one would need *extended* public keys for auditing a bip32 wallet? (I am reading the bip32 for an altcoin development.)

In the bip32 specification, it is written that listing all incoming and outgoing payments of a hierarchical deterministic wallet would required the extended public keys.

  In case an auditor needs full access to the list of incoming and outgoing payments, one can share all account public extended keys. This will allow the auditor to see all transactions from and to the wallet, in all accounts, but not a single secret key.

Wouldn't the (non-extended) elliptic curve encryption's public keys work too ?

Furthermore, if I understand the spec properly, sharing an extended public key isn't really safe since knowing a descending non-hardened private key would then expose all the keys descending from this first extended public key...and sharing a non-extended public key would avoid the problem.

Why one would need extended public keys for the auditing a bip32 wallet?

You don't need them. You could also just make a list of all of the addresses that have a balance, and send that to your auditor.

Auditing a Bitcoin wallet is not a very good example of what this is capable of. Here are some other uses of BIP32:

You could have a script on a server with an extended public key generate addresses for people to donate to, without having that same server be able to spend money sent to those addresses. Without BIP32, you'd have to make a long list of addresses, put them on your server, and replenish them whenever they ran out.
You could have an e-commerce app generate addresses like the above, and detect payments to those addresses without, again, having the ability to spend them.

  Wouldn't the (non-extended) elliptic curve encryption's public keys work too?

No. You also need the chain code to calculate the subkeys. Collectively, these two things make up an extended public key.

  Furthermore, if I understand the spec properly, sharing an extended public key isn't really safe since knowing a descending non-hardened private key would then expose all the keys descending from this first extended public key.

It's... debatably safe. I don't think there's a real-word situation where someone would compromise one of your non-hardened private keys without having access to all of them.


With Ripple, how can I move my wallet to/from Payward? When I created my ripple wallet, I selected local computer.  Now I want to be able to access my wallet from any computer.  How can I move my ripple wallet to the server?

Or suppose I want to remove my wallet from the Ripple server (why would I want to do this?), what is the correct approach?

I'm seeking for an authoritative answer for myself, but it seems the answer to the first question is:

  On account creation (and whenever you login) you can set the "Fetch
  wallet from" option to one of "Payward", "Payward and Local Browser"
  or "Local Browser".

source


That is not something specific to version 2 transactions.

What you are looking at are the marker and flag bytes for a segwit transaction. Segwit transactions have a slightly different transaction format which is specified in BIP 144.


How to setup USB Cold Storage for Bitcoin and Monero? Is it possible to keep many currencies (Bitcoin, Monero...) on one USB drive? If not, how can I setup USB Cold Storage for Bitcoin and Monero?

Yes, it is possible.

The difference between a HDD and a USB stick is HDD is attached to your computer most of the time exposed to internet, USB sticks on the otherhand can be taken out and can be kept in a vault. Therefore you can store multiple cryptocurrencies in a USB stick.


What are some good solutions for analyzing Bitcoin script patterns? I'm interested in analyzing the Bitcoin blockchain for occurrences of particular scripts and spending patterns. What are some good solutions for this? An ideal solution would let me filter transactions and outputs based on the contents of the locking and redeem scripts of single outputs as well as chains of outputs spending each other.

I've thought about looping over blocks and transactions with the Bitcoin Core RPC interface. This strikes me as probably not the most efficient solution, as I/O with bitcoind would probably be a bottleneck. Another solution would be to parse the raw block files, load them into memory (in a streaming fashion, as I don't have 200+ GB of memory...) and operate on them there. That sounds like a lot of work, so I was hoping there are some existing solutions for that out there.

It seems that bitcoin-iterate implements your second suggestion:

  This is some fast code to iterate over bitcoind's block files to extract blockchain data from the main blockchain.

But as far as I know it doesn't allow your to filter by script. That would be a nice addition to the project, I think. Or you could write something similar that did that.