How to get the Extended Public Key Hello I have the following code that generates a Public Key, Private Key and BTC Address.

import hashlib
import ecdsa
from base58 import b58encode_check, b58decode_check
import os

def pubkey_to_address(pubkey: bytes) -> str:
    if 'ripemd160' not in hashlib.algorithms_available:
        raise RuntimeError('missing ripemd160 hash algorithm')

    sha = hashlib.sha256(pubkey).digest()
    ripe = hashlib.new('ripemd160', sha).digest()
    return b58encode_check(b'\x00' + ripe)

def generate_new_keys() -> list:
    signing_key = ecdsa.SigningKey.generate(curve=ecdsa.SECP256k1)
    verifying_key = signing_key.get_verifying_key()
    my_address = pubkey_to_address(verifying_key.to_string())

    return signing_key.to_string(), verifying_key, my_address

So when I use this function (generate_new_keys) I will get all the important keys.

Now I'd like to get my Extended Public Key to generate more subaddresses. Any idea where to start?

I've tried this library but It seems unsafe for BTC: https://github.com/ranaroussi/pywallet

You can try this (disclaimer: I wrote it) and do the following:

from btctools import Xprv

>>> xprv = Xprv.from_mnemonic('impulse prize erode winner pupil fun off addict ...')
>>> xpub = xprv.to_xpub()
>>> xpub.encode()
'xpub661MyMwAqRbcFJwcugErEvzSgeKwGgHeLyzWKKK4C3edVRDbCU8o2pueJ5S26cXgPQQVRxQXyuoKrScnNKzohc4YNefs4zXg8tAhSLfnFo7'

>>> xpub/0/0/1
Xpub(path=M/0/0/1, key=039ec9190c3469b70f55a50466c7514b881ebe83b6215e94ed727854e1724ca811)

>>> xpub.address('P2PKH')
'1Fh2JwDc87R2BSXmcRYQPgRR5ntn5LuabK'


If Bitcoin is ratified as a currency would its code be BTC? At present it seems that the de facto code for bitcoins seems to be BTC. There has been some discussion of this over on the forums and an entry on Wikipedia, but I thought I'd ask the question here to arrive at an easily recognised community answer.

So, if bitcoins ever became ratified as a currency under ISO 4217 (paywall, PDF) would it be given the code BTC? If not, then what other serious contenders are there?

The normal rule is (two letter country code) + (letter), although that's arguably already been broken by the Euro having EUR instead of EUE.

BT is the country code of Bhutan, whose currency has the code BTN. If anyone will object to BTC for Bitcoin, it'll be them.

According to wikipedia, which is never wrong, multi-national currencies use the X prefix. XBC is taken by "European Unit of Account 9", but XBI is available.

http://en.wikipedia.org/wiki/ISO_4217


Does hardware specialization provide security against 51% attack via on-demand computing? I've heard it argued that when a mining algorithm is prone to hardware specialization, the centralization that introduces (e.g. one factory producing 25% of all ASICs) is a security risk.

I'm wondering if there's also a security benefit to hardware specialization: Since the amount of on-demand computation available to purchase may vastly exceed the amount of computation going into mining a cryptocurrency, is there a risk of someone executing a 51% attack by briefly renting an amount of computation greater than the network's?

If that's a significant risk, does hardware specialization mitigate it by increasing the miners' computing power relative to the power of general-purpose on-demand computing?

Does hardware specialization provide security against 51% attack via on-demand computing?

It depends on what hardware the on-demand computing is offering. Hardware specialization might make a cryptocurrency less vulnerable to attack from inefficient on-demand hardware, like a botnet. But as hardware becomes more specialized, the on-demand hardware leasors tends to upgrade their hardware to stay competitive.

Keep in mind that the effectiveness of one's mining is relative to the total hash power of the network. If everyone on the network doubles their hashing power, everyone will continue earning the same # of coins after the difficulty adjusts.


