How to sign a transaction using multi signature using bitcoind? I created a multisignature address using

bitcoin-cli createmultisig 2 '["04A97B658C114D77DC5F71736AB78FBE408CE632ED1478D7EAA106EEF67C55D58A91C6449DE4858FAF11721E85FE09EC850C6578432EB4BE9A69C76232AC593C3B","04019EF04A316792F0ECBE5AB1718C833C3964DEE3626CFABE19D97745DBCAA5198919081B456E8EEEA5898AFA0E36D5C17AB693A80D728721128ED8C5F38CDBA0","04A04F29F308160E6F945B33D943304B1B471ED8F9EACEEB5412C04E60A0FAB0376871D9D1108948B67CAFBC703E565A18F8351FB8558FD7C7482D7027EECD687C"]'
{
    "address" : "38aNB81yPqNp6X2T3rXYZN8Z3C4pSbqEvs",
    "redeemScript" : "524104a97b658c114d77dc5f71736ab78fbe408ce632ed1478d7eaa106eef67c55d58a91c6449de4858faf11721e85fe09ec850c6578432eb4be9a69c76232ac593c3b4104019ef04a316792f0ecbe5ab1718c833c3964dee3626cfabe19d97745dbcaa5198919081b456e8eeea5898afa0e36d5c17ab693a80d728721128ed8c5f38cdba04104a04f29f308160e6f945b33d943304b1b471ed8f9eaceeb5412c04e60a0fab0376871d9d1108948b67cafbc703e565a18f8351fb8558fd7c7482d7027eecd687c53ae"
}

Now my address is : 38aNB81yPqNp6X2T3rXYZN8Z3C4pSbqEvs.

I have to send some coins to another address with my address ( created using multisignature). To create a transaction, I have to sign with atleast 2 private keys. Could anyone explain how to do that?

Generally you would need to show,us a bit more information, so we can see, how far you got, which steps were taken, etc... this would allow to follow the possible issue. (See also help files here, how to create good questions).

I have two references for you, with solutions for multisig signing:
Here it was discussed on bitcoin.SE.

And Gavin explained it here step by step on the testet.
If you have followed the links, let us know how it goes, or where you got stuck, then we can probably help better :-)


Does the introduction of Schnorr signatures require segwit? What is the relationship of segwit and Schnorr signatures? Is segwit a prerequisit for Schnorr signatures?

I've read that the transaction versioning of Segregated Witness would allow to just assign Schnorr transactions a new version number. Is that a requirement?

The current proposal for Schnorr Signatures relies on script versioning, a feature which would be introduced by SegWit. If SegWit doesn't activate, many things are still possible in bitcoin via a hard fork or a complicated soft fork, and Schnorr might be one of them. No reasonable proposals towards that end exists today.


Is there a service that automatically "sweeps" funds to another address whenever they are sent? There's the sweepprivkey proposal from 2011 which was not accepted, that would have allowed one to instruct her bitcoind client to listen to transactions and sweep funds whenever they are transferred from one address to another.

There is also this question, "Is there a way to automatically send bitcoins from one wallet to another?", but it does not specifically ask about a service that would do that.

I was wondering whether someone developed, or is considering the development, of such a service.
There would be security implications, as the service would have to know the private key of the address to sweep - is there any secure way to implement this otherwise?