How does BitPay manage to confirm transactions so fast (less than a minute)? I believe it takes about an hour for 6 confirmations. (Edited from David Schwartz's comment)

However, when I purchased some stuff from merchants who used BitPay, the payment/orders were confirmed in like 20 seconds or so?
Since BitPay is confirming the order before 6 confirmations, how does it protect itself from double spending attacks?

BitPay takes all the risks of a double-spend and they don't wait for any confirmation to make the user feel good with the purchase. The merchant doesn't care because they'll receive fiat and most of them are not direct access purchases.


Ramifications of creating Electrum 2.x seeds which are not BIP39 Electrum 2.0 seeds (mnemonic phrases) are created with a checksum based algorithm (such that the hmac_sha512 starts with 01. It's usually a 13 word seed, but can be 12 in some circumstances.

If all 12 word Electrum 2.x seeds were filtered such that they are not BIP39 compatible, what is the decrease in entropy going to be?

=> The question pertains to this Python code

I guess the problem can be summed up as:

What is the percentage of 12 words Electrum 2.x seeds (relative to 13 word seeds)?
What is the percentage of Electrum 2.x (12 word) seeds which do not meet the BIP39 standard? (The last word decides the checksum)

For the purposes of this answer, I'll assume we're only talking about mnemonics which can be generated by Electrum 2.x, and not ones that are simply accepted by Electrum 2.x for restore (the latter number is infinite).

  What is the percentage of 12 words Electrum 2.x seeds (relative to 13 word seeds)?

Electrum 2.x seeds by default encode 136 bits of data. Any leading zero bits are ignored during encoding, so the resulting mnemonic length varies.

Each word encodes log2(word_list_length) bits of data, so for most* Electrum 2.x word lists, that's log2(2048) = 11 bits per word.

Therefore 13 and 12-word long mnemonics can encode up to 143 and 132 bits of data respectively. In order for a 136-bit seed to be encoded into 132 bits (12 words), at least the first 4 bits must be zero, which happens with probability 1 in 24, so 1 in 16 random mnemonics will be of length 12 or fewer.

Likewise, for an 11-word mnemonic, encoding 136 bits into 121 bits requires that 15 leading bits must be zero, so 1 in 215 or 1 in 32768 will be of length 11 or fewer.

Finally, if you need an exact answer, it would be 1/16 - 1/32768 = 2048/32768 - 1/32768 = 2047 in 32768 will be of length 12 exactly.

* For the Portuguese word list, it's log2(1626) ≈ 10.67 bits per word

  What is the percentage of Electrum 2.x (12 word) seeds which do not meet the BIP39 standard?

12-word long BIP-39 mnemonics have 4 bits of checksum, so 1 in 24 generated 12-word Electrum 2.x mnemonics will happen to be valid BIP-39 ones, and 15 in 16 Electrum ones will be invalid for BIP-39.

  If all 12 word Electrum 2.x seeds were filtered such that they are not BIP39 compatible, what is the decrease in entropy going to be?

I'm interpreting this as asking: If valid Electrum 2.x mnemonics were required to be invalid BIP-39 ones, by how much would this decrease their entropy?

Wolfram|Alpha says very small: about 0.0056 bits based on this input:

solve  (2^n - 1) / 2^n = 2047/32768 × 1/16  for n


Why some transactions disappear from the mempool? Just before block 537562, I had the following transactions in my mempool:

 'a4ca904361952c8a27bcf1fd36e5bc8ccdc5d42ceb72cfba60c017fb9cbbb0e5'
 '69718e60b6e7d20d5e56e097b2de9789007fb230d0205a90a1411ef8086672a0'
 '346b93674d91bfc5b5568f7e77dc969b5c87351135a1c75d551c1418533164f2'
 'e8fddfc634f2e3d535ad81d7dce314e543047bc0281854d9eded4d107fa4f525'
 'da2fd9ed1a8ba7612b885377dc7018d8d0c35ad4cdd03a24829b9a0b8edbf123'
 '3318d59ac00f5dbdd223fcf9ab953e0eee2765b4d1d72285c33c75121e888eee'
 'fc4aea4f7f3ae94bf65c6cc23b73e594f7c849ab5f1362ac78d157cf4af8bc8a'
 '1e7b6ebefd9cd4983f598831ed8082bcdab6b7857f2d302e7d4952e4f145f8e7'
 'f0f20dcf5142895d19140b60830bd9f15b664294d8535c3dcc09ebe3398a2fa3'

These transactions simply disappeared from the mempool later without ever being mined. Why did this happen? At a time when fees are so low, I doubt they were the target of a replace-by-fee. What are the possible reasons for a mempool transaction to disappear? and is there a way to investigate what happened to these specific ones?

EDIT: these transactions had a feerate above the default minrelayfee of 1 satoshi/Byte

EDIT2: I admit that I was not aware of question How do transactions leave the memory pool? , but my question is still different. I am interested in finding out why a specific transaction has disappeared from the mempool without ever being mined. Now it's a bit late to see if the transactions that I gathered were replaceable or not (nLocktime equal to 4294967294 - 0xffffff-1 - if I am not mistaken), but I will repeat my analysis taking this into account in the future.

Skimming the source code, I found the following reasons for a transaction to be removed from the mempool:

It was included in a block
A conflicting transaction (i.e. one which spent at least one of the same inputs) was included in a block
Expired: it has been in the mempool longer than the time specified by -mempoolexpiry (default 336 hours)
The memory pool size limit was reached (set by -maxmempool).  Lowest fee transactions are removed first.
A blockchain reorganization occurred (i.e. a different branch of the chain became the best), and this transaction spent coins that are now immature, i.e. the block where those coins were created is no longer at least 100 blocks deep
A blockchain reorganization occurred, and the new chain is shorter, such that the block height mentioned in this transaction's locktime has not yet been attained
A blockchain reorganization occurred.  Transactions from disconnected blocks have to be added to the mempool.  If it's already full, in this case, oldest transactions are removed to make room (not lowest fee in this case).
Under replace-by-fee, it was replaced by one with a higher fee

If someone knows of others that I've missed, please edit to add them.

If we could find the transactions themselves, we might be able to guess why they were removed.  For instance, maybe we could look at their inputs and see if they were spent by some other transaction.  But when I looked up the first few of those transaction IDs at blockchain.info, I got no results, so it may be that the block explorers have dropped them as well.


How to put comment when use sendrawtransaction in bitcoincore? I use sendrawtransaction to submitt my transaction and I want to put comment or comment-to in transaction like sendtoaddress fields that store in the wallet and not sent with transactions. I think the "data": "hex" field in createrawtransaction is for this, but I can not use that.

I use the following list as recipients field in createrawtransaction, but I get error: bitcoinrpc.authproxy.JSONRPCException: -8: Invalid parameter, key-value pair must contain exactly one key

 [{'mowMh2bocyV97NUP9vqVsuCPcJ2XhJUuoH': Decimal('0.000123'),
 '2NAJPzU1pVTcNABNrdrD336eRWRrbKBBuSe': Decimal('0.03149347')},
 {'data': 'happy birthday'}]

How to use that? Is there any good idea to do this?

data is meant for OP_RETURN outputs.

You cannot add comments using sendrawtransaction.


generate wallet addresses from extended public key i am trying to generate addresses from Extended Public Key using bitcoinj but can't figure out, how can i possibly do this.

  i need those addresses for watch-only wallet, those addresses were
  unsigned, right?

further i can sign those addresses for sending transaction.

As Watching wallet is a wallet which does not have private key. It is created with the help of public key. So, for generating addresses from extended public key for watch-only wallet, First of all you need to first create the watch-only wallet by that extended public key. and then you can simply derive the addresses from that one by one.

Sample code is shown below:

// Specify the Network Parameters for mainnet or testnet
NetworkParameters params = NetworkParameters.prodNet();

// Provide the public key from which you want to derive addresses
String xPub = "xpub6Cw8YA6Mko3xfkYpMQDZjGjgDTWUrJr87NBSiDPXqcmcSJTgxLXm3VCw3iQs4iC5ZrwpY3M21a43DZmiMzDXWzzhF1n7yxSXDnEHjJN6jwK";

// Create watching wallet, with the help of Wallet class
Wallet wallet = Wallet.fromWatchingKeyB58(params, xPub, DeterministicHierarchy.BIP32_STANDARDISATION_TIME_SECS);

// Print the very first derived address from provided public key
System.out.println("Receiving Address : " + wallet.currentReceiveAddress());

The Output will be :

1L23PHmL38qjqbs75doB1VTSL3CKPwkPbC

You can get the public key from https://iancoleman.io/bip39/ and its all particular derived addresses. You can compare your first generated address from there, to make sure that you are getting correct addresses.

If you want to fetch first 20 or 30 Addresses then you can use given line in a loop. Provide loop limit upto 20 or 30 (which you want).

    // Run this statement in a loop, where i is the loop variable.
    System.out.println(i + " : " + wallet.freshReceiveAddress());

You can again compare these addresses from https://iancoleman.io/bip39/

NOTE: This wallet will be watching wallet, you can receive coins at these addresses but you can't spend those. Until and Unless you are not Signing the transaction to the particular private key, or you are not providing private key to this wallet.


What is the unit "Th" as in Th/s? I keep seeing this everywhere, but it seems impossible to search. What does Th stand for? What does it mean? How do you calculate the Th?

For example, "The 13.5 TH/s is $2773.28 US". What does that even mean?

oops, I should make it an answer, not a comment:

Tera Hashes - a kind of a speed indicator, how fast the mining machine can calculate. "The 13.5 TH/s is $2773.28 US" would mean, a machine with such a power can generate this amount of Dollars...


Building a small block explorer for fun, stuck with node Im trying to build a small btc block explorer for fun.
The problem where i am stuck is that im trying to setup a node.
I got a Ubuntu VPS running and i have bitcoind installed, but what now?
Can someone help me with this? I have read that you need to run the node in txindex mode or something.

Thanks in advance!

You want to use the RPC Protocol to get blockchain info. RPC is usually disabled by default, so you need to enable it. You can do this in the bitcoin.conf file in .bitcoin folder where you've installed the daemon.  Alternatively, you can run the daemon with the -server flag, see  command line arguments. Now, you will also need to set RPC authentication in the conf file as well. The -txindex flag will allow you to search for any tx by hash using getrawtransaction command, which may be useful depending on how you utilizar the RPC protocol.

Example bitcoin.conf

The line to add is:

server=1

How to use:

RPC documentation


Best tutorial and info on setting up ASIC Mining USB Block Erupters to join a mining pool? I just got my usb block erupters and I was wondering what is the best tutorial on setting this up to join a mining pool? I'm currently on Windows. I want to be able to mine other alt-coins that uses SHA-256.

Here's a decent bitcointalk thread: https://bitcointalk.org/index.php?topic=28402.0

Here's a more direct walkthrough of the installation (for windows 7 at least): http://rdmsnippets.com/tag/install-block-erupter-on-windows-7/ which will likely be helpful.


PoS (Proof of Stake) - Do you have to leave your wallet QT application open all the time to receive interest? mainly for the coin Philosopher stone With the PoS (Proof of Stake) setup for the coin Philosopher Stone. Do I have to leave the QT client open all the time in order to receive interest? This coin is based of off PPCoin, so does it do the same thing having to leave your qt client open all the time in order to receive interest?

Short answer: Yes.
Long answer: To make your coins mature, all you have to do is wait but you need your wallet to be open and running the staking process, otherwise nothing's happening.


Is there any available way to discover/find the public key of a specific address? Is there any way to discover/ find out the public key of a specific bitcoin address? If not, are there any available tools online to help find the public key of a specific bitcoin address?

The only way is to see if any outputs for that address have been spent before, and then looking at the spending transaction(s). Those spending transactions will contain the scripts and public keys for that address.
Otherwise, no, it is not possible. Addresses are constructed by hashing public keys or scripts, and one of the key properties of hash functions is that they are not reversible. So you cannot take the hash encoded by an address and compute what was hashed (i.e. the public key or script).


Is it really safe to use vanitygen to generate your unique bitcoin address? I've been wondering if using vanitygen to create your own bitcoin address with a unique prefix, is safe from being compromise by others? I'm currently using a shared wallet address from a trusted website and I'm targeting now to create my own bitcoin address using vanitygen. Can someone enlighten me? Thank you!

"Using vanitygen you might think that you would be able to find the private key for a given address. In practice, this is considered impossible. Given that the difficulty increases exponentially the longer your vanity is, so does the average time required to find that vanity. The example table below shows how an increasingly complex vanity affects the difficulty and average time required to find a match only for that vanity, let alone the full address, for a machine capable of looking through 1 million keys per second."

https://en.bitcoin.it/wiki/Vanitygen#Use_of_vanitygen_to_try_to_attack_addresses

vanity  difficulty  average time

1B  22  < 1s

1Bi 1,330   < 1s

1Bit    77,178  < 1s

1Bitc   4,476,342 (4.48E+6) < 10s

1Bitco  259,627,881 (2.6E+8)    3 minutes

1Bitcoi 15,058,417,127 (1.506E+10)  3 hours

1Bitcoin    8.7339E+11  1 week

1BitcoinE   5.0657E+13  1 year

1BitcoinEa  2.9381E+15  60 years

1BitcoinEat 1.7041E+17  3,500 years

1BitcoinEate    9.8837E+18  200,000 years

1BitcoinEater   5.7325E+20  11,700,000 years

1BitcoinEaterAddressDontSend    1.6209E+47  3.3E+33 or 3.3 decillion years


How to find out if LND opening pending channels has a confirmation onchain? After typing lncli pendingchannels I get a channel_point number, and when I put channel_point txid to check if it was confirmed onchain
by typing:

bitcoin-cli gettransaction "txid insert"

I get an error:

error code: -5
error message:
Ivalid or non-wallet transaction id

How can I  see if whoever opened (pending state) channel to me has a confirmation on chain?

lncli pendingchannels gives a pendingChannelRespnse which might have the pending_open_channels parameter. This contains an array of  PendingOpenChannel objects.

According to the documentation they should have a parameter confirmation_height which is the height of the blockchain at which the funding TX has enough confirmations (the max of your and your channel partners threshold)

See

So from bitcoin-cli you figure out the current height and take the difference to see how many confirmations are still needed.

I guess if you don't get a pendingopenchannel object you don't have confirmations yet.


Quantity of traffic on test network I want to begin experimenting with bitcoin. I notice the estimated upload traffic for the real bitcoin network is around 200 GB per month. That's too much for an experiment. How much traffic per month could I expect for a node on the test network?

I havent seen a proper answer on the internet so I did the test myself using bitcoin-0.18.1 with the -testnet flag and after downloading the chain ~2 GB I monitored the traffic of the bitcoind process with nethogs for 24 hours.

I got 40MB download and 20MB uploads so 60*30 = 1800MB

You can expect 1.8GB of traffic from the bitcoin testnet compared to the 200GB+ they advise for the bitcoin mainnet


does bitcoin have omni layer? I was looking into omni protocol and couldn't quite figure out some things. I'd really appreciate your opinions. I tried to look into all the bitcoin stachexchange answers, but nothing that much related to what I am asking.
At first, I thought that Omni was a whole new blockchain(they forked it from bitcoin), and then added some more code to implement contracts so that assets could be transferred.
At second, I read that omni does write data to bitcoin blockchain itself.
Question 1) why is not the omni a new blockchain at all if they forked it from bitcoin ? we can see that on github.
Question 2) let's assume, it's not a new blockchain - then this means that my second thought is correct. How does it write data to bitcoin blockchain ? I can think of one way: P2SH Scripts, but wanted to make sure.
Question 3) if the omni is not a new blockchain at all, then how does its explorer work ? I guess, their explorer fetches all their related P2SH Scripts from bitcoin itself . right ?

Question 1) why is not the omni a new blockchain at all if they forked it from bitcoin ? we can see that on github.

As Murch said, Omni uses Bitcoin as its immutable database. So Omni is like a separate blockchain, since the contents of Omni transactions embedded in the Bitcoin blockchain are not relevant to Bitcoin nodes. If there's an invalid Omni transaction, then BTC nodes would still accept it.
Omni doesn't have a directly-connecting peer-to-peer network. It relies on data pushes on Bitcoin.

Question 2) let's assume, it's not a new blockchain - then this means that my second thought is correct. How does it write data to bitcoin blockchain ? I can think of one way: P2SH Scripts, but wanted to make sure.

They could use P2SH - I have a website that uses P2SH to embed data in the blockchain, and it works perfectly. However, currently Omni uses bare OP_RETURN scripts. Most likely, they never thought about using P2SH when they first designed it so they might not afford a breaking change (for Omni, not for BTC) introducing P2SH data pushes. P2SH pushes - are actually currently more feasible.

Question 3) if the omni is not a new blockchain at all, then how does its explorer work ? I guess, their explorer fetches all their related P2SH Scripts from bitcoin itself . right ?

Omni has its own software - a fork of Bitcoin Core. They listen to the Bitcoin network and update their blockchain. If they pulled data from P2SH every time, that would be a waste of computing resources.
So every time a new Omni update on Bitcoin occurs, they update their blockchain, then use their blockchain as their data source.


How do you handle returned goods in e-shopping? The blockchain is immutable. So, using bitcoin for shopping websites can cause problems. Customers often want to return purchases in retail scenarios. But Bitcoin is immutable, so we can't reverse the transaction.
Somebody please guide me how to handle the problem of returning goods in bitcoin-based e-commerce.

Questions like this are off-topic on this forum, however I'll take a stab at answering your question as you seem to have a lot of misunderstanding.

The bigger question you need to ask yourself if why you want to implement your e-commerce application on a 'blockchain'? It would be a gross neglect for basic engineering design principles as blockchain is nothing but a slow and expensive database. I mean I would understand if you wanted to create a Dapp if you are selling drugs and other illegal substances (like SilkRoad) since you wouldn't want a single point of failure and lack of attribution as an owner. However, if you are creating an e-commerce application that is perfectly legal you can create it on a normal database system.

Blockchain is one of the many components that make Bitcoin successful, not the only one. A blockchain is used in Bitcoin to prevent double spend attacks as transaction included in previous blocks get precedence over the latest transaction if they spend the same output, and achieving consensus on a global scale where all participants have the authority to accept changes.

Private blockchain is nothing but an old wine in a new bottle. There are plentiful example of distributed databases with multiple write access available today like Google Spanner or Paxos. So, coming back to the question you need to ask yourself, what are benefits that the "blockchain technology" is providing you that is not possible with existing 'traditional' solutions in the market?


How do Bitcoin mining pools send their miner's their share of the block reward In most bitcoin mining pools, miners of a pool are sent their portion of a block reward that the pool collectively mines, every 30 minutes or 1 hour.

How exactly does a mining pool tell the Bitcoin network to send these coins to each of the miner's addresses?

They do so just like anyone else sending Bitcoin to someone; they create a Bitcoin transaction and broadcasts it to the network. It works in exactly the same way as you sending Bitcoin to someone else. The mining pool operator goes into the pool's wallet, chooses the "send" option in that wallet, and enters the addresses and amounts to be paid for each miner. Of course this is all automated so the mining pool operator doesn't actually do that. Instead a script does it and interacts with the wallet using RPC calls.

Sometimes the mining pool may choose to pay a low transaction fee or not broadcast the transaction and instead include it in the next block the mining pool is working on.


Can Copay iOS wallet sync with the Copay oSX wallet? Can Copay iOS wallet sync with the Copay oSX wallet? Hoping to use the same wallet across both devices.

Yes, that's possible. Assuming you first created the wallet on your iOS and want to access it on macOS:

1) Open CoPay on iOS

2) Go to "Settings"

3) Under "Bitcoin Wallets" there's "Personal Wallet", click it

4) Choose "Backup" under "Security"

5) Write down the 12 words seed

On your macOS:

1) If you have just installed CoPay, it'll ask you for seed. You can type it, and then you're done.

If you already have CoPay installed:

1) Press "+" next to "Bitcoin Wallets"

2) Choose "Import Wallet"

3) Type your recovery seed


Where can I find the core binaries for v.0.1.5 to v.0.3.21? I have been looking for core binaries (i.e. win32-setup.exe & win32.zip & macosx.zip) for earlier clients. Any advice on where they are hosted? They have all been removed from SourceForge.

https://satoshi.nakamotoinstitute.org/code/ (Only v.0.1.0 to v.0.1.3)
https://bitcoin.org/en/version-history (Only v.0.3.21 to v.0.20.0)
https://github.com/bitcoin/bitcoin/releases (Only tar.gz, also not accurate)

Any advice appreciated!

You have the files here and can follow the instructions mentioned in below links to build:
https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md
https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md


How exactly trading of Bitcoin does? How exactly trading of Bitcoin does? Is it just like a trading of shares of any company listed on stock exchange? Can anyone explain its transaction in detail?? Is there any Transaction fees or trading margin like stock exchange?

When trading bitcoin on exchanges you trade directly at the exchange (not through a broker). Another big difference is that everything at an exchange is visible publicly, this includes the current orderbook and a recent set of historical trades.

What is features are supported and what the fees are depend on the exchange, a few big exchanges are:

bitstamp: They only support trading assets that you own, you can make limit orders or market orders. Margin trading is not supported.
bitfinex: They support the same as bitstamp as well as margin orders.
kraken: Similar as bitstamp, but also supports other cryptocurrencies.

Besides the top few, there are also exchanges that do not have markets with FIAT money, the biggest one here is poloniex (which supports margin trading).


How to derive BTC m44 addresses from xpub? I checked Swan's Address Derivation Library https://github.com/swan-bitcoin/xpub-tool.
I try to get m44 address, but I got m84. Why? Do you know is it any parameter to force return m44? I tried to pass path: "m/44'/0'/0'/0", but it did not help.
Do you have any idea?
addressFromXPub("xpub6C5oXscLYZwgq2DB42TFC32QcoPa1MeCWUNPZSjydunniCM77TRcBfFnjScJeToVXS5RBDr53Ls5RXvDHujmFSL4Fqc9kkpsMjU1vg68xv7"
  );

export const addressFromXPub = (key) => {
  console.log(
    addressesFromExtPubKey({
      extPubKey: key,
      network: "mainnet",
      addressCount: 3,
    })
  );
};

[
    {path: "m/84'/0'/0'/0/0", address: "bc1qfgnqm6g46ys0h9gh606m76wemka2rrttrac90x"
    },
    {path: "m/84'/0'/0'/0/1", address: "bc1qnvzdj2m4wsrcrtl30j5c304qa77v4h2s8ajp0r"
    },
    {path: "m/84'/0'/0'/0/2", address: "bc1qjf5u77e6clwkxgf7a0shw7zq2nhqr4vjys7an0"
    }
]

The following key:
xpub6C5oXscLYZwgq2DB42TFC32QcoPa1MeCWUNPZSjydunniCM77TRcBfFnjScJeToVXS5RBDr53Ls5RXvDHujmFSL4Fqc9kkpsMjU1vg68xv7

Corresponds to a level 3 public key w/index of 0x00000080 which is 0h/0'. In the context you've described it probably corresponds to "m/?/?/0'". This key's parent's fingerprint is 0x3ab9169c, so you'd need to provide the parent's full fingerprint to confirm the original derivation path.
Although m44 & m84 have the same master/root key, they have completely different level 1 keys, which would change all lower nodes. In short you can only derive m/... full paths from root keys, not child keys, which you've provided.
Edit: The key you've provided is probably meant for deriving receive & change addresses of a certain address type.


Does Satoshidice benefit the wider Bitcoin ecosystem? Aside from the entertainment benefit players get from the service, does it in any way help the Bitcoin ecosystem to have a large churn of small transactions?

There is value added by this service:

  Over the past 15 years, downtown Las Vegas has seen its slot machines
  tighten from a 1996 average of 4.8 percent to 2010’s 6.4, a “cost”
  increase of almost 32 percent. That means, on average, players see
  fewer jackpots and spent less time on their machines. In short,
  they’re not getting a lot of bang for their slot buck.

http://weeklyseven.com/news/2011/march/17/loosening

Online wagering can be a little lower house edge, but rarely will you find a house edge of just 1.5% like SatoshiDICE offers and the 1% that BitLotto offers.  Here's some background:

http://www.beatingbonuses.com/slotgames.htm

To play SatoshiDICE you need bitcoins, so that means there will be additional activity at the exchanges (both in purchases of bitcoins and cashing out by those who lady luck was nice to).  The player base won't be just existing bitcoiners as this payout level is such an attraction it will spread by word of mouth -- or virally even.

Most Bitcoin software, websites, documentation and media or press has been for an English-speaking audience.  With translations for multiple languages, Bitcoin will reach for the first time many users who would not otherwise learn of it.

Of course, every bitcoin that is held by a SatoshiDICE gambler is a bitcoin that is not sitting in a trader's wallet, waiting for the first hint of a selloff before it gets dumped (i.e., volatility is lower when the coins are not concentrated as much primarily with those speculating.)

After reaching a level where using Bitcoin becomes comfortable, those gambling at SatoshiDICE might find other goods and services that their bitcoins are useful for instead of just cashing out.

Additionally, with this unprecedented success for a Bitcoin startup there will be competition.  The technique employed by SatoshiDICE (payouts using same coins as the wager, thus can be paid out using 0/unconfirmed) is novel but easily replicated.

SatoshiDICE is a for-profit venture, and a chunk of those profits will likely be reinvested back into that business (perhaps building a mobile app for it, as an example), and/or other Bitcoin-related endeavors.

The blockchain pruning feature was something Bitcoin's developers hadn't had as top priority but with this level of growth and added data to the blockchain that may become top-of-mind.  This may be a feature that will help Bitcoin and SatoshiDICE might be responsible for having it occur sooner than it might otherwise have.

For Bitcoin, SatoshiDICE has win written all over it!


How OP_CHECKSIG knows the source of sig in pay to pubkey hash transaction https://en.bitcoin.it/wiki/Script#Standard_Transaction_to_Bitcoin_address_.28pay-to-pubkey-hash.29

The last step of pay to pubkey hash transaction is to check the signature of the previous transaction tx hash  and pubkey .

But how the script interpreter knows the sig is the signature of the previous transition hash, what if the sig is the signature of some other content?

But how the script interpreter knows the sig the signature of the
  previous transition hash, what if the sig is the signature of some
  other content?

It also compares the signed data with the transaction hash itself. In general, this is how digital signatures work. If the data isn't signed by the right key, and data hash doesn't match, then the signature is invalid. See src/script/interpreter.cpp L#1264.

This verification process ensures two things:
1. The person has the private key which corresponds with the public key provided.
2. The data has not been tampered with.


Is there an easy way to estimate the number of mining nodes? I was curious about the number of mining nodes on the network, yet I haven't seen it discussed.
I tried two different approaches to approximate the count of mining nodes. I looked up the hashrate of the fastest hashing machine (which appears to be the Antminer S19 Pro at 110Th/seconds) and compared its projected mining profit with the total mining reward.
A profitability calculator estimates that I'd earn 0.2911 Bitcoin per year with the device running 24/7/365. This means that at 6.25 bitcoin per block, I contributed to solving 0.0465 block in 1 year. If the network used only these machines, then I estimate 55,000 blocks / 0.0465 blocks per mining node = 1,182,795 mining nodes. This is the lower bound, the minimum number of mining nodes on the system.
Now, my other assumption is that the network difficulty is equivalent to the average weighted hashrate of the sum of all mining nodes on the network (time frame is probably smoothed here). If the current, March 18 2021, network difficulty is 21.6 Th/seconds, then the same calculator calculates that my device would earn 0.0572 Bitcoin in 1 year. Using the same calculation, I get 55,000/(1/(6.25/.0572)) = 6,009,615 mining nodes.
These two numbers are quite a bit apart. Is there a better way to estimate the mining node count?

While it's possible to estimate the current hashrate from the difficulty, they are two different measures. You can find an estimate for the global hashrate on the same site where you found the difficulty. The current estimate is 162 EH/s (162,000,000 TH/s).
Using a similar approach as proposed by you, we can estimate an upper bound of  162,000,000 TH/s / 110 TH/s = 1.47M mining nodes by comparing the global hashrate to that of the fastest mining equipment.