You could make one using bitcoinj which listens for txns, then triggers a spend.
Perhaps you would use rpc to control bitcoind to make the spend, and only use bitcoinj for the listening side ?
That should (I haven't done it but hope to soon) not require any private keys to listen to the wallet.
See this: Listening to all transactions of the Bitcoin network

bitcoind appears to be pull oriented, while bitcoinj can be set up to be push related, sort of.


Why do dustcoin.com and coinwarz.com give opposite results of profitability? It's been several days in a row that I go to dustcoin and see Dogecoin being listed as less profitable than either Digitalcoin and BBQcoin, with the latest being the most profitable.

But then if I go to coinwarz I see the inverse: Dogecoin is the most profitable, next Digital and finally BBQ.

The prices listed for them are not that different, nor is the difficulty - below the values. E.g. the values at the time of writing this question - first columns are from coinwarz and then the values for dustcoin:

coin   vs. BTC                diff.    vs. BTC   diff.
BBQ  0.000048 (Cryptsy)      4.3986 0.00005165   3.192
DGC  0.00036494 (Cryptsy)   11.3679 0.00035000   8.062
DOGE 0.00000031 (Coins-E)  286.6240 0.00000028 271.845

I would've thought that getting the profitability would be a straight away calculation, given the hashpower at your disposal vs. the avg. reward for a coin, plus the difficulty of it's network and the value it commands on the market.

So I can't explain why each site gives the exact opposite answer for these coins in particular - my inner cynic suggests at least one of them gets paid to artificially increase/decrease the profitability of some coins, but I find that hard to accept as well.

Any ideas?

First off, don't listen to so called "profitability" calculates they are always wrong.

and here's why:
Each "profitability" site bases the profitability based on the current block on that network vs bitcoins current block. Well most of these coins have a limited exchange volume on exchanges (some as low as 0.001 btc) yet because of that activity they are deemed to be more valuable. What happens next is a huge dump of coins and a market crash. This leads to an increase in diff and a decrease in profitability. Using that theory, you can see that these sites are not going to be correct. Especially depending on the exchange they use and the rates they use. Most coins only convert from ALT->BTC. So that means they will take the BTC/USD price from somewhere like bitstamp and then take the ALT/BTC price from the exchange of choice and finally it will take BTC*USD.

BEGIN EDIT
Simple formula these sites use

$profitability = $USDperBitCoin * $BitCoinperAltCoin

END EDIT

tl;dr
Exchange rates and exchanges used.
Low volume of trade.
Unique Difficulty filter algos on unique coins

I suggest you ask the owners of the sites this one.


Is there a service that shows up used addresses containing a substring? Is there a service that searches the blockchain with a string or possibly a regex to find out a set of possible addresses, say if I only know a half of a public address?

https://goochain.net had an option to search bitcoin addresses in the explorer with a string that has few initial characters according to this link: https://bitcointalk.org/index.php?topic=808066.msg9179505#msg9179505
The block explorer is dead and I have not seen this option in any other explorer used right now.


Is there a system that support job contracts? I am wondering if there is a system that support bitcoin contracts like:

If I made a deposit to a wallet - this wallet takes 10% of the BTC and transfer it automatically to another wallet.

You could use a payment API similar to:

http://dev.blockcypher.com/#payments_summary

This gives you a new address for which any deposit will be automatically transferred to another address of your choice. I'm sure they could implement the 10% fee transferred to a separate wallet very easily.


My client stopped synchronizing, how can I access my wallet? My wallet has been stuck synchronizing for 21 days, my transfer is in the block chain but I can't get it to sync with my wallet. I've closed firewalls, uninstalled and reinstalled QT with back up and cannot get the wallet to get current, it is frozen and I can't get my 20 BTC. I'm fairly new and am unable to copy and paste blockchain or whatever. I still have the original Bitcoin address the bitcoins were transfered to from my mtgox account.

I can help!

Your money is "yours", it just isn't being listed in your wallet because as you say, your wallet is having trouble updating... That's OK! You can access it in other ways, such as an online e-wallet:

First, we need to get your "private key":

Close bitcoin completely, then
Open control panel, select "large icons" in the top right corner
Click "folder options", or if you are opening it from the start menu, just click "folder options"
Click the "view" tab
under "hidden files and folders", click "show hidden files and folders and drives"
Deselect "hide extensions of known file types", this will allow you to see the bitcoin working folder
press OK
right click the start button and click "open windows explorer"
doubleclick "local disk (c:)" under "my computer"
doubleclick "users"
doubleclick "yourusername" eg "john"
doubleclick "appdata"
doubleclick "roaming"
doubleclick the "bitcoin" folder

(this is for Windows 7, for XP the directory is C:\Documents and Settings\YourUserName\Application data\Bitcoin (XP))

right click an empty area in the folder and select "new">"text document"
doubleclick the new text document
type the following 2 lines into the empty text document:
rpcuser=someusername
rpcpassword=somepassword
replace someusername and somepassword with anything (you don't have to remember it later) so button mashing udhf9w8dg98rgu will work (no spaces)
"file">"save as" type "bitcoin.conf"
press save
Right click the start button and click "open windows explorer"
doubleclick "local disk (c:)" under "my computer"
doubleclick "program files(x86)"
doubleclick "bitcoin"
hold shift and right click on "daemon"
click "open command window here"
type "bitcoind"
leave that window open,
Wait 2 minutes for the daemon to load
Don't close the window
Go back to the explorer window, and again,
Hold shift and right click on "daemon"
Click "open command window here"

If your wallet is encrypted, go to A then proceed to B if not go straight to B

A: type "bitcoind walletpassphrase 600" where walletpassphrase is your wallet password and press enter
B: type "bitcoind dumpprivkey 1YourBitcoinAddress1234567890"

replace 1YourBitcoinAddress1234567890 with the address where you withdrew the money to. You will get a long string of numbers. Leave this window open...

Upload the private key to a managed service

Goto blockchain.info
click "wallet" at the top
click "start a new wallet"
sign up for a new wallet
once your new wallet is created, log in to it.
go to the tab that says "import/export"
press "continue" at the warning
where it says "import private key", type the long string of numbers EXACTLY from the black window
press "add private key"

Your wallet is now managed online.


Extra Charge for Recurring Transactions on Coinbase I had a recurring transaction for $1.00 a month posted to my account. For a while the transaction in Coinbase would read $1.00 for some bitcoin. The bitcoin amount would change but never the dollar amount. Now the dollar and the bitcoin amount is changing, to the point that I enter $1.00 a month and when the actual transaction post, the usd dollar amount says $3.00 and some change, why is the dollar and the bitcoin amount changing? Am I being charged for higher fees or something now?

Coinbase is no longer paying the Bitcoin transaction fees for their customers; they are now shifting that responsibility onto their customers. This extra charge that you are seeing is likely because of this change.


What are the most popular CPU/GPU miners with scrypt-jane support There are a few github projects, but it doesn't look as though there's a 'mainstream' option with good support for varying protocol. Is there any one most popular?

There is a working version of cgminer that supports both scrypt and scryp-jane, available here:

https://sites.google.com/site/rmdavidson/


Is "volume" the quantity of BTC exchanged, or the number of trades completed? Suppose the following trades happen

Trade 1:   100 BTC  @ $75
Trade 2:   0.5 BTC  @ $76
Trade 3:   100 BTC  @ $77
Trade 4:   100 BTC  @ $78
Trade 5:   100 BTC  @ $78

Five individual trades occurred for a total of 400.5 BTC.  There was a total of 200 BTC acting as a wall at $78.  Similar to how I monitor the trade wall at mtgoxlive.com, I'd like to determine if the "wall moved" or if the "wall was eaten"/traded.

I'm trying to gather that information from the MtGox website and not sure if they display the count of individual trades, or the BTC sum.

Here, in the top level drop down menu Volume:75584 BTC however in the drop down graph I see volumes that range in 1,000 to 3,000 total.  In the most current example I see a volume 17,261 of something (either trades, or BTC, I'm not sure)

It seems that volume is measured in two ways, but with the same word:

The quantity of BTC shares (and fractional units) traded
The quantity of trades taken (a whole number)

Since MtGox seems to overload the meaning of "volume" in the two instances, where can I find a more accurate representation / graph of each interpretation of "volume"?

They're both representing the same thing over different time periods. The values on the drop down are always for the past 24 hours, the values on the graph depend on what time range you're viewing.

In your example 75584 is the number of bitcoins traded in the past 24 hours, and 17261 is the number traded between 19:00 and 20:00


Restore keys from keypool So, I generated a new address with getnewaddress and made a payment to it. Soon after the computer bitcoind ran on shut down (due to loss of power) and after booting it up again my wallet doesn't know of the address anymore. I'm assuming all that happened was that the newly generated address wasn't written to disk in time. But the keys should still be in the keypool, right? How do I restore the keys and import them into the wallet? I still have the address.

Keypool keys are already in wallet.dat.  That's the whole point of the keypool.  When you run getnewaddress, you get the address corresponding to the oldest key in the keypool, and a new key is generated and added to the keypool to take its place.

So if your hypothesis is right, the key is still in the keypool, and if you execute getnewaddress again, you should get the same address as you got before.  Then you'll know you have the key.  bitcoind may not expect that there are already transactions on that address, so you might have to run bitcoind -rescan to pick them up.


Why do mining pools require 120 confirms for a solved block before payout? According to this question here, 6 confirmations can be considered 'secure enough'. Some pools out there also offer payout at 100 confirms but that's still substantially higher than 6.

Why is such a high confirmation count required for this?

There is a protocol rule which prohibits generated BTC from being spent until it has 100 confirmations. The Satoshi client has an additional safety margin: it won't let you spend generated BTC until it has 120 confirmations. The purpose of this rule is to prevent long chain splits from invalidating lots of transactions that spend newly-generated BTC. For example, this rule prevented non-coinbase transactions from being invalidated after the overflow incident invalidated 50+ blocks.

Some pools (e.g. Eligius) pay people by putting the payments in generation transactions. The recipients still won't be able to spend this BTC for 100 blocks, but at least the payments will appear in their Bitcoin clients right away.


Signing a blank input? Is it possible to include a blank input in a transaction?

For example, a blank input could be used to guarantee a particular output was included in a transaction, using SIGHASH_SINGLE | ANYONECANPAY in combination with SIGHASH_NONE.

Of course you would still need to include miner fees within another input.

Correct me if I am wrong, but although spending 0-output utxos is legal, it is fairly difficult to generate 0-output utxos, as Bitcoin Core does not support generating these transactions beneath the dust limit.

Likewise, OP_RETURN provides 0-value-output utxos, but they could not be spent as part of a sighash_single, since they are unspendable.

For example, a blank input could be used to guarantee a particular output was included in a transaction, using SIGHASH_SINGLE | ANYONECANPAY in combination with SIGHASH_NONE.

You cannot use SIGHASH_SINGLE | ANYONECANPAY in combination with SIGHASH_NONE. You cannot have two or more of SINGLE, ALL, NONE on a single input, they can only be combined with ANYONECANPAY.

Moreover, if you are able to create a zero value (or even dust output), that single output alone will be enough to enforce the rule "If you use this output, you must send X BTC to this address". However, if you have a zero value or dust output, no one is really incentivized to include it - after all, you aren't contributing any significant value to the tx. In fact, you are raising the fee due to the extra input/output size. People will just drop your input and output and build a tx without it.


Reverse wheresgeorge.com for BTCs Say I give 1 BTC to Alice who gives it to Bob who gives it to Carol. Can I now figure out that my original BTC is now with Carol? Of course, by Carol I mean an anonymous address.

I'm thinking of a reverse wheresgeorge.com where I can trace where a BTC I owned went. I presume this is not possible otherwise hackers would never be able to keep stolen bitcoins.

Actually, yes, this is possible. However, your payment output might get split or combined with other payment outputs in later payments. Therefore, the graph will be less linear than you suggest:

    C ↴       ↱ H
A → B → D → E → G
          ↳ F

So, A would be sent to B, then B + C would produce D, D would be split up to E and F, E would further be split up to G and H.
B would be a 100% child of A, D, E, F, G and H only 50% (if A and C were the same size).

This would get much more complicated over time where many outputs get combined and split and so forth, but you could actually continue to track this forever. The issue is actually not with the tracing of funds, but with the proving that funds were indeed stolen. If you are more interested in this, you might find this related question useful: What are tainted coins exactly?


How can I hide my bitcoin transactions to protect anonymity from others? Please take a look at this transaction link of bitcoin :
https://www.blockchain.com/btc/tx/blablablabla

My bitcoin address is :  blablablabla
You can see all of my transactions by this link :
https://www.blockchain.com/btc/address/blablablabla

My friend address is :  bc1qhkshfzwzm6cl8ezsg5fw7yhpsdqtp4r3vfzzzz
But you can't see all of his transactions by this link :
https://www.blockchain.com/btc/address/bc1qhkshfzwzm6cl8ezsg5fw7yhpsdqtp4r3vfzzzz

What is this address : bc1qhkshfzwzm6cl8ezsg5fw7yhpsdqtp4r3vfzzzz
And why is it undetectable?
How can i hide my transactions from others like that address?

Your address is a classical 1 (Pay-to-public-key-hash) address. Your friend has a newer Bech32 Pay-to-Witness-public-key-hash-type address. The block explorer you referenced is partially compatible with Bech32. Sometimes, it doesn't work. On the other hand, there's nothing that prevents you from looking at your friend's transactions using a different block explorer such as https://Blockstream.info or https://blockchair.com/.


Is the entire blockchain kept in memory? Putting aside pool mining, does the Bitcoin mining program keep the entire blockchain in memory? Including transactions?
I've been reading through the original Bitcoin code and it looks like the entire chain is kept in memory. Of course that code is over 10 years old, so I'm sure it's changed quite a bit, but I'm still curious.

The original Bitcoin code base definitely didn't support this.
Currently it's possible to effectively keep the entire UTXO set in memory in Bitcoin Core if you set the database cache large enough (over 6 GB, last I checked). The blockchain itself is always stored on disk.


Bitcoin transaction anonymity Possible Duplicate:
  How do I see the IP address of a bitcoin transaction?

When making a bitcoin transaction from or into a wallet that is on my computer, can my Ip address (and thus identity) be found out by the other part of the transaction or a 3rd party?

Making a transaction

When you make a new transaction sending Bitcoins, you broadcast the transaction to the peers you're connected to, then they send it on to their peers, etc.  There's no way for anyone to know for sure whether you created a transaction they get from you, or whether you're just relaying a transaction you received from someone else.

If I was able to connect to all the peers in the network then it's likely that the first one to send me a transaction is the one who created the transaction, but that's not certain, and it's also not possible to connect to all the peers.

Receiving a transaction

When someone sends Bitcoins to your address, your client isn't involved at all.  You don't even need to have your computer turned on to receive Bitcoins at your address.  So there's no way anyone can find your IP address when you receive Bitcoins.


I need to import a private key - what is the entire process? [Electrum] I need to import a private key like in this question for a p2wpkh-p2sh address. What is the entire process?

The entire process is as follows: (these instructions are correct for Electrum v3.0.6)

Install Electrum. The installation methods vary but, the official download is here. On some varieties of Linux it is in the default distro repository.
Run Electrum.

Choose Automatically Connect and click on Next.
Name your wallet if you like or accept the default and click on Next.
Select Standard Wallet and click on Next.
Select Create a new seed and click on Next.
Select Segwit and click on Next.
Securely, privately and accurately store your seed. This is your wallet backup. If it is lost all your BTC is gone permanently. Click on Next.
Type your seed in the box and click on Next to verify you have it correctly.
Set a good password that you will never forget. This must be secure to ensure your wallet cannot be stolen. Click on Next.
Your wallet is setup.

With Electrum setup and running, go to View -> Show console.
Click on the Console tab.
Using the instructions from here:

Type (or copy and paste) at the >> prompt key = 'your_key' and press Enter (leave the single quotes in).
Type (or copy and paste) at the >> prompt txin_type, secret, compressed = bitcoin.deserialize_privkey(key) and press Enter.
Type (or copy and paste) at the >> prompt wif2 = bitcoin.serialize_privkey(secret, compressed, 'p2wpkh-p2sh') and press Enter.
Type (or copy and paste) at the >> prompt print(wif2) and press Enter.

Highlight and copy the one-line string that is output (make sure you do not get any extra spaces) in your clipboard or, write it down.
Click on Wallet -> Private Keys -> Sweep
Paste the string you copied into the big box. The address that is pre-filled in starting (as of writing) with bc1 is one of your many receiving addresses. The balance will be transferred to that address.
Click on Sweep and follow the prompts (I didn't proceed to actually do this step - when I originally tested I used completely different steps to 'Import, not Sweep' just to prove it worked and not take the balance).
This will create a Bitcoin transaction transferring the balance to your own address.
Wait for at least 1 confirmations.

Done!

If you just want to import the address to make sure it is correct without trying to sweep you need different steps.


Best script/pseudocode to convert xpriv to xpub? I'm looking for a script/pseudocode/utility (preferably, code in javascript/c++ or a secure, verified and open-source rpc client) that can convert a given xpriv to xpub.

Only one I've found (but not tried yet) is this one  :
https://github.com/sarchar/brainwallet.github.com/tree/bip32

or I know electrum wallet client can do it. I would prefer to read through the code of a standalone script though and/or create my own script

If you are comfortable with using the command line then libbitcoin-explorer is a great utility for converting your bitcoin HD keys. It even works completely offline.

Once you have bx installed, you can run the hd-to-public command like so:

$ bx hd-to-public xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi
=> xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8

More info about the other HD Key related commands for libbitcoin-explorer can be found here: https://github.com/libbitcoin/libbitcoin-explorer/wiki/bx-hd-to-public


Binance API SIGNED GET request error code -1100 on signature parameter I am trying to load my crypto portfolio into Excel so I can use its easy analysis functionality on my trades. However, I'm having trouble connecting to the API using VBA's WinHttpRequest.

I use the following code to try to GET account info (balances) /api/v3/account:

Sub GetBalances()
Dim tNow As String
tNow = CStr(Date2Long(Now()))
Dim sUrl As String
sUrl = "https://api.binance.com/api/v3/account?timestamp=" & tNow & "&signature=[signature here]"

Dim oRequest As WinHttp.WinHttpRequest
Dim sResult As String

On Error GoTo Err_DoSomeJob

Set oRequest = New WinHttp.WinHttpRequest
With oRequest
    .Open "GET", sUrl, True
    .SetRequestHeader "Content-Type", "application/json; charset=UTF-8"
    .SetRequestHeader "X-MBX-APIKEY", "[API key here]"
    .Send "{}"
    .WaitForResponse
    sResult = .ResponseText
    Debug.Print sResult
    sResult = oRequest.Status
    Debug.Print sResult
End With

Exit_DoSomeJob:
    On Error Resume Next
    Set oRequest = Nothing
    Exit Sub

Err_DoSomeJob:
    MsgBox Err.Description, vbExclamation, Err.Number
    Resume Exit_DoSomeJob

End Sub

Private Function Date2Long(dtmDate As Date) As Long
    Date2Long = (dtmDate - #1/1/1970#) * 86400
    Exit Function
End Function

However it gives the following error message:

  {"code":-1100,"msg":"Illegal characters found in parameter 'signature'; legal range is '^[A-Fa-f0-9]{64}$'."}

Which seems strange as the secret key's character range is only A-F, while the secret provided seems to contain A-Z. Anyone else know how to solve this problem? Might it be a problem caused by VBA? Or might the problem lie somewhere else?

As per @Marc Alexander's comment I have to sign (HMAC SHA256) the query parameters (in my case timestamp=##################) and add that as signature parameter in the request. It works using the following code:

Sub GetBalances()
    Const apiKey As String = "[insert API key]"
    Const secret As String = "[insert API secret]"

    Dim totalParams As String
    totalParams = "timestamp=" & BinanceTime()
    Signature = Base64_HMACSHA256(totalParams, secret)
    sUrl = "https://api.binance.com/api/v3/account?" & totalParams & "&signature=" & Signature
    Dim oRequest As WinHttp.WinHttpRequest
    Dim sResult As String

    On Error GoTo Err_DoSomeJob

    Set oRequest = New WinHttp.WinHttpRequest
    With oRequest
        .Open "GET", sUrl, True
        .SetRequestHeader "Content-Type", "application/json; charset=UTF-8"
        .SetRequestHeader "X-MBX-APIKEY", apiKey
        .Send "{}"
        .WaitForResponse
        sResult = .ResponseText
    End With
    Set JsonResponse = JsonConverter.ParseJson(sResult)
    Debug.Print(

Exit_DoSomeJob:
    On Error Resume Next
    Set oRequest = Nothing
    Exit Sub

Err_DoSomeJob:
    MsgBox Err.Description, vbExclamation, Err.Number
    Resume Exit_DoSomeJob

End Sub

Public Function BinanceTime() As String
    Dim oRequest As WinHttp.WinHttpRequest
    Dim sResult As String

    Set oRequest = New WinHttp.WinHttpRequest
    With oRequest
        .Open "GET", "https://api.binance.com/api/v1/time", True
        .SetRequestHeader "Content-Type", "application/json; charset=UTF-8"
        .Send "{}"
        .WaitForResponse
        sResult = CStr(.ResponseText)
    End With
    Set Json = JsonConverter.ParseJson(sResult)
    BinanceTime = Json("serverTime")
End Function

Public Function Base64_HMACSHA256(ByVal sTextToHash As String, ByVal sSharedSecretKey As String)
    Dim asc As Object, enc As Object

    Dim TextToHash() As Byte
    Dim SharedSecretKey() As Byte
    Set asc = CreateObject("System.Text.UTF8Encoding")
    Set enc = CreateObject("System.Security.Cryptography.HMACSHA256")

    TextToHash = asc.Getbytes_4(sTextToHash)
    SharedSecretKey = asc.Getbytes_4(sSharedSecretKey)
    enc.Key = SharedSecretKey

    Dim Bytes() As Byte
    Bytes = enc.ComputeHash_2(TextToHash)
    Base64_HMACSHA256 = ByteArrayToHex(Bytes)
    Set asc = Nothing
    Set enc = Nothing

End Function

Private Function ByteArrayToHex(ByRef ByteArray() As Byte) As String
    Dim l As Long, strRet As String

    For l = LBound(ByteArray) To UBound(ByteArray)
        'strRet = strRet & Hex$(ByteArray(l))
        strRet = strRet & WorksheetFunction.Dec2Hex(ByteArray(l), 2)
        Debug.Assert l = Len(strRet) / 2 - 1
    Next l
    ByteArrayToHex = strRet
End Function


How can I execute a 3-way escrow with 1 unknown party? Good Evening-

I'm trying to execute an unusual 3-way transaction, where in one of the parties is not known at the start.

PartyA would initiate the transaction, and provide funding.
My thought was that he would transfer 1BTC to a dedicated wallet.

He'd then also start the transaction, and name Party B as one required signature.

For the third signature, he'd approach 5 random strangers.
He'd give them any and all information necessary to complete the transaction (including the private key of the wallet he just made if nec).

The first one who could propose a deal, and convince PartyB to accept it, would receive their share of the money.

For instance, c1 might offer B to split 80/20, where-as c2 offers to split 50/50.
PartyB signs the proposed offer from c2, and it can then execute.

It looks like there might be a way to do this with multiple signatures and p2sh, but I'm not quite sure how to make it work yet. Any thoughts or comments welcomed.

Yes, P2SH seems to be the way to go here. If you do a redeem script like:

redeemScript: DUP HASH160 {B's pub key id} EQUALVERIFY CHECKSIGVERIFY 1 {c1 pub key} {c2 pub key} {c3 pub key} {c4 pub key} {c5 pub key} 5 CHECKSIG

Hash it and use the P2SH hash as the address. Then you could spend this output with a scriptSig like:

scriptSig: {any one of c1-c5's signatures of the transaction} {B's signature} {redeemScript}

I'd do some testing with these on a testnet network before doing this for real.


Child Pays for Parent transactions get stuck on testnet I'm building a service prototype by reusing Electrum code and generated 4 consequent transactions which are CPFP type on the testnet. They are staying unconfirmed for several hours but test transaction with 10 sat/vbyte got confirmed in the nex block.

What could be a possible reason for that? Could it be testnet-specific so I should not expect the same behavior on mainnet?

The problem you're facing is that even with a high-paying child, the parent needs enough feerate on its own to get relayed on the network.

Staying below 1 sat/vB makes that hard.


Can I send almost 1MB transaction? Block size is still limited to 1MB. As I understood, transaction size is no longer limited. So can I be sure that my transaction with 29000 outputs and reliable fee will be included into block?
Or what is the max transaction size?

Can I send almost 1MB transaction?

To be able to send a transaction that a miner will accept, that transaction has to be a standard transaction. As defined in policy.h

/** The maximum weight for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_WEIGHT = 400000;

For non-Segwit transactions, the limit is 400,000 KB / 4 = 100,000 B = 100 kB.

Therefore, if you have a Pre-Segwit transaction larger than 100 kB but smaller than the block s̶i̶z̶e weight limit, you should contact a miner, and they'll be able to add your transaction to their block manually, if it's profitable for them.


How to start Bitcoin-qt with Bitcoin Cash? First of all I do not trust online wallets so I download full blockchain with Bitcoin-ABC. Unfortunaly bitcoin-abc does not contain bitcoin-qt binary. So my question is it possible to start original Bitcoin-QT with bitcoin-abc?

if this is not possible, what is the other way to use my wallet under bitcoin-abc?

Thanks!

Bitcoin ABC 0.16.1 binaries for linux have a QT GUI:
https://download.bitcoinabc.org/0.16.1/linux/ - I have not checked the other platforms, but I assume they do too.

They kept the same binary names (bitcoin-qt, bitcoind, etc) when they forked Bitcoin Core, which is a bit confusing because it is a seperate network with its own consensus rules.

The standard bitcoin-qt (Bitcoin Core) only works for bitcoin, not bcash.


explain decoderawtransaction output fields and interpretation I am trying to obtain information about a raw transaction in hex before it is broadcasted. This command multiple elements JSON formatted. I'd like a simpler explanation for them:

txid - hash of the transaction itself

hash - hash of the transaction itself. If transaction is non-segwit, txid == hash, otherwise in segwit transactions the transaction hash is different.

version - this is obvious what it is, but how should be interpreted?

size - size of the transaction in bytes

vsize - weighted size for segwit transactions

locktime - lock time of this transaction either in block height either in unix time. OP_CLTV is only determinable from the redeemscript, not from this field.

vin - this subset includes all the inputs being spent.

txid - txid of the input being spent.
vout - what is this?
scriptSig - asm / hex - this includes the signature(s) and redeemScript of this particular input. Is there any difference between asm and hex?
sequence - how can this be interpreted? How can one determine if the input is either CSV locked, either replace-able by fee (RBF)?

vout - this subset includes all the outputs of the transaction:

value - amount of this output.
n - this looks like the number / ordering of outputs?
scriptPubKey - script or pubkeyhash of the output
reqSigs - how can this be known in advance by the sender, only by having the address?
type - how can this be know in advance as well?

Additional questions:

How can the amount of each input within the vin subset be determined?
How can the scriptSig be validated, like: is the input CLTV or CSV locked? Does the redeemScript (if p2sh) validate to true (e.g. required number of sigs available, other IF/ELSE rules fulfilled)?

Your post is a bit long, in stack exchange we prefer shotrt, easy to answer questions - see here: https://bitcoin.stackexchange.com/help/how-to-ask

You probably have an example of a JSON interpretation as reference. From where do you have it? As everyone can interpret a raw transaction, I think it is best to reference the original raw transaction from bitcoin.org. This is anambigous. It would look like this (non-segwit, to keep it easy going. Segwit only on demand :-)

VERSION
TX_IN COUNT         (how many input this tx has)
 TX_IN[0...n]
  OutPoint hash     (the previous tx where funds come from)
  OutPoint index    (the n'th TX_IN)
  Script Length     (the length of the following Script Sig)
  Script Sig        (signature)
  Sequence          (a sequence field, originally intended to disable lock-time)
TX_OUT COUNT        (how many outputs this tx has)
 TX_OUT[0...n]
  Value             (the value in Satoshis)
  PK_Script Length  (length of the following script)
  pk_script         (the script, which defines the condition, under which the funds can be spent)
LOCKTIME            (earliest time or earliest block when that transaction may be added to the block chain)

The assembly of a tx before to be sent was pretty well explained by the answer of @amaclin here.

  How can the amount of each input within the vin subset be determined?

The wallet software would need to lookup the values when wanting to spend a new tx. Therefor a reference to a previous tx is required, where v_in is found. If unsufficient for the current spent, then another v_in or even another tx with its v_in will be used (TX_IN count would be increased).

  How can the scriptSig be validated, like: is the input CLTV or CSV
  locked?

I do not understand what you mean by this. Scriptsig and CLTV/CSV are not directly linked to scriptsig. CLTV and CSV both came into the game by BIP-68 and BIP-112. CLTV (as also locktime) are both absolute timelocks, with CSV we talk about relative timelocks. So they define, when a transaction's output can be spent. Maybe worthwhile to lookup in the BIPs. There is also lots in the forum here and in bitcointalk.

Scriptsig (in general) is validated with the hash and the pubkey. Ken Shirrif's blog (link at the bottom) explains very well. Scriptsig proofs, that you had the private key ("you are the rightful owner") to spend this transaction. The privkey signs a hash of the tx, which is followed by the pubkey. There can be more to it, but I want to stay general. Here is an example how you can verify a signature at the unixoide systems shell with openssl (bitcoin always uses hex encoded data to do hashes, and openssl needs a PEM formatted key):

sig=30450221009a29101094b283ae62a6fed68603c554ca3a624b9a78d83e8065edcf97ae231b02202cbed6e796ee6f4caf30edef8f5597a08a6be265d6601ad92283990b55c038fa
pk=03F5D0FB955F95DD6BE6115CE85661DB412EC6A08ABCBFCE7DA0BA8297C6CC0EC4
hash=4eb4dccd727e81315a9ff801c205efc62635471cf8668e42c1c8aebfb51500a3
printf $( echo $hash | sed 's/[[:xdigit:]]\{2\}/\\x&/g' ) > tmp_utx_dsha256.hex
echo "MDYwEAYHKoZIzj0CAQYFK4EEAAoDIgAD9dD7lV+V3WvmEVzoVmHbQS7GoIq8v859oLqCl8bMDsQ=" > cat pubkey.pem
printf $( echo $sig | sed 's/[[:xdigit:]]\{2\}/\\x&/g' ) > tmp_sig.hex
openssl pkeyutl <tmp_utx_dsha256.hex -verify -pubin -inkey pubkey.pem -sigfile tmp_sig.hex

  Does the redeemScript (if p2sh) validate to true (e.g. required number
  of sigs available, other IF/ELSE rules fulfilled)?

The redeemscript is basically a hash of "something". It has the advantage to "hide", what is intended, when the funding transaction is mined into the blockchain. When you create your spending transaction, then the data of your p2sh script is revealed. The common usage is a multisig script. But you can put all type of code into it, which would define the condition, under which funds can be spent (next to multisig, any type of smart contracts, ...). There are limitations to it. The OPCODES, that can be used are explained here. In bitcoin.org are also explanations on p2sh.

I learned all this from 2 additional references: the unbelievably well written book "Mastering Bitcoin" from Andreas, and a very good explanation on transactions by Ken Shirrif.


Who is funding the Beam mimblewimble development team? Since there is no-premine with the Beam mimblewimble project. How and who are funding their development?

There are many investors of this project.

INVESTORS

Lemniscap Investor of Beam Mimblewimble

Node Capital is investor at BEAM Mimblewimble

yeomans capital Investor of Beam Mimblewimble

PROTOS asset management Investor of Beam Mimblewimble

youbi capital Investor of Beam Mimblewimble

Alternity  is investor at BEAM Mimblewimble

1KX Investor of Beam Mimblewimble

Continue Capital Investor of Beam Mimblewimble

Mek Group  is investor at BEAM Mimblewimble

Ceyuan Ventures Investor of Beam Mimblewimble

hexa labs Investor of Beam Mimblewimble

Collider Ventures

EZRA


How was FORKID used in Bitcoin Cash at the original fork point and in all upgrades since? References:

https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/replay-protected-sighash.md

https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/2018-nov-upgrade.md

It looks to me like at the original fork point, Bitcoin-ABC added an extra value 0x40 called SIGHASH_FORKID that is xor'ed with the standard SIGHASH flags to produce a SIGHASH byte that is incompatible with Bitcoin Core. This provides replay protection for all transactions that are signed with ECDSA pubkeys.

Questions:

Is the FORKID updated with each "protocol upgrade" for example the recent "Magnetic Anomaly" upgrade? If not, why not?

It looks like the May 2019 upgrade will change the FORKID to 0xFF0001 but the spec mentions "Wallets that follow the upgrade should not have to change anything." -- how is that possible?

Did Bitcoin-SV change its FORKID for its recent hard fork away from Bitcoin-ABC? Is there any replay protection at all between those two chains?

The purpose for "after certain time, set FORKID to 0xSMTHNG" is to keep the old chain alive but separate, in case of a bug in hard fork. After a Bitcoin Cash hardfork, let's say November 2018, if you're using an incompatible client, a client that complies with May 2018, it'll make transactions with a FORKID that starts with 0xFF00, and those transactions will be invalid in the new chain. Wallets shouldn't enforce this rule, as it is assumed that they're not nodes and they are not interested in (some of) the new consensus rules, which are usually little changes, like new opcodes.

Trivia: Bitcoin SV was derived from Bitcoin ABC complying with May 2018. If they didn't commit this, there would be replay protection.


Bitcoind list all transactions from all accounts with listtransactions cli command If you run bitcoin-cli listtransactions "" 9999999 you receive a list of transactions from your default bitcoind account. I would like to receive the transactions of all accounts on my daemon, including the default account.

I would like to receive the transactions of all accounts on my daemon,
  including the default account.

$ bitcoin-cli listtransactions "*" 9999999


How to sign a transaction hash in ruby? I'm trying to sign (using secp256k1) a transaction as explained here. I'm using my own private key and an unsigned transaction as the input.

I'm able to sign it using the JSON-RPC client, but when I sign it with my own ruby script and try to submit it using blockchain.info/pushTx it returns "Invalid signature".

@secret = PRIVATE_KEY_IN_HEX
@keypair_array = Bitcoin::OpenSSL_EC.regenerate_key(@secret)
@pubkey =  @keypair_array[1]

@keypair = OpenSSL::PKey::EC.new("secp256k1")
@keypair.private_key = @keypair_array[0].hex
@keypair.public_key = ::OpenSSL::PKey::EC::Point.from_hex(@keypair.group, @pubkey)

sha_little_endian = SHA_256_HEX_STRING.rjust(64,"0").scan(/(..)/).reverse.join()
signature_binary = @keypair.dsa_sign_asn1([sha_little_endian].pack("H*"))

# Alternative (as in bitcoin-ruby)
# signature_binary = @keypair.dsa_sign_asn1([SHA_256_HEX_STRING].pack("H*"))

signature = signature_binary.unpack("H*").first

First I take the SHA hash, e.g. ABCD...001124 and convert it from big endian to little endian: 241100....CDAB. I do this because in the BitcoinQT client the hash is represented as an uint256 which is cast to a char array used as an input for signing. The result is just stored as a var so I assume I don't have to reverse it.

You'll need to download this OpenSSL_EC file and add the following code to reproduce the above steps.

require 'openssl'
require 'ffi'

module Bitcoin
  def self.require_dependency(dummy1, dummy2)
  end
autoload :OpenSSL_EC, "./openssl"
end

module ::OpenSSL
  class BN
    def self.from_hex(hex); new(hex, 16); end
    end
  class PKey::EC::Point
    def self.from_hex(group, hex)
      new(group, BN.from_hex(hex))
    end
  end
end

What am I missing?

The binary encoding of the signature cannot be used to determine if you've performed the steps correctly - it will differ for each signature (even with the same private key).

So the signature of a hash signed with the same private key will be different every time. A random number is included in the formula that calculates the signature, so the resulting signature will be different each time. If a random number was not used in the formula, signing two different hashes with the same private key would make it possible to calculate the private key from the two signatures (which is the reason the security of the Sony PlayStation 3 was breached). You can read more about that here: http://www.johannes-bauer.com/compsci/ecc/

If you want to test whether you've made a valid transaction, then feed it to bitcoind using the sendrawtransaction command. It will spit out an error if the transaction is invalid, and if it's valid you will see the transaction going through.


How do I lookup the details of a transaction, given the transaction ID? I transferred BTC from GDAX to Binance.  I have the transaction ID.  How do I find out the status of the transfer.  GDAX reports transfer complete.  Thanks.

I found where GDAX shows the transaction hash!

Visit https://www.gdax.com/accounts
Click a coin on the left (BTC, BCH, ETH, or LTC).
Instead of staying on the "History" tab (which is probably where you see Transfer ID for each transfer), click "Transfers" in the top right.
Then click each "withdraw" row to expand it, and you'll see its transaction hash.

For example, I'm able to find the hash of an LTC that I just transferred, and then I can browse to https://bchain.info/LTC/tx/4a857bc76d31c801dbc1aac33c4940cd11401f7f7401dfd6e05dfcf43af8867e and see that it has already been confirmed twice.


How do deterministic wallets know how many keys to generate? Say I backup the "seed/key" for a deterministic wallet. I then create 10,000 transactions, resulting in 10,000 new addresses being generated.

Say I then lose the wallet file and I restore from the "seed/key". How does the deterministic wallet know it has to generate 10,000 addresses to get the full balance?

You've hit upon an important issue, and one that there isn't a perfect solution to.

Your thin client (most clients that use deterministic wallets are thin clients, but not all) goes through the following process:

Generate an address.
Look at the blockchain, and see if it has a balance.
Repeat with next address, unless the addresses we've checked have had a balance of zero for a long time.

The number of empty addresses you're willing to check before giving up is called the gap limit.

The gap limit can't be too low, or there's a possibility that someone will backup from a wallet seed and not see all of their money. (If this happens to you, increase the gap limit and try again.) It also can't be too high, or you'll waste resources on the servers handling Electrum queries.

Your suggested scenario is actually the easiest to solve, because if each of those addresses has a transaction associated with it in the blockchain, the client knows that it showed that address to you at some point, and will keep searching.


What is the job of miners in Bitcoin? Q. Is it correct to state that a Bitcoin miner has only two jobs:

validating transactions
creating a block to add into the blockchain

Actually, a bitcoin miner is only concerned with creating the next block on the blockchain, through a computationally-difficult problem. It is the role of bitcoin nodes to verify this proof-of-work as they receive these newly created blocks.

As reference, see https://en.bitcoin.it/wiki/Mining


Who earns transaction fee in Ripple? In Bitcoin, fees are earned by the miners. Who earns the transaction fees in Ripple?

The transaction fees in Ripple are simply destroyed. There is no mining.

We had to use ripples because we couldn't use dollars, both because dollars in Ripple can only be represented as debt (Who would owe them to the system? Who would they go to?) and because Ripple is intended to be cross-currency (How would you manage exchange rates?).

The beauty of ripples is that the network can destroy them and they require no central authority. In the future, if ripples become unusually scarce or plentiful, the XRP cost of transactions can be adjusted by consensus.


(Script) Is it possible to create a transaction that is spendable to only one address? I'm reading up on Script, which is pretty advanced stuff for a web developer like myself. I'm wondering, is it possible to send a transaction that can only be spent to a particular address?

Example, "Alice sends 1 BTC to Bob. Bob cannot do anything with that BTC except send it back to Alice."

Is that possible and how would it be accomplished?

You cannot specify the subsequent script used when the current script is unlocked. The script that bitcoin is sent to has only two states, locked and unlocked. Locked means it doesn't move, unlocked means it moves whereever the one who unlocked it wants.


Who decides the block reward in Bitcoin? I know that when a miner mines a block, he will be rewarded with some bitcoins. But who decides how much bitcoin he will get? If it is decided by all the miners (as they are the ones verifying transactions) then why don't all the miners decide to increase the reward?

When the creator of Bitcoin published the original Bitcoin client, it came with rules for an inflation schedule. As a means of bootstrapping the system and distributing the initial supply, miners were allowed to create 50 new bitcoins per block, but this subsidy would get halved every 210,000 blocks. The inflation schedule is a so-called consensus rule which is enforced by every single full node in the network. If any miner creates a larger amount, all other network participants recognize the block to be invalid and reject it. This happened once in July 2019 when a miner accidentally tried to create more new bitcoins than the allocated subsidy. You can think of the consensus rules as the least common denominator that keeps various implementations converging onto same ground-truth in the decentralized Bitcoin network. As they are so central, changes to consensus rules tend to meet resistance and it can take years to establish support for amendments.

Miners do have an important role in the Bitcoin network, but if a cabal of them unilaterally stopped adhering to the consensus rules, they would simply no longer get paid: newly minted coins can only be spent at the earliest 100 blocks after they were created, and only in a block that directly derives from the block that created the funds. As seen in above mentioned incident, even a single block with an excessive block subsidy was a major news item when it happened. It is extremely unlikely that the greater ecosystem would go along with it, and that means there is no market to sell the coins, meanwhile every block comes at an actual cost.

Incidentally, we happen to be close to third subsidy halving: In approximately 16 days, at block 630,000, the block subsidy will halve to 6.25 bitcoins per block. This happened twice before, in 2012 the subsidy halved to 25 bitcoins, and in 2016 the subsidy halved to 12.5 bitcoins per block.

Related reading:

How many bitcoins will there eventually be?
Where do bitcoins come from and what gives them their value?
How is the bitcoin 21 million cap implemented?
Why was 21 million picked as the number of bitcoins to be created?
Will there be 21 million bitcoins eventually?
How much inflation does Bitcoin have, year by year?
How many Halving Days will there be?


The problem is with getrawtransaction command in bitcoin core. It doesn't recognize the SegWit input which is why it decode/deserialize the transaction incorrectly (wrong input txid and negative amount in output).
https://bitcointalk.org/index.php?topic=5014781.0


How is Merkle path derived or calculated? How is Merkle path calculated? I am looking for a detailed algorithm rather than a quick one liner for this so I can implement it.

Note that this is not the same as computing Merkle root or building Merkle tree. Also not asking why Merkle path is needed. I did not find any info on this site going over the algorithm for deriving Merkle path.

Given a merkle tree and a transaction that is in that tree, to find the path from the root to that transaction, first hash the transaction. Then find the leaf node in the merkle tree with that hash. Add that node to a list. Take the parent of that node. Add that node to the list. Take it's parent, add it to the list. So on and so forth until you reach the merkle root (which can be identified as the node with no parent). The list of nodes is the path.

If you also need the other node each node was hashed with so you can construct a merkle proof, for every node, when you go to it's parent node, see which side the node you came from was on and record it. And then record the hash of the node on the other side and the side it was on.


What is a UTX 0 Proof? (as discussed in this video) This video discusses how off chain transactions can be accomplished as an alternative to increasing the block size.

At the 21:25 marker he discusses "UTX 0 Proofs".  What is that?

UTXO is short for "Unspent Transaction Output". You can imagine the UTXO set as a set of tuples of the form (txid, index). Transactions remove items from that list by claiming the outputs and add new items by allocating the bitcoins from claimed outputs to new outputs. Basically the whole of Bitcoin boils down to agreeing on what the current UTXO looks like, as it tells you how many bitcoins are owned by each address at any time.

The UTXO Proof Peter was talking about is a way for a node, that does not store an entire copy of the UTXO set, namely a DHT node, to validate transactions. This is done by querying other nodes in the DHT and retrieving the parts of the UTXO that is needed in order to validate the transaction.

Notice that, while there are some ideas on how to implement this, there currently is no prototype.


Is mining a fair mechanism in blockchain network? As we know, propagation of a new block in blockchain network has some delay and many nodes receive the new block later. so if it is that the first one who finds the nonce properly wins the block can we say that the mechanism of mining is not fair enough (Because of delay in propagation of a block some blocks receive the block sooner and have more time to calculate the nonce)?

Considering that a block is mined on average every 10 minutes and that the average time to propagate to all nodes is 12.6 seconds, I think it is pretty fair.

We could also guess that the big miner have incentives to get the newly mined hash very fast so it must be lower than 12.6 for them.


Is Bitcoin truly decentralized? Explanation below I am new to cryptocurrencies so if there is something I said isn't true please let me know.

To win a Bitcoin you must mine a new block, and the chances to be successful are pretty low. That's not bad because it is distributed equally based on with how much computational power you mine. So for example, if you have a 20% of the total computation power mining you are going to produce a block every five (in the long run).

But if your chances are low, for example, 0.01%, you will produce one block every 10000 blocks. Estimating that the average time to produce a block is ten minutes you will have a block every 100000 minutes or 1666 hours (in reality there are lower chances, I am not sure). The problem with this is that there is people who needs to get cash daily to live, therefore they can’t waIt so long to get the money so they stop mining to stop paying the electricity that cost to run all the computers. Which in consequence produce transaction to be much slower, therefore getting us back to the problem for the one that some people choose Bitcoin (cryptocurrency) over Dollar (tradition bank, physical currency).

So it would be better if you would get a part of the reward for collaborating with the mining more than only if you were the one to produce it, and for that reason, mining pools were invented.

The problem with mining pools is that to solve what I mentioned above and get bigger chances to produce a block there should be a small quantity of them. And if this happens the control of mining stop being decentralized and starts being centralized, having a new kind of ‘banks’ controlling the flow of transactions in Bitcoin (cryptocurrency).

Is Bitcoin, or will be in the future, after all centralized?

Short Answer: The control is mostly with few hands.

Long Answer:

Even though in expectation the block generation may seem somewhat reasonable with 0.01%, the variance is quite high. Also, the mathematical puzzle miners are solving continuously follows the property called memoryless.

In brief, the memoryless property of a puzzle is say you failed to solve the puzzle till time t_0, then the probability that you will at sometime later is equivalent to a fresh start at time t_0, in other words, the failed past effort does not increase any chance of winning a block in future.

So, to reduce variance miners come together to form pools to reduce the variance. Coming to centralization the current hash rate distribution can be found in (https://blockchain.info/pools).

The intermediate between total centralization point comes a classic attack call 51% attack(some close instances in history can be found https://www.coindesk.com/bitcoin-mining-detente-ghash-io-51-issue/). The caveat with 51% attack is that the stakeholders may lose trust in bitcoin in case of 51% attack which will reduce the value of bitcoin which might not be beneficial to miner considering the effort required to launch a 51% attack.


3rd party "contractor" when buying bitcoins? i was just wondering - let's say Alice wants to buy Bitcoins from Bob - there's some kind of transfer that needs to be done (Alice sends USD to Bob, Bob transfers BTC to her wallet).

Why won't bob just disappear after receiving the USD?
If so - isn't a trusted 3rd party always needed?

You're right that bitcoin/blockchain doesn't solve fiat problems. In your scenario swap out BTC for another fiat like GBP, you have the same problem.

It's the same problem if I buy something with BTC or fiat, you have to trust the other person will send the item or have someone else offer some form of guarantee like eBay does.

So if it's high value you might enlist someone beforehand as an escrow.

Otherwise, Alice would need to sue Bob for breach of contract after Bob doesn't hold up his side of the bargain.


Can one send one payment to two private keys through 1 QR code? Is it possible to send via one QR code or bitcoin address one payment that can be divided or split by a percentage of my choice to two private key QR codes, individual users, a percentage of the amount deposited on one QR conventionally by only havin to scan one QR.
What I'm looking for is a platform where one QR code allows me as a shopkeeper to price my items and have them sold so as the payments go or are otherwised forwarded for no fee direct to the suppliers as well as myself in one function. So that I don't have to "do the books" at the end of each month, rather,  price my items with one QR code per item and receive the profit as a percentage split or assinged number, wholsale price, of our choice so as to be paid instantly along side the wholesaler plus as many other parties without any interference of our own...
Any ideas one how I can do this or programmers who could do such a thing and are willing to help?

You will need to do some post processing.
A QR code can encode only one address.
But once you receive the funds you can split them up however you want between however many addresses you want (this would mean another transaction of course).
You could do this manually if your volume is low, or automate it via a script that talks to the receiving wallet.


What to do when a website says that my bc1... address is invalid? I used local Bitcoins wallet to send bitcoin to my bitcoin wallet. But it said wrong address

The address that you are using starts with bc1 and is a bech32 address. Many online wallets still do not support this form of address, which is the reason you are getting the invalid Bitcoin address error. If you want to use segwit and still be compatible with these online wallets that do not support bech32, you can use a P2SH(P2WPKH) addresses that begin with 3.


How to get a single value in BTC-e API how will i be able to get a single value out of BTC-e API.
This is the current API:

https://btc-e.com/api/3/ticker/btc_usd

As you can see, it shows lots of information. What can i do so that i will only get
  --> "last":284.323 <--    this number?

Thank you!

Well that depends on what language you are using to parse the JSON.

The output for the API is in JSON format (JavaScript Object Notation). This notation is very common in the API space and when reading raw bitcoin transactions and blockchain data. When you query address information in bitcoin core console it is in JSON format. Think of it as a set of arrays. If you have an array of "Food" and that array contains "Fruit", "JunkFood", and "Snacks", and each of these arrays contain additional values within them. So if you wanted to access "apple" it would be under Food -> Fruit -> Apple.

With the BTC-e API JSON response it gives you the category first of "btc_usd" and then within that array is "high", "low", "avg", "last", etc. So in order to only select "last" it would be under btc_usd -> last.

I typically use PHP and it's quite simple to do.
Here's a phpfiddle: http://phpfiddle.org/lite/code/jsah-t4dv

<?php
$url = "https://btc-e.com/api/3/ticker/btc_usd";
$decode = json_decode(file_get_contents($url), true);
$price = $decode["btc_usd"]["last"];
echo $price;
?>


Is there a compiled list of merchants that are taking lightning network payments for testing? How many merchants are adopting lightning network payments? And is there a list somewhere?


How do I retrieve my backed up wallet to Bitcoin Core? I backed up my Bitcoin wallet on a drive for safety. Luck has it that my computer crashed. So now I downloaded Bitcoin Core, but do not how to retrieve my backup. Please help. thanks

Restoring a wallet on a fresh machine:

Start Bitcoin-Core (daemon or Qt), shut it down after it has started up (you only do that to create the necessary data directory)
Replace wallet.dat with your backed-up wallet.dat (see https://en.bitcoin.it/wiki/Data_directory if you can't find the data dir)
Startup Bitcoin-Core, wait until your node is in sync (can take a couple of hours/days)

If you have created the wallet with Bitcoin-Core >= 0.14 (HD Wallet).

2a. Startup Bitcoin-Core (Qt/core), call getnewaddress 100-10000 times (depending on how many addresses you have created)
(This hopefully will go away in Core 0.15)


Miners - HTTP JSON-RPC or JSON-RPC? Does the main miner software used currently use HTTP JSON-RPC, or JSON-RPC? That is, do they use HTTP calls to obtain getwork, or TCP/IP?

The miner uses JSON-RPC 1.0, for which only the HTTP transport was defined.


why did bitcoin suddenly spike? about 2 months ago the price was at about 140 USD per coin, but a couple days ago I checked and it was well over 1000!
what caused the sudden spike in value and will it continue to grow?

TL;DR: No idea, and your question's unanswerable in the first place :)

Why does a national currency rise or sinks in value? Why do a company's shares do the same? You will never get definite answers for these or your original question unless you manage to get into all the participants' heads to know what they were thinking of. Meanwhile, you can listen to pundits or draw your own seemingly informed conclusions.

A couple months ago, when there were these rumors about the US government possibly becoming unable to pay its debtors, Bitcoin started going up and up to the point of doubling its former value - obviously a lot of people were viewing it as a possible haven should the dollar fall. After it was clear such fears were based on nothing the Bitcoin fell down from that high.

But then it started climbing again, reaching again its former high mark, then doubling it, then doubling again... Looking at the graphs of this spectacular pike its clear to me a good part of that was a bubble caused by speculators jumping to ride the wave, but exactly which event triggered the upwards trend in the first place... to this day I honestly don't know.

Some say it's the hearing at the US Congress giving it legitimacy. Some say it's closing the Silk Road cleansed its image, though others say this event caused it's value to fall a bit. Some say it's even more interest by the Chinese... no single event can be clearly linked to this surge in value as was the case in the past with, e.g., the events in Cyprus.


After restarting a node, are missed transactions recovered in mempool? (v0.14.1) As of v0.14.0 the mempool is now saved when shutting down a node and reloaded after starting up. If a node has been down for <20 mins lets say, does the bitcoin node attempt to recover the transactions it has missed or does it wait until it sees it in a block before requesting missed transactions from a peer?

Thank you!

Bitcoin Core (v0.14+) does not actively try to learn about transactions it missed.

Historically, this was not done because it would unnecessarily and unintentionally extend the lifetime of transactions in the mempool. This is no longer an issue because the mempool is limited, and deals correct with expiration and eviction.

However, no efficient protocol exists to accomplish mempool syncing. We could ask for all txids from all peers, but this would amount to several hundred MB of data, most of which is redundant (as it'd be identical across peers). Some research has been done on set reconciliation protocols, which efficiently find differences between the mempools and just transfer the differences. None of that is close to deployment, however.


Electrum Litecoin keeps synchronizing. What should I do? I got 65 ltc on my wallet. Electrum only jot down 35. I can't send money because I got error message server not responding

I transferred the seed to another electrum wallet. It works.

How do I fix my current wallet?

Backup the wallet file
Delete the electrum data directory
Restart electrum-ltc

Since I don't know your OS...

Linux Data directory: $HOME/.electrum-ltc
Windows Data Directory: \Users\YourUserName\AppData\Roaming\Local\Electrum-LTC

or something very similar to those.


wallet.dat on usb to electrum I put my btc qt wallet.dat file on a USB and would like to open it on a software wallet. Preferably electrum. Is that possible?

If so how?

Too many problems with btc qt and takes forever to sync.

Electrum does not support bitcoin core wallet files. What you can do is dump all the private keys using bitcoin core and then import them into electrum. So first make sure that the wallet.dat file is in bitcoin core's data directory and then launch bitcoin qt, go to window menu > console and unlock your wallet:

walletpassphrase your-wallet-passphrase 300

Then dump the wallet to a file on your filesystem:

dumpwallet C:\path\to\new\file

Open that file using a plain text editor like notepad and you'll see your private keys in the row to the left. for example:

# Wallet dump created by Bitcoin v0.18.0
# * Created on 2020-01-16T09:48:08Z
# * Best block at time of backup was 115144 (0000000000000c76185d6ab9b04672082d8d9a876fbe9f908c63bd9ec5d02433),
#   mined on 2011-03-26T14:26:44Z

# extended private masterkey: xprv9s21ZrQH143K4UvtqjsWXxXBSDkxVbwePkX2ofaCRhrB2xBcMaFxnWBvZBKnTmgdc32cKc6PbmGCd1LB6X8K9JUGqqVGvxoWbEh231FB6x6

KyDFvw3oUNsJ1rFgAX4VQ5ffP5kpkeStU9kjyA3vAm5EpjF21TMh 2019-01-16T15:33:42Z change=1 # addr=3QKaCD7kQrwstfMvEYbv3iDuXPFLUUoj4p hdkeypath=m/0'/0'/874'
L3tWcLep3Vmhoq3eQFQioycDdyFvpdLBfmvBYHdSBH3bBepE5KR9 2019-01-16T15:33:42Z change=1 # addr=32ubG76VZ23TUWYf8ZGaU7MwFs1bJVbd3r hdkeypath=m/0'/0'/395'
KwQH7xszobX5ByvsTdFrhVrCshyZG3aLa1cagcv5rJghGHuQStuK 2019-01-16T15:33:42Z change=1 # addr=3GfzM8BRgQj6FtGvZZUfLKaE9KTfL39A1B hdkeypath=m/0'/0'/499'
L5Q4SnnKvvSoCDaz2GvQkWWLgjJx5aMXogRvjJHfQG9faXLmaNLM 2019-01-16T15:33:42Z change=1 # addr=3GWHaeXKBoAxa23MHRknaygDosJiWTiMP1 hdkeypath=m/0'/1'/159'
L3Bnvj1xTJFMzXsym7jBDMLbz5qhxotq8La4UxDdhKZnmZ4s1nw1 2019-01-16T15:33:42Z change=1 # addr=39WoYcrRnY9vRBuxSCmU4vtdEvnWRcn5QJ hdkeypath=m/0'/1'/918'

Your private keys are the strings that begin with K, L or 5 and are in the left most column.

Now to import them in electrum you download and install electrum and run it. The first time you run it it'll let you create a new wallet file. If this is not the first time you are running it use file > new/restore to create a new wallet file or simply enter a unique file name in the first window that pops up when you run electrum. During the wallet creation process choose "import bitcoin addresses or private keys" in the first step and in the next step enter the private keys one per line with either "p2wpkh:" for bc1 addresses or "p2wpkh-p2sh:" for addresses that begin with 3 prepended to each private key. If your address begins with 1 you don't have to enter a prefix. For example:

KyDFvw3oUNsJ1rFgAX4VQ5ffP5kpkeStU9kjyA3vAm5EpjF21TMh

becomes

p2wpkh-p2sh:KyDFvw3oUNsJ1rFgAX4VQ5ffP5kpkeStU9kjyA3vAm5EpjF21TMh

Follow on-screen instructions for the rest. Note that if you know exactly which addresses have coins sent to them you can import just those addresses' private keys.


Is Proof-Of-Work simply a decentralized clock? I have not seen anyone explain Proof-Of-Work this way, so I thought
I'd share it here, I'd be curious to know if I'm completely off.

It seems to me that PoW is simply a distributed decentralized source of
ticks, a clock, to which data can be "tied"?

The challenge of Proof-Of-Work is a singleton problem (for lack of a
better term), i.e. there is only one instance of it in the universe. This means that it is known to every participant, and anyone working on it is affecting the outcome.

Most importantly even if one is participating in complete secrecy until a solution is found, it still affects the outcome.

An analogy might be looking for the largest known prime. You
don't need to tell anyone you decided to find one, you only announce
when and if you actually find one. Your participation makes finding a
solution a possibility, whereas if no one ever looks for the largest
prime, it will never be found.

The difficulty algorithm adjusts in such a way that a solution is
found on average every 10 minutes. It's a distributed decentralized
clock which ticks on average once every 10 minutes. The miners make it
possible through their participation, and curiously, miners do not
need to tell anyone they are participating, they only need to
communicate with others if and when a solution is found.

The clock has an interesting property - you can tie data to its ticks,
simply by making the data the input to the SHA. A solved block is
nothing more than simply an event that happened exactly at the tick of
this clock.

And essentially this is all that Proof-Of-Work does for
the blockchain: it provides ticks of a clock, to which events can be
tied. Everything else is an "add-on" to this "feature", e.g. using the Merkle tree we can cryptographically record the ordering of the ticks. But without the "PoW clock" none of it would be possible.

Edit: these ticks do come at irregular intervals, so one wouldn't set their watch to it. But that doesn't matter for as long as it is approximately 10 minutes, which it is.

Edit: here is a much more detailed explanation: https://grisha.org/blog/2018/01/23/explaining-proof-of-work/

Yes, PoW is a decentralized clock not just for tying information to a specific time (a timestamp can do this perfectly fine) but to prevent spam attacks on the blockchain itself.

The question comes up, how can you add data to everyone's ledger all at once continuously and efficiently? If there is a single tx at a time queue system then things will be unbearably slow.

If the ledger is open for everyone to add verified transactions then what's to stop someone from just adding transactions on transactions and filling up everyone's node?

PoW exists to solve this problem by creating something like a flood gate that allows only a set amount of transactions per time. The difficulty aspect of PoW exists to adapt to the changing nature of computing power against the network.

  The clock has an interesting property - you can tie data to its ticks, simply by making the data the input to the SHA. A solved block is nothing more than simply an event that happened exactly at the tick of this clock.

This is so an attacker can't just use the same verified data to add blocks and blocks of transactions. Think of a block mined by the miner as a one time use token that let's the block be added.

  An analogy might be looking for the largest known prime. You don't need to tell anyone you decided to find one, you only announce when and if you actually find one. Your participation makes finding a solution a possibility, whereas if no one ever looks for the largest prime, it will never be found.

This portion isn't entirely correct. For you to test if a block you've mined is correct (because mining is entirely a guessing game) you need to ask the network if the block is valid. More than likely the node you just asked will say no and you begin the search again.

Although I should note that the amount of failed attempts is not factored by the difficulty algorithm


Original Bitcoin (Core), how did it generate private key? I'm a newbie at this, but I have a question.

How did the original Bitcoin (Core) v0.1 program generate random private keys? I was hoping for the exact source code or at least a good description of the method used.

I understand (almost) any 32 byte integer will work as a private key. I assume they used a Windows based OS random generator CryptGenRandom() since it was released for Win XP initially, I think.

Thanks!

The Bitcoin software has always used OpenSSL's random number generator in some way to generate private keys. Originally, it just used OpenSSL's EC_KEY_generate_key function to generate a new key and OpenSSL would handle the RNG and object creation. Even now, Bitcoin Core still uses OpenSSL's RNG and mixes it's output with several other sources of randomness in order to generate private keys.


free up space by deleting blocks I've run into an issue where a bitcoin partition reached 100%.

I created a new partition and try to move the whole Bitcoin directory over, but I seem to be handicapped by "no space left on device" errors.

nyc1_04 is my new mounted volume. I've started the copy process which eventually failed with "no space left on device" and now all operations seem to fail.

i've already tried apt autoremove and apt-get clean.

what are some files i could delete in existing Bitcoin core folder to free up a little space but make it rebuildable when service restarts?

Depending on your requirements, you can run in prune mode:

$ bitcoind -prune <max-MiB>

  -prune= Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete
  specific blocks, and enables automatic pruning of old blocks if a
  target size in MiB is provided. This mode is incompatible with
  -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning
  blocks, 1 = allow manual pruning via RPC, 550 = automatically prune
  block files to stay under the specified target size in MiB)

see https://bitcoin.stackexchange.com/a/37497/60443


Smaller transactions are easier to validate; larger transactions take more work in Bitcoin I am working on Bitcoin and trying to understand how transaction fee is calculated. Bitcoin support site states that the reason for selection of small and large transaction by miner:

  Again due to the fact that a block on the bitcoin blockchain can
  contain no more than 1 MB of information, transaction size is an
  important consideration for miners. Smaller transactions are easier to
  validate; larger transactions take more work, and take up more space
  in the block. For this reason, miners prefer to include smaller
  transactions. A larger transaction will require a larger fee to be
  included in the next block.

https://support.blockchain.com/hc/en-us/articles/360000939883-Explaining-bitcoin-transaction-fees

I have below questions on it:

Does the size difference matter only in case of validation or even while mining or PoW.
What is the mathematical reasoning for difference.

Smaller transactions are easier to validate; larger transactions take
  more work, and take up more space in the block. For this reason,
  miners prefer to include smaller transactions.

This is not necessarily true. Miners do not validate transactions, nodes do. Miners generally are only aware of the current block template they are trying to mine. That's why it's important for a miner to connect to a node they trust, in order to get the block template. Miners will get block templates that prioritize transactions with the highest fee/kB. This maximizes the tx fees for the miner for mining the the block.

While it is true that larger transactions are harder to validate, a larger transaction is not harder for the miner to validate because it does not do validation. See Node Operation under Bitcoin Mining. It is also not harder for the miner to hash because it is only hashing the merkle root of all the transactions (along with the other header data) selected for the block. See Block Hashing Algorithm. The merkle root is the same size regardless of how many transactions it represents.

Users must compete for the higher fee/kB if they want a better chance that their tx will be included in the next block.

Edit: As an aside, extremely large transactions with lots of inputs can cost the network almost as much to process as they cost the sender in fees, because computing signature hashes is O(ninputs*txsize). For this reason, nodes limit transactions to MAX_STANDARD_TX_WEIGHT to mitigate CPU exhaustion attacks.


Is it possible to rebalance channels by sending to yourself (from a channel to an other) in c-lightning? How? I know it is possible with LND and I don't know if it is possible with Eclair.
I have tried to issue an invoice and to find a route with the same node but
I got the { "code" : -1, "message" : "Could not find a route" } message.

What am I missing?

Natively c-lightning does not support paying invoices to yourself. But I have provided a trick described in this video: https://www.youtube.com/watch?v=Dwl-0cY6KkU&t=1s:

The trick is to create an invoice and then use getroute to find a route to some node and then go back (possible over another route with another getroute call). once you have such a circle the sendpay command. While getroute does not find a route to yourself the sendpay does not care as long as the onions are great an the payment hash exists.

This trick can be used to do spontaneous payments (as described in my video) or to rebalance your channels. The full code for spontaneous payments can be found on my github lightning helpers repo. The python code would have to be adapted a little bit to your needes but that should be fairly straight forward. Ping me if you need help.

On a side note. I balance my channels be decreasing my routing fees because then people will do it for me and I still earn something instead of me paying fees for rebalancing.


What are some good ways of marketing a Bitcoin related service to Bitcoin users? What is a brief summary of some good ways of promoting a Bitcoin related service? This could include:

Bitcoin Service Directories
Forums
Advertising
Mailing Lists
???

The target audience is people who have bitcoin and know how to use it.

To avoid this question being too broad and requiring answers that are too long, I suggest keeping any summary of each item brief.

The folks at bitcoin.it run a moderated listing, https://en.bitcoin.it/wiki/Trade, which you can list at.  Another way is to work directly on reddit (r/bitcoin) and http://www.bitcointalk.org/.


What is the difference between on-chain scaling and off-chain scaling? What is on-chain scaling and off-chain scaling?
What is the core difference between on-chain scaling and off-chain scaling?

Note, I use scaling, capacity, and scalability as follows:
Scaling: Growing the network's utility in any fashion.
Capacity: The number of transactions that can be processed on the network.
Scalability: Capability of the network to handle a growing amount of work.

On-chain scaling
The term "on-chain scaling" is frequently used to exclusively refer to increasing the blockchain capacity by means of bigger blocks.
However, in the literal sense of the term, it should refer to any sort of protocol change that improves the network's capacity at the blockchain layer, including changes that facilitate production of equivalent transactions at lower cost. These approaches tend to provide at most a linear capacity increase, although some are also scalability improvements.
Examples:

Blocksize/blockweight increase
Faster blocks
The witness discount of segregated witness
More efficient new address formats
Smaller size of Schnorr signatures
Cross-input signature aggregation
Key aggregation

Off-chain scaling
The term "off-chain scaling" refers to approaches that increase the utility of the network without touching the blockchain, or by making superlinearly efficient use of the blockchain load they produce. I also include approaches that create non-equivalent transactions that result in more efficient use of blockspace.

Batching multiple payments into one transaction
Virtual payments within the system of a custodian (Tipbots, Coinbase,…)
Payment Channels/Tumblebit/Lightning Network
Sidechains
Colored Coins

Generally, off-chain solutions are scalability improvements but go hand-in-hand with a different trust model and different trade-offs. They often require additional software and complexity over on-chain scaling approaches.
For example, Lightning Network will require its users to be online to receive payments while on-chain transactions allow passive receival. On the other hand, it will easily scale the count of payments between participants, but only scale the number of participants in a limited fashion as becoming a LN user requires on-chain transactions.


How do I transfer funds from India to an exchange? I want to buy a few Bitcoins using my bank account/ credit card from here in India. How do I do that? MtGox has an option to do wire transfer. Is it the only way to do it? If I transfer $1000, how much of it will reach my MtGox account?

If you can send an International wire transfer (USD) there will be fees charged by your own bank to convert from INR to USD, as well as a wire transfer fee.  Then some fees charged by Mt. Gox exchange to receive the funds I believe, but a relatively small amount.

The conversion from INR to USD is probably the part that will be the most expensive as banks don't always give competitive rates.

This problem isn't unique to India, but those in many other nations have more options.  For instance, in many countries the P2P market CurrencyFair can be used to get a good rate converting to some other currency like USDs.

Since neither CurrencyFair nor Transferwise work in INR funds yet, that will not yet be an option for you.

So an international wire of USDs is probably your best and least expensive method, especially for a little larger amount of $1K USD worth or so.

You might also look at ECurrencyZone, which allows Rupees to be deposited into an account at any of the following: ICICI Bank, IDBI Bank, HDFC Bank, AXIS Bank, PNB Bank, State Bank of India, or Bank Of Baroda.  Bitcoins are then delivered for those funds.

The only exchange located within India is Buy Sell Bitcoin.  They support Cheque and NEFT (Net banking) transactions.  See the comments for this answer for more specifics.


Is this a valid scenario in blockchain? Is this a valid case in blockchain?

if yes whether the reward for t1 is shared and if not, which block will be invalidated or why not everyone will prefer to solve the block with a single transaction

You didn’t specify, so I’ll answer in terms of the btc blockchain:

When two valid blocks with the same blockheight are found, only one will be accepted into what will become the longest valid chain. The other will be discarded, it is what is called an orphan block.

Usually, the block that propagates through the network first and fastest is the one that will be accepted into the longest chain. The number or nature of the transactions will not affect which block is accepted (so long as all of the transactions are valid). The miner that found the orphaned block receives no part of the reward, since the orphaned block is dropped from the chain.


Persistency of Seed Nodes A few of the guys at work have asked for me to make them a cryptocurrency (god knows why but I'm happy to oblige). I'm basing it on Cryptonote and have got it all built.

I understand that I need at least two seed nodes to get things going. However, do these seed nodes need to stay on indefinitely or can they be turned off once there's a network of miners?

I'm not familiar with the specific design of CryptoNote, but in general a cryptocurrency node must have a way of discovering its first node in the network. Once it discovers that first node, it can ask that node for all of the nodes it knows of, then ask those nodes for all of the nodes that they know of, etc. etc. until it knows about every node in the network. In most cryptocurrencies, there's no difference between a seed node and a regular node.

There aren't a lot of constraints on how you solve this problem. You could have a seed node at a fixed IP address, and distribute an update if that IP address changes. You could have the node look up a DNS record that corresponds to a handful of nodes. You can have the node request a webpage, and add all of the IP addresses on that webpage to the address list.

Bitcoin uses a combination of fixed IP's, plus DNS seeding. See peer-discovery.


Do I need to join a pool if I have a 3TH mining rig? I am thinking about purchasing a 3TH mining rig and would like to know if it is still worthwile me joining a mining pool to mine BitCoins?

Do I have enough power to go it alone?

It is hard to decide right now, knowing that till you will buy, and the company will deliver your hardware, the difficulty will change many times.

Right now with a current difficulty, solo mining with 3Th/s will give an estimation of mining a block in 2 weeks (during this two weeks the difficulty may change). So even right now I would rather have a steady 2 BTC per day then to risk. Especially if after buying this hardware, you need to break even as fast as possible.


Dogecoin Core Wallet 1.10 - Help - Encrypt Wallet Option not available to allow staking Help,

I am new to staking using crypto currency wallets.

I have download the Dogecoin Core Wallet 1.10 and the Encrypt Wallet Option is greyed out. How can I encrypt this wallet for staking please? I have other wallets for other crypto currencies that are all staking fine.

Thanks in advance.

Declan

Staking is only used with proof-of-stake cryptocurrencies. Dogecoin uses a proof-of-work algorithm, so there is no staking in Dogecoin.


Is it possible to win the Bitcoin lottery? If you have a PC and you try casual solo mining on your PCs CPU is it theoretically possible to mine a block and get the full block reward if you get really lucky? I know this is extremely unlikely given the low hash rate of a CPU but is it possible?

I am just wondering is there any point having your pc running when your not using it.

Yes, it's possible to solo-mine using your PC. The odds are astronomically small, however. You can look up what hash rate your CPU will get here. The best possible CPU the Xeon Phi 5500 gets 140 MH/s. Current network hash rate is 570,000,000,000 MH/s. So every block, you have a 0.000000000245% chance of finding the block. You'll find one block every 76,000 years if the hash rate were to stay constant.

The electricity costs of running your PC are far, far higher than the expected payoff of mining with your CPU. Heck, the wear and tear on your computer is probably a lot higher cost than that expected payoff.

And note, too that this is the best possible CPU. Your average CPU is about 10x worse.


Bitcoin core delay in synching My bitcoin core is delaying in sync saying two years remaining. And av sent bitcoin from my block chain wallet it's been deducted but am not seeing it. How can I go about it seeing that I can't wait for two years. The synching is not fast

The "two years behind" is not telling you how long the synchronization will take but what time you are caught up with. Bitcoin processes history much faster than real time.  If you are at two years behind you are most of the way done.  If you click the "behind" text it should give you an estimated time left counter.

Syncing speed depends on your hardware. The first time takes anywhere from a day (on reasonably fast hardware) to a few days (on slower hardware).  After that it doesn't take long on restart.


What exactly is the relation between Bisq and Bitcoin Core? What exactly is the relation between between Bisq and Bitcoin Core? It seems like Bisq can function perfectly well without Bitcoin Core, but if you do run Bitcoin Core at the same time, it appears to have issues (sometimes) with syncing the Bitcoin network. (Whatever that means in terms of Bisq, since it's clearly not a fullnode Bitcoin wallet.)
I've tried to figure, read and ask my away to the answer to this question for a long time now, but I've just been ignored.
In what technical/concrete ways does Bisq use/depend on Bitcoin Core, other than allowing you to easily click a button inside of Bisq to open up Bitcoin Core with the fields pre-filled in?
If it works without Bitcoin Core installed, is there some benefit in allowing Bisq to "utilize" Bitcoin Core?

As Bisq is not a full node wallet, it must connect to a full node in order to be able to receive transactions and learn when a transaction confirms. Without a local instance of Bitcoin Core, it will simply connect to a random node on the internet (there are some built in discovery methods for how it can find a node to connect to). If Bisq detects that you are running a node locally (i.e. you are running Bitcoin Core as well), it will instead connect to your local node and get its information from there.
Since Bisq relies on BIP 37 which Bitcoin Core has turned off by default since 0.19.0, you will need to enable this feature by adding peerbloomfilters=1 to your bitcoin.conf file. Otherwise Bisq will be unable to receive Bitcoin transactions. This is likely the syncing issues you are running into.
For some more information about local node settings in Bisq, you can read https://bisq.wiki/Connecting_to_your_own_Bitcoin_node.


How Extracting address Bitcoin to script multi signature I want to extract the correct address from a script multi-signature.

I have this real script multi-signature from this ScriptSig (tx index 1), so this is a readme script for this address

OP_2
    03385adff37fd3d0a620ebc4e9866e81dda8ba8616e5ebcae899c7f51899267ae7
    034c08511718f947d1a3e152195c5e2756588e3e0c2c7730927eb6647af4942107
    033da9f8938a5b947a723df21b73fbd3985b719249324d2c705acfb97d63a5df9e
OP_3 OP_CHECKMULTISIG

Now from this resource these value 03385adff37fd3d0a620ebc4e9866e81dda8ba8616e5ebcae899c7f51899267ae7, 034c08511718f947d1a3e152195c5e2756588e3e0c2c7730927eb6647af4942107, 033da9f8938a5b947a723df21b73fbd3985b719249324d2c705acfb97d63a5df9e are the public keys, so this value is a pure public key? and for exstract the address form these I can execute the procedure for build bitcoin primitive address ?

or I'm lost some information for this argument?

an example if I suppose this value is a public key 03385adff37fd3d0a620ebc4e9866e81dda8ba8616e5ebcae899c7f51899267ae7

This should be the compressed public key because it starts with "03" if apply the HASH160 I get this address "14r7XjPtqVijLRhY9BkGAtDqVDp4txsK1X"

Is my reasoning right?

More Information on the why I want to get the address to P2MSH

I don't want to break the privacy of the address 3CD1QW6fjgTwKq3Pj97nty28WZAVkziNom, I'm reading this article and it catalogated the address 3CD1QW6fjgTwKq3Pj97nty28WZAVkziNom how an scam address, but I think this is restrictive affermation, because the address with "3" can to hide more people/address.

I'm only learning and I don't want break the privacy of the people

The correct address is 3CD1QW6fjgTwKq3Pj97nty28WZAVkziNom. The individual public keys are only able to access the coins if they act together in a group of at least 2 out of 3. If you derive a regular p2pkh from each individual key, you will end up searching for utxos that likely don't exist.

Also note that each individual public key does not necessarily mean that there are that many individual people involved. Many security conscious companies and people have multisig addresses with each key stored on a separate device/location, requiring multiple signatures from different systems, etc. They may all still be under the control of a single entity.

When cataloging transactions and matching patterns across the network, you should be working with the P2SH address for a multisig address. Breaking it down into its components will produce incorrect results.


Reject transaction because of illegal data We already know there is illegal data on the blockchain and it will be on there for ever.

That got me wondering about the potential legal implications for miners, since they are technically endorcing and worse.. distributing illegal data by including those transactions in a block.

What is the current legal situation in the US/EU ?

Is there any record of miners rejecting a transaction because of the arbitrary data after OP_RETURN?

There have been miners that rejected transactions with OP_RETURN because its unnecessary spam. Virtually every node and miner limits OP_RETURN outputs by size.

The amount of data relayed or allowed by default is not very large, one of the reasons for this is reducing drama about "illegal data".

We've come up with even stronger techniques that could be used to prevent the inclusion of arbitrary data in transactions, if it were ever required.

But the idea the some invisible data squirreled away in an inaccessible location would be legally dubious seems impractical at least for small amounts of data: consider, any text could secretly convey a small amount of data-- so a hard-line adherence to that theory of liability would make it impractical to ever publish any text provided by a third party. I think there would be a creditable argument that in the US any law which attempted to do so would be invalid on its face by outright inhibiting the press.


What is the role of miners in Blockchain? What is the need of validating and authorizing a BTC transaction.
Say, for eg, A have 5 BTC in its wallet and he wants to send 3 BTC to B. What is the need to validate such a transaction?
And in case A wants to send 7 BTC to B, he simply cannot because he doesnt have the sufficient balance.
What is the need to validate then.
Why cant it be possible that the transactions are automatically added as a next block on the blockcahin on all the nodes?

Welcome to Bitcoin.SE!

It is necessary to validate all transactions since it is possible otherwise for A to just broadcast a transaction sending 7 BTC to B even if he does not have enough. A could easily write his own program to do so.

Validating all transactions and the entire blockchain is necessary for Bitcoin to have any value and to ensure consensus rules are followed.


Cannot synchronize with Bitcoin in testnet mode I downloaded Bitcoin-QT for Windows 7 into:

MYUSERNAME/Downloads/bitcoin-0.8.6-win32/bitcoin-0.8.6-win32

I want to run Bitcoin in testnet mode, so I created bitcoin.conf with only the following content:

testnet=1

I put copies of bitcoin.conf into the following folders:

MYUSERNAME/Downloads/bitcoin-0.8.6-win32/bitcoin-0.8.6-win32
User/MYUSERNAME/AppData/Roaming/Bitcoin

When I double clicked on the Bitcoin-QT icon to execute the following, Bitcoin-QT starts up but it does not appear to be in testnet mode.

MYUSERNAME/Downloads/bitcoin-0.8.6-win32/bitcoin-0.8.6-win32/bitcoin-qt.exe

Can anyone tell me why it does not seem to go into testnet mode?

I went to Start > cmd to get the DOS prompt. I entered the following and it worked:

C:\User\MYUSERNAME\Downloads\bitcoin-0.8.-win32\bitcoin-0.8.6-win32>bitcoin-qt.exe -testnet

Bitcoin-QT launches in testnet mode.  However, it is not synchronizing with the network.  At the bottom, it shows "No block source available...155 weeks behind".

I tried adding the following to bitcoin.conf and restarted bitcoin-qt.exe -testnet but it didn't make any difference.

addnode=1.2.3.4
checklevel=2

After a few hours, it still shows "No block source available...155 weeks behind".  How do I get this to synchronize?

I got it to work by adding
[test]
addnode=104.237.131.138
addnode=151.80.205.132
addnode=192.155.82.123
addnode=74.220.255.190

to the config file.
The reason is your wallet needs to connect to nodes to connect to the blockchain. Usually it comes with all the nodes required to connect, but sometimes the devs failed to include the nodes or released a new node list after an update (try looking in the bitcointalk page or the official website listed by the coin developers), so you have to add them manually.


How long a high-priority transaction takes to evaluate I am missing something so far in reading this (excellent resource). I read the part about transactions for the most part, but I don't understand the actual code evaluation part, and how long it takes. So if you have a low-priority transaction (because of a low-fee), it could take "a long time" to run, or potentially never. If you have a high-priority transaction (high fee), then it will get run "quicker" or "with higher probability". My question is what actually is happening between the moment of a transaction being "created" and it being "added to a block". I wonder if your code is actually run before the transaction is actually added to the block and validated, or it's never run until fully validated. I wonder because this seems like a huge performance slow-down in resource-intensive applications, and I wonder what people do there.

Here it says:

  A new block, containing transactions that occurred since the last block, is "mined" every 10 minutes on average, thereby adding those transactions to the blockchain.

So my question then basically is, if your code doesn't evaluate until that 10 minutes passes, or when the code actually evaluates. Basically what happens between a transaction being created and when it is incorporated into a block.

When a transaction is published to the network, every node that hears about that transaction will check to see if it is a valid transaction according to the network's rules. If it is not valid, it will be discarded, but if it is valid it will be added to that node's mempool. Nodes will relay valid transactions to their peers in the network, but there is also no requirement for a transaction to be known to all nodes before it is included in a block. A miner can put their own valid, but otherwise not published transactions into a new block they have mined.

Similarly, when a node hears about a new block, it will check to see if the block is valid according to the network's rules. If it is, then the node will update it's blockchain record to reflect any state changes incurred by transactions in that block.

With each subsequent block that builds off the block of interest, there is a higher degree of certainty that the transactions included in the block of interest will be permanently included in the blockchain record.