Is it possible to detect mining of bitcoins on an enterprise network? Is it possible to detect bitcoins mined where it may be against an organization's computer usage policy? E.g., Bitcoins mined secretly on corporate or university computers when the policies of the organization do not allow such use of its computational hardware.

And are there any ethical guidelines developed to discourage such use?

An enterprise network administrator concerned with the operation on its systems of software that contradicts policy should already employ some kind of security scanner software. Adding the known miners to that list of flagged software is the best recourse. Additionally, watching for outbound connections to the known DNS names for peer lookup or outbound connections on a certain few known ports could yield better results with less software impeding operation.

In short, they're just programs, and administrators should already have in place the tools and knowledge necessary to block the programs from running or detect that they are running.

For ethics, the general vibe in the community is mine only on hardware you own, but obviously, not everyone follows that.


"Augur" vs. "Oraclize" : What is the main difference? Can we say that "Augur" is a decentralized Oracle against "Oraclize" as a centralized model?

Full disclosure: Am an Oraclize employee, but also an Augur fan plus REP holder and so am striving for impartiality.

And so to the question: Not really, no.

Oraclize is a really cool oracle service: They are essentially a data transport layer who provide authenticity proofs that the requested data was retrieved and/or computed in exactly the manner the requester of the data asked for.

They don't guarantee the veracity of the data itself, only that it was retrieved/computed in exactly the manner the requester asked for, via third party proofs. And it is these that make Oraclize trustless - you don't need to trust Oraclize, only the provider of the requested proof type.

Better still, this third party nature also allows a requester to appraise the data they are requesting. If choosing say a TLSNotary proof, you're actually relying on an AWS instance, giving you a sense of how much it would cost an attacker to hack such a thing, and allowing you to judge whether your smart contract needs a higher fiscal guarantee or not. And if then you do need a higher guarantee, multiple proof types can be requested, further increasing the cost for an attacker to gain access to/alter the data you're requesting.

And so now to Augur, which is a really cool prediction market. Here, financial incentives drive the accurate reporting of external data by its users. So Augur are a data source themselves, and are decentralized to the tune of however much is at stake, monetarily, on a piece of data being correct. One draw back is the cost of creating such a market, and another is then the risk of that market not generating much traffic, reducing the likelihood of receiving said data as well as potentially reducing the guarantee of accuracy of said data. These risks are inherent to the model and are difficult to assuage. Nevertheless, Augur is a fascinating prospect.

Incidentally, these two different modus operandi can in fact work synergistically - Oraclize can be used to retrieve results from an Augur prediction market, or Augur can use Oraclize to resolve a market - how's that for meta!


JAVA JSON-RPC for Litecoin I am looking for Java Json-Rpc for Litecoin or any implementation for Litecoin

Since Litecoin is a fork of bitcoin you can use JavaBitcoindRpcClient to connect with litecoin client and execute API calls.

link:https://github.com/Polve/JavaBitcoindRpcClient

To connect with client, you can use below code :

String user = "RPC_USER_NAME";
String password = "RPC_PASSWORD";
String host = "127.0.0.1";
String port = "PORT";

try {
    URL url = new URL("http://" + user + ':' + password + "@" + host + ":" + port + "/");

    BitcoinJSONRPCClient bitcoinClient = new BitcoinJSONRPCClient(url);
    System.out.println(bitcoinClient.getInfo());
} catch (MalformedURLException e) {
    e.printStackTrace();
}


thin-client remote node lying through omission is there a way for a non-full node (ie a node which does not contain the full blockchain) to know when it has received all transactions associated with an address? i understand that it is possible for a non-full node to tell if it has been fed an invalid transaction - the node can check that the transaction hash exists in the pruned merkle tree for the specified block, then compute the merkle root for that tree and check it exists in the block header. but i don't know of any checks to ensure that all transactions have been downloaded.

if transactions are not relayed by a malicious remote node then the target node will think it has less funds available than it really does.

i had thought that bloom filters might fix this problem, but i read in bip37:

  Thus, a merkleblock message is a block header, plus a part of a merkle
  tree which can be used to extract identifying information for
  transactions that matched the filter and prove that the matching
  transaction data really did appear in the solved block. Clients can
  use this data to be sure that the remote node is not feeding them fake
  transactions that never appeared in a real block, although lying
  through omission is still possible.

so it seems bip37 does not attempt to solve this issue.

Peers who don't use the whole blockchain are relying on at least one of their peers to send them transaction data when a transaction satisfies the bloom filter that the SPV (simplified payment verification) node has set. As such, SPV nodes have to be careful about which peers they connect to, and that they have a variety of peers. I believe some implementations of SPV nodes only connect to a set of defined, or are at least configurable to only connect to a strict set of peers.

Read how the bitcoinj (SPV node implementation) creator describes its security here:

  Because bitcoinj apps do not accept incoming connections, the peers you talk to are always randomly selected at startup (based on DNS seeds today). So it can be difficult for an attacker to control your connectivity like that. For this reason, the number of peers that have announced a transaction is exposed in the TransactionConfidence object and you can listen on that to learn when new peers have announced a transaction. Once most of your peers have announced, you can be fairly sure that the transaction is propagating its way across the network and is very likely to be valid.


How to migrate wallet from namecoin to namecore? Today I updated namecoin by building the new "namecore" reimplementation  but when starting namecoind I got this message:

Error opening block database.

Do you want to rebuild the block database now?

and before I could do anything namecoind crashed.
So I moved away the Namecoin folder and let it regenerate everything, blockchain included.
This time it started without errors, so I copied my wallet.dat into the folder and restarted namecoind but I got an Error: and it crashed again.
The debug.log shows this:

2015-06-29 15:36:51 Using wallet wallet.dat
2015-06-29 15:36:51 init message: Verifying wallet...
2015-06-29 15:36:51 CDBEnv::Open: LogDir=/home/michele/Library/Application Support/Namecoin/database ErrorFile=/
2015-06-29 15:36:51 Renamed wallet.dat to wallet.1435592211.bak
2015-06-29 15:36:51 CDBEnv::Salvage: Database salvage found errors,     all data may not be recoverable.
2015-06-29 15:36:51 Salvage(aggressive) found no records in wallet.1435592211.bak.
2015-06-29 15:36:51 Error:

I figured the wallet format has changed somehow, so using the old client I dumped the private keys and I succefully imported them using importprivkey. I can see the address, the balances and all but name_list shows nothing.

How do I get back my names now?

Meanwhile I've answered this question at reddit.

You have already taken the first 2 out of 3 steps necessary for your wallet migration: (1) cleaned up the data directory that contained old incompatible files, (2) dumped and imported the private keys from the old wallet (alternatively, depending on how old the wallet is, one could try starting the new namecore client with the -upgradewallet parameter).
The internal bookkeeping hasn't had a chance to detect the old transactions that belong to the newly imported private keys, yet. This is the missing third step: (3) Restart namecore (i.e. namecoind) with the -rescan parameter.

In short: Now you need to restart the new client with the -rescan parameter.
EDIT: Generally I recommend using namecore's new -upgradewallet parameter:
namecoind -upgradewallet -rescan -reindex
as the dumpprivkey/importprivkey approach always bears the risk of confusing the relevant name_update transactions and addresses with older ones. If you do not know how to use the (deprecated) name_debug1 command in Namecoin-Qt then you most likely get it wrong.


it goes up and up and up New to bit coin use. I have noticed over the past few months that the exchange rate has ballooned from 13 to now 22 $ a coin, this presents a problem, prices are almost never adjusted to account for the massive inflation; how is the rate set and are there ways of getting bit coins  (I use spendbitcoins.com) are a fairer rate. I would also like to say that if inflation on the coins continues to rise it will put a lot of market places out of business.

The rate is set by supply and demand.  If there are buyers willing to pay $25, and sellers selling for $25.25+,  Then eventually someone will either buy at $25.25, or sell at $25, which then moves the price. This current price movement is due to speculation. People are buying and holding coins, and there are far more buyers than sellers. So naturally the price will continue moving up.


How is the random number R for transaction signatures created? I wonder about the random number used in signatures that result in R values ?
x coordinate R = G(k)
How is it created? Does it have a specific chars length?
Is there a specific random generator used, or restriction arguments?
I saw Python code online and found it is limited to max number of field points:
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
But as it is in hex format, I didn't know what does it mean.
So what is the max number to be used as it will processed as an integer?

The nonce k is supposed to be an unpredictable number in the range 1 to 115792089237316195423570985008687907852837564279074904382605163141518161494336, inclusive - one for each point on the curve except the point at infinity (note: not the size of the field, which is very slightly larger than the number of points on the curve).
One way of doing that is picking a uniformly random number in that range. This works, but makes your security crucially depend on having a good random number generator. This is a simple problem in theory, but in practice lots of problems do occur. Notable examples are the Playstation 3 codesigning system (which used a fixed constant as nonce), or a bug in Android that in some cases resulted in applications generating the same sequence of "random" numbers.
The most common (and recommended) way today is using RFC 6979. It essentially prescribes not using randomness at all at signing time, but computing the nonce using a (specific) hash function that takes the message and private key as input. Under reasonable assumptions, this is just as unpredictable to attackers (who don't know the private key) as using actual randomness, but avoids the engineering challenges with having access to a good RNG.
One word of warning: unpredictability is a very wide concept, and has lots of pitfalls. There are actual attacks against picking a nonce that is taken from a much smaller range, or against nonces that are picked in some related way. Don't try to be "smart" about it.


Why is my transaction immature? i created an altcoin with a premine for the first block. After generating the first block the transaction worked well. But on my wallet it says the that my new balance is "immature". What does that mean and how can i get the "immature balance" confirmed?

https://camo.githubusercontent.com/8403ee1020c3c56d8ee9f4049065d8db717e1870/687474703a2f2f6934362e74696e797069632e636f6d2f33306d37706b6f2e706e67

Kind regards

Block rewards (coinbase outputs) can't be spent for 100 blocks.

This is called "maturity" in the codebase and is to protect some behavior around reorganizations.


Is there any point to casual mining? Is there any point to casual mining anymore? I recently discovered bitcoin and was wondering if there was any point to running mining software on my laptop while I work on essays or other non-computationally intensive task. I tried looking around, but answers seem conflicted on if casual mining is possible.

I mean will I get any bitcoins from it, not is it profitable per unit cost of electricity. Will I get anything in a reasonable timeframe or is that now a thing of the past? By anything I mean, the silly 0.1BTC I see stuff put up for on http://forbitcoin.com and such, not hundreds of dollars to supplement my income.

TLDR: Rough estimate of electricity cost needed to produce one bitcoin on a laptop with 5 Mhash/s equals to 61 dollar, and would take 339 days with current difficulty.

A standard laptop CPU provides around 2-8 Mhash/sec and consumes 25 to 75 watts, which on average gives us 1 Mhash/sec per 10 watts of power.

An ATI 5870 video card, which has one the best efficiency/cost ratios, mines at about 400 Mhash/sec and consumes about 216 watts. Which gives us about 2 Mhash/sec per 1 watt of power. In other words mining with ATI video card about 20 times more cost effective then mining with CPU.

According to pi.uk.com/bitcoin, mining with ATI video cards at 1000 Mhash/sec will cost 650 watts or 9.75 cents (15 cent per kilowatt hour), and the operation profit margin would be 19.07%. Therefore I doubt it would be cost effective to mine on laptop considering that power consumption changes dramatically from computing intensive task.

You can get better estimate yourself by using Bitcoin mining profitability calculator and Electricity Prices by State.


A node can publish any block at any time. How? How to publish? Can anyone tell me what to do to publish if I mined a block

Let's assume that you are solo-mining.
If you are a miner you need to run a Bitcoin Full-Node for example Bitcoin Core. If you do this you are a full part of the Bitcoin network.
If you mine a block, you do the following steps:

Putting transaction together and verify them
Doing the Proof-of-Work (Calculating the nounce until the first characters are zeros).
Adding stuff like coinbase and timestamps
Profit from the reward and transaction fees

If this is done you broadcast the block to all nodes in the network the same way as broadcast a transaction. This means that all nodes are receiving this block. They are also checking it like if your block matches the difficulty and if the transaction are valid. Then they are adding it to their own local copy of the blockchain.

The nodes are broadcasting the blocks and transactions under each other. That's how peer to peer work. You should take a look at this


How to verify a lnurl-auth callback with python I want to create a Python implementation of an lnurl-auth server.
I started a quick HTTP server to be the callback url, and captured the signed callback sent by BLW on Android.
?tag=login
&k1=7c27131e7fb37df50d12b0cb56ac1b76f817a5ba535b15afe43390a1f6b55d4d
&sig=30450221008172a00276a4724909b37051e98b36ba4f465aac82dd4d9609f91a3cd3be1a32022075bffd8d7697d140055b27e67d31a606435fdf5073c9c96d46a02cae06a5abc4&key=030f12794ae14407b8e1bfa1cbc297bb68ce6b24455ceab52c02da7a92782b6b14

Here is some python that attempts to verify that signature.
import secp256k1

k1 = bytes.fromhex("7c27131e7fb37df50d12b0cb56ac1b76f817a5ba535b15afe43390a1f6b55d4d")
key = bytes.fromhex('030f12794ae14407b8e1bfa1cbc297bb68ce6b24455ceab52c02da7a92782b6b14')
sig = bytes.fromhex('30450221008172a00276a4724909b37051e98b36ba4f465aac82dd4d9609f91a3cd3be1a32022075bffd8d7697d140055b27e67d31a606435fdf5073c9c96d46a02cae06a5abc4')

pubkey = secp256k1.PublicKey(key, raw=True)
sig = pubkey.ecdsa_deserialize(sig)
print(pubkey.ecdsa_verify(k1, sig))

Output: False
I don't know enough to tell what I'm doing wrong. It seems like this should be fairly standard use of the secp256k1 library.

I gave up using the secp256k1 library, but here is a working python solution:
Make sure to install the python-ecdsa package, for instance with pip:
pip install ecdsa
...and then...
import ecdsa

k1 = bytes.fromhex('b29fa5994dc9da9906a36f996e6ac4faa2b0e2601ef13b0fab9d4b4287c57e1f')
key = bytes.fromhex('030f12794ae14407b8e1bfa1cbc297bb68ce6b24455ceab52c02da7a92782b6b14')
sig = bytes.fromhex('3045022100a23fbcaf3f24aff085d8c86a744764be8390e8511eca675ae2af037f33ff1a92022035f00465fbcad73e3175d7dc2e891322fa9dcce7bbd19409866f855e6da1f51e')

vk = ecdsa.VerifyingKey.from_string(key, curve=ecdsa.SECP256k1)
vk.verify_digest(sig, k1, sigdecode=ecdsa.util.sigdecode_der)

With the ecdsa library, make sure to use verify_digest rather than verify.


What is the ecological effect of increased work for the Bitcoin chain? As more users use Bitcoin and "forced work" difficulty increases what effect does this have ecologically? It is a silly question I know. I'm just comparing let's say value or effect of using computational power for protein folding vs Bitcoin and curious if anyone has given or found some thought/exploration on the matter.

Blockchain.info reckons the network used    156.51 megawatt hours of electricity in the last 24 hours. This random physics page I googled up reckons a car driving at 40mph takes 100kW (so, 2.4 MWh in 24 hours).

So by these (very) rough figures, running the Bitcoin network takes about as much energy as driving 65 cars.

How many vehicles are used in the transportation of physical cash? Not to mention the energy costs of physically storing and securing cash. I'd say Bitcoin is almost certainly a net positive for the environment to the extent that it displaces physical cash.


What are "bitcoin days destroyed"? The concept of bitcoin days destroyed has been proposed as a measure of bitcoin volume. However, I don't think the bitcoin wiki really explains the idea very well.

What is the purpose or advantage of knowing this statistical value?

The idea of "bitcoin days destroyed" came about because it was realised that total transaction volume per day might be an inappropriate measure of the level of economic activity in Bitcoin.  After all, someone could be sending the same money back and forth between their own addresses repeatedly.  If you sent the same 50 btc back and forth 20 times, it would look like 1000 btc worth of activity, while in fact it represents almost nothing in terms of real transaction volume.

With "bitcoin days destroyed", the idea is instead to give more weight to coins which haven't been spent in a while.  To do this, you multiply the amount of each transaction by the number of days since those coins were last spent.  So, 1 bitcoin that hasn't been spent in 100 days (1 bitcoin * 100 days) counts as much as 100 bitcoins that were just spent yesterday (100 bitcoins * 1 day).  Because you can think of these "bitcoin days" as building up over time until a transaction actually occurs, the actual measure is called "bitcoin days destroyed".  This is believed to give a better indication of how much real economic activity is occurring on the bitcoin network.

So how well does it work?  Well, it's still not perfect, because the other day I moved some coins out of a wallet they've been in for several months without spending them or giving them away.  And some genuine businesses have very rapid turnover in bitcoins, so they're not being measured well by this method.  But it does do a good job of filtering out the "noise" of bitcoins that are just "bouncing around" without really going anywhere.  The graph of overall bitcoin days destroyed is believed to show that the genuine level of activity in the Bitcoin economy is continually increasing--it's not just one person experimenting by rapidly sending the same coins back and forth, flooding the network with meaningless chatter.  Looks pretty good, hey?

Image from the Bitcoin wiki.  The above graph is in percentage of bitcoin days destroyed and a little out of date--for a regularly updated version in bitcoin days destroyed check out Bitcoin Days Destroyed - Active Chart instead!


How to find partners for a Bitcoin business? Are there any resources available to find people who are interested in starting a Bitcoin-related business?

To answer comments:

I am looking for both partners who want to start a business and investors. Something related to bitcoin that is delivered via internet. Perhaps a stock exchange denominated in Bitcoin, algorithmic trading in Bitcoin, etc. I am open to many different ideas.

I think posting your ambitions here would return quite some feedback/interest:
https://bitcointalk.org/index.php?board=12.0


Calculate block hash is different in regtest? I'm able to calculate the block hash in mainnet and testnet, but I don't get the right hash in regtest.
I mint +3000 blocks and I get the block with height 3000
bitcoin-cli getblock $(bitcoin-cli getblockhash 3000)

{
  "hash": "4221d8b10b0a7eb5e050337c76819abf71113f17e266e88cb12df4bf5ce24b55",
  "confirmations": 502,
  "strippedsize": 215,
  "size": 251,
  "weight": 896,
  "height": 3000,
  "version": 536870912,
  "versionHex": "20000000",
  "merkleroot": "23b4600b467f18ef0ec18bd73a9b921077486cf67c44c912de114888db184bf9",
  "tx": [
    "23b4600b467f18ef0ec18bd73a9b921077486cf67c44c912de114888db184bf9"
  ],
  "time": 1599147354,
  "mediantime": 1599147353,
  "nonce": 0,
  "bits": "207fffff",
  "difficulty": 4.656542373906925e-10,
  "chainwork": "0000000000000000000000000000000000000000000000000000000000001772",
  "nTx": 1,
  "previousblockhash": "4776b1ccad27e2de9ccbdc5bf4ad4d972a89e27a020db1f7b59abb857d77f3be",
  "nextblockhash": "121512fc6bc1395ada64a6c63ba2c2955ad9cc240a1fc0282b95cf2c2651b381"
}

Now I save the values in env variable
 ver=`printf 20000000 | tac -rs ..| tr -d '\n'`
 prev=`printf 4776b1ccad27e2de9ccbdc5bf4ad4d972a89e27a020db1f7b59abb857d77f3be | tac -rs .. | tr -d '\n'`
 mkl=`printf 23b4600b467f18ef0ec18bd73a9b921077486cf67c44c912de114888db184bf9 | tac -rs .. | tr -d '\n'`
 time=`printf '%x\n' 1599147354 | tac -rs .. | tr -d '\n'`
 bits=`echo 207fffff | tac -rs .. | tr -d '\n'`
 nonce=`printf '%x\n' 0 | tac -rs .. | tr -d '\n'`

After that I can concat and get the little endian representation
printf $ver$prev$mkl$time$bits$nonce | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b | awk '{printf $1}' | tac -rs ..

The result is: 09665bcb63b6c279948f93937669bf1c8f36cffda0646180ba523847cb642384. the same operations in mainnet and testnet works properly.

The nonce needs to be 8 hex digits but printf %x only generates the minimum digits needed for the value, which for 0 is only 1 digit. (The same is true of other numeric conversions %d %i %u %o also.) You need to use %08x to force an 8-hexit value:
ver=$(printf 20000000 | tac -rs ..)
prev=$(printf 4776b1ccad27e2de9ccbdc5bf4ad4d972a89e27a020db1f7b59abb857d77f3be | tac -rs .. )
mkl=$(printf 23b4600b467f18ef0ec18bd73a9b921077486cf67c44c912de114888db184bf9 | tac -rs .. )
time=$(printf %x 1599147354 | tac -rs .. )
#should be %08x if any timestamp can be before mid-1978
bits=$(printf 207fffff | tac -rs .. )
nonce=$(printf %08x 0 | tac -rs .. )
printf $ver$prev$mkl$time$bits$nonce | xxd -r -p | openssl sha256 -binary |
 openssl sha256 | awk '{print $2}' | tac -rs..

-->
4221d8b10b0a7eb5e050337c76819abf71113f17e266e88cb12df4bf5ce24b55

Other changes:

most of your items didn't even have a newline, and for those that did it is discarded by the tac -rs.., and so none of them need |tr -d '\n' -- although for consistency I removed the \n in some printf formats, and changed the echo (which adds newline by default) to printf (which doesn't). (And even if the/some/any items did contain newline, if you doublequote the final printf "$ver...$nonce" so they get treated as data and not wordsplits, the xxd -r -p will discard them as if they weren't there at all.)

I used the newer syntax $( ) for process substitution instead of the older backticks (which I can't show in Stack markdown!) because in many cases it has advantages, although not here specifically, and I like to be consistent. (There are dozens of Qs about this on other Stacks.)

I used openssl instead of sha256sum because I have it on my systems and it's a little easier.

This wasn't a problem on mainnet and testnet, at least for most blocks, because they have difficulty high enough that the nonce value will be at least 29 bits most of the time.


Does buying bitcoins and not spending them have negative influence of the bitcoin price? I'm curios whether stock investing behavior have negative infect on the price of the bitcoin and other cryptocurrencies. Since popular delusion is that the crypto is like a stock where you buy coins and wait for the right time to exchange it. What if most of the people don't wanna spend there bitcoins will that make them unpractical for use?

Every investor has a different threshold for risk tolerance. A price one investor might consider as cheap, might be expensive for another investor (read Greater Fool Theory.) If the investor base of bitcoin is considerably large, at any point in time you are highly likely to have two parties trying who will be willing to take opposite positions. Improvement in liquidity, introduction of new financial contracts (futures, derivatives) can go a long way in helping improve the price volatility in bitcoin and attract a wider base of investors.


Can bitcoins be split up into greater than a billion parts? I understand that, at time of writing, splitting a bitcoin into more than 10⁸ parts is not useful. However, say that in the far future enough bitcoins have been destroyed (through deleted wallets due to negligence or whatever else) that a billionth becomes too valuable for people to work with.

I know we're a long way off from this issue yet, but just say it were to happen.

Would the bitcoin spec easily allow you to further bifurcate these coin fragments into arbitrarily small values, thereby eliminating this sort of problem?

The Bitcoin protocol doesn't allow you to easily have denominations lower than a satoshi (10^-8 bitcoins). But once there is a need and widespread agreement, it can be modified to allow it.

Destroyed bitcoins however will not have any significance as a factor contributing to this need.


Parts of a Bitcoin Mining Rig Original question: How important is a strong CPU and GPU for ASIC mining? I would assume that the GPU could be a cheap one because even if its high-end it probably won't help, and that the CPU should be a decent one to handle all the ASICs. Am I incorrect?

In addition, what is the importance of each part of mining computer in terms of mining? How do the Motherboard, CPU, RAM and GPU affect your experience?

The hardware of the controller doesn't matter. You can run cgminer on a Raspberry Pi or a TP-Link router, both are terribly weak and it has absolutely no effect on the ASIC whatsoever. To this end, even KNC mining rigs use Beaglebone Black boards to control their top of the range miners. Most home miners use Raspberry Pi due to their low cost and easy to run software like MiningPeon.

CPU, memory, GPU are all largely irrelevant.


What are bitcoin/altcoin block notifications? While setting up a private nomp mining pool as a learning project, The instructions recommended setting up block notify. What are block notifications?

The -blocknotify="{cmd}" is one of the configurable settings when starting the bitcoin daemon. For example, I can start my bitcoind with this command:

bitcoind -blocknotify='echo %s'

And when a new block is solved, the block hash gets printed.

00000000000000000e979c4a51dc6cb9606e47a2b499f591645f53fe801ae374


if my wallet is sufficiently secure, can I ever lose my coins? I've made an offline address and only have the key stored on 2 encrypted flash drives stored in different locations with the private key written physically on paper and stored in 2 locations. Do I ever have to worry about my coins? That is, could theyever be lost in software changes or is that as big of a never-going-to-happen as the 21 million limit being lifted? I'm pretty sure I'm not touching that wallet for a long time. Is there any benefit to repeating this process for a more "fresh" address ever or does that not make sense?

I'll go through your question clause by clause:

  I've made an offline address

You're doing good.

  and only have the key stored on 2 encrypted flash drives stored in different locations

As long as only you know the password and the password is sufficiently strong, this is probably secure.

  with the private key written physically on paper and stored in 2 locations.

If either of these two locations are accessible by anyone other than you, then they are vulnerable. If someone else found either paper, and your keys are in plain text, then you could consider them compromised.

  Do I ever have to worry about my coins?

Yes.

  That is, could they ever be lost in software changes

Extremely unlikely, as the whole of Bitcoin depends on the safety of balances through upgrades. There are people who have very vested in ensuring that this never happens. Even a bug in the protocol could not erase history in an unrecoverable way, as a single offline client copied online or bootstrap.dat would refresh anyone affected.

  or is that as big of a never-going-to-happen as the 21 million limit being lifted?

Pretty much.

  I'm pretty sure I'm not touching that wallet for a long time. Is there any benefit to repeating this process for a more "fresh" address ever or does that not make sense?

Theoretically, you would never need to regenerate keys unless some kind of vulnerability was found in the software that generated your key, ala the Android random number generator flaw.

An unlikely occurrence would be some kind of change to the way private keys are imported, and your private key generated in 2013 cannot be securely converted to whatever format is expected in 2063, or whenever. I wouldn't get too paranoid about this.


Withdrawal of coins to Trezor did not happen, Where are my coins? I set-up Trezor yesterday and withdrew coins from my exchange to store in the Trezor. I entered the address and conifrmed.
However, an hour later, Trezor said Network error. It was unable to receive the coins.
The address I entered is also not showing up on Trezor today.
How do I get my coins?

If you used the correct address, you have received that money already even if your Trezor doesn't yet know about them.
If the public blockchain (not the unrelated business who use that name) shows your address has the money, you already have it. The public blockchain is the only true record.
You won't be able to spend that money until you fix whatever problem is causing that reported network error (or until you use your safe backup copy of the seed phrase or private-key in another wallet)


Bitcore-wallet-client "Server response could not be verified" I'm getting an error trying to sign a transaction with bitcore-wallet-client.

I create the transaction, publish it and when I try to sign it, I'm getting the error: "SERVER_COMPROMISED - Server response could not be verified"

bws server: https://bws.bitpay.com/bws/api

can anyone point me in the right direction?

ps: using wallet-client (CLI) I can sign the same transaction (created and published from bitcore-wallet-client)

edit: I'm using a testnet account

The problem was that I was creating the transaction proposal and publishing it, after that I used the result from createTxProposal and passed it to signTxProposal.

turns out that the txProposal returned from createTxProposal doesn't have the property proposalSignature (which is filled when the transaction is published).

so, to solve this I had to get the transaction proposals (after publishing) and send the transaction fetched as argument to signTxProposal.


Format of private key On this website, we can see that the the private key 1 is written in this format.

  5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAnchuDf

I would like to know what is this format.

This is the Base58 Wallet Import format.

It is composed of the alphanumeric characters excluding 0OIl (zero, capital O, capital I, and lowercase L). The format includes an error checking code which makes it highly unlikely to mistype a key.

The format is also in use for addresses. Private keys start with a five. Pay-to-pubkey-hash addresses start with a one, pay-to-script-hash addresses start with a three.


How many neighbours does a Node have? I'm writing a blockchain simulator to evaluate the bitcoin network and currently running some evaluation experiments.

I couldn't find a reference for the approximate number of neighbour each Node has in its table.

Can anyone point me to a source?

It is impossible to know how many nodes each node is connected to or has in its peers table. This information is not broadcast publicly and the information that is available publicly (by asking a node) is not representative of what the node actually knows.


Trickle Exchange System? This idea came to me while I was trying to trade Frozencoins. For a miner like me that has to wait ages to get coins, its nearly impossible to trade small amounts of Frozencoins. People usually ask for huge amounts, from a hundred to 10,000. What if, people who made buy orders had the option of a "trickle" payment?

Basically, lets say that I only have 100 Frozencoin for X amount of Bitcoins but someone wants to buy 200. A trickle exchange would allow the person buying the Fronzencoins to receive multiple payments from different people with varying amounts until he reached the total he wanted. The people would get paid back ( in the cryptocurrency he/she was trading them for ) at the exact same rate ( Maybe 0.00002 BTC for every 1 FZ ). If he/she thought the wait time is too long, he/she can keep the coins and cut off the buy order. Is this possible? If so, what would it take to implement it?

Yea this is possible, there's nothing stopping you from making a new exchange that does things differently. Although to start making one you're going to need serious programming knowledge.

Consider the following questions

Is there an open source Bitcoin exchange?
What is needed to make a bitcoin exchange?


Is it possible to make an output only spendable to a specific address? Basically, the entire question fits into the title. Does the Bitcoin scripting language allow for a transaction output to only be spendable to a specific address? Is it possible to forbid all other spends? Is it possible to dictate that only that spend over a specified amount of money can happen such that the transaction fees cannot be chosen arbitrarily large?

If so, I suppose it's also possible to design an output script in such a way that it can be spent to a specific address (and only to this specific address) when a signature by a specific party is present, but to arbitrary addresses if that party's signature and also that of a specific other party is present. Should this for any reason not be possible, please let me know. This is what I'm mainly interested in.

As far as I know, the answer is no.

What you are suggesting would imply that an UTXO could affect the conditions in which the output of a transaction spending it would be built, but it can only affect how the input is built.

UTXOs can define how they should be spent, but no how the resulting UTXO spending it will be created.


Is there a chart that shows Mhps mint speed over time? My BitMinter client says that my approximate mint speed is 0.0078/per day on a MacBook Pro Retna.

I assume that this value decreases as the speed of the network increases, and therefore my contribution per block is less valuable.

Is there any chart that illustrates how Hhps diminishes value over time?
Would this chart correspond with the difficulty value/over time?

Yes, the total hash rate will correspond to the difficulty. After all, difficulty is adjusted based on how fast hashes are found.

Here is a chart on sipa.be that shows hash rate on the left axis and difficulty on the right.

Here is another hash rate chart from blockchain.info.


Creating a custom transactions I am currently learning how to create raw transactions. I can already create standard using bitcoin core (0.19.1), but when I wanted to create with custom opcode like this:

asm: OP_HASH160 d0c3f50336b5f109207d722c692191ff86263e96 OP_EQUAL OP_DROP 1
hex: a914d0c3f50336b5f109207d722c692191ff86263e96877551

I created raw transaction

createrawtransaction '[{"txid":"1c164f99a7cd0fe6dba9a7fe10ad3c2be132a9260d4ccdeaf7e279073946ac52","vout":0}]' '{"2MxmdfXx8rKGUmWUwQu59GksMNRdnQiRRM2":0.195}'

020000000152ac46390779e2f7eacd4c0d26a932e12b3cad10fea7a9dbe60fcda7994f161c0000000000ffffffff01e08b29010000000017a9143c98df42d7a69c7fd165aeb6128d45f21eeeac4d8700000000

But when I wanted to sign this transaction I occured an error (I also tried to modify raw transaction from first step) here is result with modified raw transaction from above but it still doesn't work

signrawtransactionwithkey '020000000152ac46390779e2f7eacd4c0d26a932e12b3cad10fea7a9dbe60fcda7994f161c0000000000ffffffff0130c11d000000000019a914d0c3f50336b5f109207d722c692191ff86263e9687755100000000' '["$privkey"]' '[{"txid":"1c164f99a7cd0fe6dba9a7fe10ad3c2be132a9260d4ccdeaf7e279073946ac52","vout":0,"scriptPubKey":"a914d0c3f50336b5f109207d722c692191ff86263e96877551","redeemScript":"001453352afbbaa8cad22304201de8fbcc29e83fb2db","amount":0.02}]'

Previous output scriptPubKey mismatch:
OP_HASH160 d0c3f50336b5f109207d722c692191ff86263e96 OP_EQUAL
vs:
OP_HASH160 d0c3f50336b5f109207d722c692191ff86263e96 OP_EQUAL OP_DROP 1 (code -22)

Now I know I'm doing something wrong, but I don't know what and I can't find any information on how to do it correctly. That's why I have questions:

What am I doing wrong?
Can I create custom transactions using the Bitcoin core, if so how?
If I can't use this wallet, how can I do it? I would be grateful for an example

In your script the previous ScriptPubKey is different.
If you want create custom script you need to sign manually the transaction, you can't use signrawtransactionwithkey. Bitcoin core sign only the standard transaction


I got an error that says curl: (7) Failed to connect to localhost port 18332: Connection refused I could succeed to work the testnet at once.However after I restarted my Mac,bitcoind came not to work.

bitcoind doesn't restart after your computer restarts. Start bitcoind after you start your computer.


Bitcoin-Qt frozen catching up/sync with Bitcoin in new wallet I downloaded Bitcoin-Qt, got it running, had 15 weeks or so left to catch up (sync) when I purchased some bitcoins and had them sent to my new wallet.

Then to my horror, Bitcoin-Qt has frozen with four weeks to go. It has been running 48 hours without any change in changed blocks left. I have restarted my computer, rebooted the modem, all the simple things but no love.

What can I do to access this wallet? I'm new to all this. I only ever used my online wallet address before.

If you still have the wallet.dat file from the bitcoin-qt installation at the time got the wallet address that you sent the money to you can use that with a new bitcoin-qt installation to try to make it work. If you don't have that wallet.dat file anymore the money is lost.

As for the problems downloading the blockchain, are you sure you have enough space? It's about 12 GB now. It sometimes take a very long time to download and may just look like it's sitting around for a while doing nothing, then pick up again a while later.


What does blockchain.address.listunspent exactly return? I am building a simple application that allows user to create and broadcast spend transaction by providing a private key to get funds from and a BTC address to send those funds to.

The application first calculates the BTC address of that private key and then performs a request to a electrum server:

{"id": 0, "method":"blockchain.address.listunspent","params":["1addresshere1fk29ka3"]}

The problem is, this only returns a list of [transaction hash, output position, value in satoshis, position in blockchain] for every output. But it doesn't contain the script of that output.

Is it safe to assume that every output script is going to be the standard pay-to-hash  '76a914' + addr_hash + '88ac' ??

Or do I have to perform another request asking for the raw of all the provided transaction hashes and check that the specific outputs are actually a standard pay-to-hash?

Will blockchain.address.listunspent only provide outputs with pay-to-hash scripts? Will it provide outputs with other kind of scripts such us multisig? Even if its a 1 of 2 keys and you have 1 of them?

And another question, blockchain.address.getbalance, does this also only give the total balance of pay-to-hash scripts? Or does it also add the multisig scripts?

And a final question, will blockchain.address.listunspent return the ouputs that were spent in an already broadcasted transaction that is not yet added in the blockchain?

Is it safe to assume that every output script is going to be the standard pay-to-hash '76a914' + addr_hash + '88ac' ??

Usually.

For your example the full scriptPubKey looks like  OP_DUP OP_HASH160 PUSH_20 0x9C1185A5C5E9FC54612808977EE8F548B2258D31 OP_DUP OP_CHECKSIG, but this can also be encoded non-canonically as OP_DUP OP_HASH160 OP_PUSHDATA1 0x14 0x9C1185A5C5E9FC54612808977EE8F548B2258D31 OP_DUP OP_CHECKSIG using a OP_PUSHDATA1 in place of the direct push opcode. There's no functional difference to this and the script will be longer as a result, but there are outputs like this in the unspent outputs database that fit this pattern.

In total there's 4 valid permutations for each P2PKH script, direct push, OP_PUSHDATA1, OP_PUSHDATA2 and OP_PUSHDATA4. Different software either sees these as valid, or simply ignores, it's undefined exactly what people should be doing with them. They are spendable and technically the same as the most obvious permutation, but it's not clear on the outset that this behavior is even permissible.


How does Proof-of-Stake works programmatically I've researched on the internet, but am still confused about how Proof-of-stack works programmatically.

As mentioned here, in Proof-of-Stake system, A random Nextcoin is selected to be the next "miner". Which node is designated to randomly select a node as the next "miner"? Or in other words, how can a system agree on a random number in a way that can't be manipulated?

In most proof of stake systems, there isn't really some node that says "this node is the next staker". Rather what many do is, using data from the blockchain, calculate a set of public keys (the set can just be one public key) that can be the next staker. If a node that has the private key for one of those public keys is online, they can construct the next block.

The way that the set of public keys is determined varies by coin, but they all use data from the blockchain and a deterministic algorithm so that all nodes will come to the same set of public keys.

The randomness in these algorithms typically comes from hashing data which could not have been known beforehand (e.g. for block n, take the hash of block n-1). In this way, a random number is generated such that all nodes on the network will generate the same number.


I know I had Bitcoins back in the Day, but I have all my old computers and have the hard drives, so how do I systematically go back finding which on has my bitcoins?  At the time, I figured it was no big deal, but now finding the correct one, could be worth while.

So my question is, how to I search my hard drives to find the one that contains the bitcoins?   Is there a file I need to search for?

It depends on the version you were running, and the operating system, and when you say you are looking for your bitcoins, what you are really looking for are the private keys.

Bitcoin Core

The keys are in a file called wallet.dat which was stored in the bitcoin core data directory, which I'll call <data-dir>. The wallet.dat file was stored in <data-dir>/ on versions prior to v0.16.0 and moved to <data-dir>/wallets in later versions, see files.md. This uses the bitkeys format.

Linux
On linux, the data directory <data-dir> is ~/.bitcoin/wallets/wallet.dat

Windows
On Windows, the data directory <data-dir> is %APPDATA%\Bitcoin\wallet.dat

Mac
On Mac, the data directory <data-dir> is ~/Library/Application Support/Bitcoin/

Reference: https://en.bitcoin.it/wiki/Data_directory#Mac

The next question is "How do I restore the keys?", and there are many answers for that already, example: Import wallet.dat into a new Bitcoin-Qt client


HTC Exodus - New phone Capable To Run Full BTC Nodes - is this possible? https://mashable.com/article/htc-exodus-1s-blockchain-phone/?europe=true

Hello people.

I read about the above linked article on a new HTC blockchain-capable smartphone.

Now my 2 questions are:

1)  >How can this phone act as a "FULL NODE" of BTC? Is this really true?  You could throw away your full node on linux computer, and instead use the HTC phone?

-First, I have difficulty to understand how its going to store the hundreds of GB of data...

-I am thinking about the mining activity. how can this small piece of phone chip do mining if it cannot achieve high hash rates?

2) Is such a fullnode phone helpful and positive impact on the overall btc network (what are the positive impacts?)?

Thank you for explanations.

1) >How can this phone act as a "FULL NODE" of BTC? Is this really true? You could throw away your full node on linux computer, and instead use the HTC phone?

A smartphone is just a lower power computer that fits in your pocket. For a computer to be a full node, it just needs to run full node software. Phones can already do this, and it seems like HTC is just pre-installing an app to run a full node on this phone.

In fact, right now you can run a full node on a phone yourself using the ABCore android app.

  -First, I have difficulty to understand how its going to store the hundreds of GB of data...

By using a high capacity MicroSD card. The phone will have a MicroSD card slot, and MicroSD cards can already have capacities as high as 512 GB. Alternatively, the node could be a pruning node so it doesn't actually store the entire blockchain history. Pruned nodes are still full nodes, they just don't serve historical blocks to other nodes.

  -I am thinking about the mining activity. how can this small piece of phone chip do mining if it cannot achieve high hash rates?

Full nodes are not necessarily miners. You can have a full node without mining or producing any blocks at all whatsoever.

  2) Is such a fullnode phone helpful and positive impact on the overall btc network (what are the positive impacts?)?

Yes. Any full node is helpful to the network. Full nodes validate and relay all blocks and transactions they receive. More full nodes means more people are verifying that blocks and transactions are correct. More full nodes in general help make Bitcoin more robust and decentralized.


How to get the private key in hex from the output of dumpprivkey I am trying to create raw transactions according to the excellent answer of runeks here:
How to redeem a basic Tx?

But there he starts with a private key in hex format
18E14A7B6A307F426A94F8114701E7C8E774E7F9A47E2C2035DB29A206321725

and I have one in base58 given by bitcoin-cli dumpprivkey:

bitcoin-cli dumpprivkey 154G5oUywHU3pESNy4oBBpkmAGqRZiYxBk
KzRVLwCuCi2tH2PpSNZnwUqPwg6gaqXAM2LWobUurzAsNdC5JesE

How do I get it in hex in the right format?

OK, I managed to do it with the excellent bitcoin-tool by matja
https://github.com/matja/bitcoin-tool

git clone https://github.com/matja/bitcoin-tool.git

cd bitcoin-tool

make test

./bitcoin-tool --input-type private-key-wif --input-format base58check --output-type private-key --output-format hex --network bitcoin  --input "KzRVLwCuCi2tH2PpSNZnwUqPwg6gaqXAM2LWobUurzAsNdC5JesE"

which gave me
5f92519eef7ec4e37cbcd25f9ba4a82e5acf9a8cd274d4d3aa3aa727fd7b6969

as a result.


What happens when NameCoins stop being generated? When Bitcoins stop being generated it won't be a problem: prices can gradually be lower. Namecoins, however, have a more-or-less set price, which is the domain register price. If Namecoins stop being generated, but people of course still want to register domains, what happens?

The Namecoin block reward is to be halved every 4 years, similar to Bitcoins. The fee to register a domain in Namecoin is set to decrease by the factor of 2 every two months, and later by a factor of 4.

As the price of registering a domain go down way faster than the block reward, there won't be a shortage of opportunities for registering domains. On the contrary, soon the price of a domain might be so cheap as to make them almost free. As Namecoins are destroyed though, eventually in the far future one might expect to run out of Namecoins, but with the price/reward ratio decreasing so fast, the project can become obsolete by then.

This seems to create a lack of balance of the Namecoin protocol that can be addressed in the future.


ripple transaction max amount If I send a query

{"method":"sign","params":[{"secret":"shU9DWXZ1bhtaZRipiCedMUn1B2Gg","tx_json":{"Amount":9000000000,"Account":"rPa8RMPnEJxW4dpkJhnqj7GQYUB9PQ5gEW","Destination":"rH7k1edohG2XCBuTiB8RrMaKRgi2wNkXYg","DestinationTag":100008276,"TransactionType":"Payment"}}]}

The testnet Ripple server (https://s.altnet.rippletest.net:51234) give me

Unable to parse request: * Line 1, Column 90 '9000000000' exceeds the allowable range.

How can I send more than 9000 XRP at one transaction?

I don't know if this issue still a problem? But Sending the amount property as a string worked for me.


Input script difference What is the difference or the meaning of these two headers of input scripts?

1) 4730440220
2) 4830450221

I see a lot of them in transactions but I don't understand the difference.

Thanks

For most transactions, the input scriptSig will be a push of the signature followed by a push of the public key. The "push" part is done with script opcodes which say how long it is, and the signature is encoded as DER.

47/48 are the push opcodes, to say 0x47 or 0x48 bytes will follow. Then the signature is encoded as:
0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S] [sighash-type]
So the total length in your examples is either 0x44 or 0x45, and the R-length is 0x20 or 0x21.


How is it possible that transactions can be added to a block currently being mined? It seems counter-intuitive that the current block can be hashed and transactions can be added to it, however that is what this thread indicates.

Can someone help me connect the dots (not necessarily regarding that linked network attack) and understand how something under active computation can have its underlying data (list of transactions) changed?

In other words, if a tx isn't "bound" to a block via hashing, how do they relate to each other?

You're thinking that mining a block is a single long computing process, like computing the trillionth digit of pi or something like that. This is wrong. Each attempt at solving a block takes almost no time at all, and each attempt is independent of the others. Miners make many attempts every second. Each attempt has a very small chance of solving the block. It's a lottery, not a race. Modifying the block between attempts isn't a problem.

Another common misconception related to this is that everyone is working on the same block. This is also false. Every miner works on a different block.


Two bitcoin addresses - Can you link them together? I'm new to bitcoins and I was wondering; if I generate an address, add money to it (from MtGox for example), remove the address and use another address in the future. Would it be possible to link those two addresses together?
Or would I be perfectly safe (anonymous)?

You will not be anonymous unless you take special measures to make it so.

If you simply not use the old address to receive new payments, in all likelihood there will be a point where the client will combine outputs from this address and your new addresses, and this will indicate that the addresses belong to the same person.

It will be somewhat better if you send all the coins from the old address to a new one (with change, so the amount you should send is lower than the total). Then everyone will know that coins moved from the old address to the new one, but they can't tell if they both belong to you or if this was a payment to another party.


How to access my Segwit2X currency using private key after the hard fork? How can I access my second Segwit2X currency, if I own private key, but my wallet does not support Segwit2X currency? Is that private key universal for every wallet? I mean if I can access my BTC or Segwit2X by just my identification with private key in any or some wallets.
How does it work? Will my wallet automatically support Segwit2X or what?

To use the SegWit2x chain directly you'll need to download and build the btc1 full node from the git repo. You then copy your existing Bitcoin (SegWit1x) full node wallet file into the btc1 directory to load your existing private keys.

BUT I wouldn't do that. There doesn't seem to be a safe way to spend SegWit2x coins without risking your Bitcoins. It seems like the recommended approach is to wait until after the dust has settled, with some articles indicating this could take a few days after the fork, and then determine if there's a safe way to spend your 2x coins (most likely by converting them for 1x coins which I'm sure is what you had in mind).

Update: You could take a look at the chainspl.it initiative and their associated design doc to get some additional ideas. Although after perusing the site and reading the doc I'd still say it's arguable whether the "easily handle forked coins" tag can be lived up to.


Restrict the Bitcoin usage only during a particular period I would like to know if its possible to use a Bitcoin at present in the following scenario.

When I send a Bitcoin to an another user,I set certain parameters on the Bitcoin, like it can only be used from this particular date to an another particular date. And restrict the usage of Bitcoin if its being used some other time.

Can I use it like this ?

This can be accomplished with a simple smart contract between you and the recipient using a transaction's locktime.  Here are the steps:

Create a transaction to the recipient's address spending UTXO's (unspent transaction outputs) that you own, and setting the locktime to the start date of your grace period.
Create a second transaction spending the exact same UTXO's back to an address that you own, but without any locktime restriction.
Sign the first transaction, and give it to the recipient.
When the grace period begins, the recipient can broadcast the transaction and receive the coins.
When the grace period is over, sign and broadcast the second transaction.  If the first transaction has already been broadcast, it will be invalid and not relayed or included into a block.  If the first transaction has not been broadcast, then you will want to reclaim the coins, thus invalidating the first transaction.

This plan assumes that you are in control of the second transaction and paying attention, such that you remember to broadcast the second transaction.  It also assumes that the recipient trusts you to respect the grace period, and not broadcast your transaction until the time is up.  Problems like these could be solved with a more complex scheme involving multi-sig transactions and setting locktime on both transactions, but it doesn't sound like you need anything that complex.

See also:

https://en.bitcoin.it/wiki/Protocol_documentation#tx

https://bitcoin.org/en/developer-guide#signature-hash-types


Do checkpoints affect initial chain sync time? I've seen some guides that suggest that initial sync time for a new full node can be accelerated by setting checkpoints: false but I don't understand why that would be the case. My thinking is the opposite would be true, because bitcoind won't bother fully verifying blocks below checkpoint height?

A Checkpoint is the header hash permitted at a given height, thereby hardcoding the chain that the validating node must follow. If a node follows an alternative chain branch which reaches the same height, this branch can now be identified as such and rejected. This was initially designed to protect a node from following an alternative long branch, especially generated with low difficulty, which could be so long that it would challenge the available resources of the validating node.

Validation used to be skipped prior to checkpoints, but that is no longer the case. Validation is skipped up to "known blocks", but only if these are found in the strongest chain. Today, checkpoints don't reduce chain sync time.


Do any ETFs purchase Bitcoins? Is that scenario possible? Is there any ETF that allows for the purchase of Bitcoins?

Is this possible?

More info...

An ETF is like a stock that is publicly traded on the stock market, and it can represent:

A collection of stocks
An asset, like gold or silver
A position, such as a derivative on an index like SPX$

A Bitcoin Trust fund registration statement was filed today with the Securities and Exchange Commission. If approved it would be the first Bitcoin ETF you can trade in the market.

UPDATE: The Bitcoin ETF was not approved.

  As discussed further below, the Commission is disapproving this proposed rule change
  because it does not find the proposal to be consistent with Section 6(b)(5) of the Exchange Act,
  which requires, among other things, that the rules of a national securities exchange be designed
  to prevent fraudulent and manipulative acts and practices and to protect investors and the public
  interest.
  The Commission believes that, in order to meet this standard, an exchange that lists and
  trades shares of commodity-trust exchange-traded products (“ETPs”) must, in addition to other
  applicable requirements, satisfy two requirements that are dispositive in this matter. First, the
  exchange must have surveillance-sharing agreements with significant markets for trading the
  underlying commodity or derivatives on that commodity. And second, those markets must be
  regulated.


how to calculate the inputs to raw transactions? I'm wanting to send a raw TX, but i don't know how to come up with some of the parameters to the commands. What goes into the commands, what commands get used, and how to calculate anything that needs calculating. I know this needs to be done in the bitcoin command-line/console.

The structure of a transaction is documented in the tx section of the Bitcoin protocol specification.  To make the inputs, you need to find outputs from previous transactions that have not been spent yet, and you need to write a little script to unlock each output.

The script that you write will run first, and it will put some data on the stack in the script's execution environment.  Then the script that was embedded into the transaction's output will run, and it will evaluate whether your script supplied the right data.  The scripts of the outputs generally are pretty simple and only follow a couple of standard forms, so if you can recognize which form it is then you should be able to come up with an input script that satisfies it.  You might look at the isStandard function in Bitcoin Core to understand what scripts are standard.  The Solver class used there is problably the class that generates an input script for an output script; essentially it solves the puzzle of producing data that will be accepted by the output script.

I think if you follow the links above and look into it you should be able to figure out what is going on.


How to find the Bitcoin addresses used to create a Multi Signature address Assume we have a 2 of 3 multi signature address and we send some bitcoin to that address.

Then we spend the funds from that address by signing and broadcasting a transaction.

Just by looking at that transaction, can you tell the public keys whose private keys were used to sign that transaction?

Yes.

After the spending multisig transaction is on the blockchain (not the funding transaction), you can see the public keys used to spend those multisig funds.

These public keys are found in the full redeemScript provided in the spending transaction. See a breakdown of a multisig spending transaction here, which shows that a redeemScript is indeed included in the spending transaction. See a breakdown of the full redeemScript here, which shows that the public keys are included in this full redeemScript.

Let me clarify that the public keys are not seen in the funding transaction because only the redeemScript hash is revealed here, not the full redeem script.

Note: In the explanation above, I'm assuming you are talking about the Pay to Script Hash (P2SH) form of multisig, which is the more common and modern form of multisig. The answer to your question would still be yes for a non-P2SH multisig transaction, except that the public keys are visible in the funding transaction, rather than the spending transaction. The public keys are revealed in the scriptPubKey of the funding transaction, which looks like:

<m> <A pubkey> [B pubkey] [C pubkey...] <n> OP_CHECKMULTISIG

Source: https://bitcoin.org/en/developer-guide#multisig


How does your account get credited when you send bitcoins(ex. Coinbase) This question might have already been answered. If so, can someone send me the link to it.

Let's say I create a blockchain wallet. It gives me a bitcoin address to deposit coins. Once I send bitcoins to the address that is given how does the system know what account is associated with that bitcoin address.

I wanted to develop a site where you can deposit bitcoins into your account and I want to know how that is done.

There are no accounts as far as the block chain is conerned.  A transaction will show up in any wallet that contains a private key associated with one of the transaction outputs.  So if you create a wallet, export the private key and then import the private key into a different wallet, a transaction sending coins to the address associated with that private key will show up in both wallets.  Either wallet can spend the coins although this can lead to synchronization problems with the other wallet.

A wallet is responsible for scanning the block chain and recognizing relevant transactions.  If the wallet is online, it is notified when a new block is broadcast so that it can update its wallet transactions.  if the wallet is offline, it needs to scan the block chain when it comes online to pick up any blocks that it missed.

So the answer to your question is the private keys control which wallets contain a specified transaction.  In your case, you would need to create a different private key for each of your customers.