text:
How does blockchain technology handle the actual transaction data?
My understanding of how a transaction is secured in blockchain, especially in bitcoin, is that the output of transaction data is locked to the recipient's address (a shorter version of his public key). When the recipient decides to use the token locked to his address, he generates a digital signature using his private key and runs a CHECKSIG function on his address and the digital signature to prove that he owns the private key. I assume the CHECKSIG function will return a True and unfreeze the cryptocurrency if the digital signature matches the locked address (i.e., public key).
However, it looks like the transaction is just a number concatenating outbound address and recipient's address plus the inputs and outputs (i.e., how much money is exchanged between two addresses). This website provides a closer look at the components of transaction data.

Then how is the actual transaction data stored, encrypted and sent via
  blockchain?

For example, if A decides to buy some merchandise from B using cryptocurrency (merchandise can be digitalized, say, some valuable digital files), how are these files stored, encrypted and sent to B on the blockchain? Does blockchain technology handle the security issue of the actual digital merchandise?

how are these files stored, encrypted and sent to B on the blockchain?

They aren't. Those files are not stored on the blockchain nor are they transmitted to B using the blockchain.

Does blockchain technology handle the security of the actual digital merchandise?

It can, if you make one that does. Bitcoin's does not.

Thanks, Andrew. (Please note that I try not to confine this to bitcoin -- I just used bitcoin to exemplify blockchain) So do most blockchain applications just transfer actual files using the general protocols on the network? How are the goods associated with the tokens used to purchase them in a transaction? What if the token is correctly recorded on the blockchain but the merchandise is hacked while being transferred? Are chain code/smart contract designed to solve this issue?

@Nicholas you can use digital fingerprints/signatures to verify authenticity of digital "merchandise". You could also use them to establish ownership of a file, without actually storing the file on the blockchain, i.e. just store the fingerprint of the file, for example. Blockchains contain records of events used to establish distributed consensus, they were not designed for arbitrary file storage, but that doesn't mean it can't be done or doesn't exist.

As Satoshi Nakamoto put it:

Transactions  that  are  computationally  impractical  to   reverse   would  protect  sellers from fraud, and routine escrow mechanisms could easily be implemented to protect buyers.

Bitcoin in particular, and probably most other cryptocurrencies, are primarily concerned with moving money from actor A to actor B without needing to trust actor C. They generally do not address how to guarantee, without a trusted intermediary of some sort, that goods will subsequently move from B's control to A's control.
In the Bitcoin world, blockchain mining fees apply on a per-byte basis, so adding a digital "Game of Thrones complete 4K video series" to the blockchain would not be feasible. It isn't a delivery mechanism itself.
There's an interesting whitepaper on escrow as a solution with a good set of references

We consider the problem of buying physical goods with cryp-
  tocurrencies.  There  is  an  inherent  circular  dependency:  should  be  the
  buyer trust the seller and pay before receiving the goods or should the
  seller trust the buyer and ship the goods before receiving payment? This
  dilemma is addressed in practice using a third party escrow service. How-
  ever, we show that naive escrow protocols introduce both privacy and
  security issues. We formalize the escrow problem and present a suite of
  schemes with improved security and privacy properties. Our schemes are
  compatible with Bitcoin and similar blockchain-based cryptocurrencies.

The first reference is to Atomic Cross-chain trading which begins to address the exchange of digital assets.


text:
Does mining in a pool with a bigger hashrate mean more bitcoins?
Will someone with a 800 Mhash/s device earn as many bitcoins in one day as someone with a 10 Ghash/s device?
(I can't add a comment to
Mining pool hashrate effect on a miner's income
so I'm asking here.)

Actually, Meni's answer to the question you linked answers this pretty well.

No, payments are distributed proportionally to the contributed work.
The chance to find a block is proportional to the hash-rate of a mining entity. So, if watched sufficiently long you could expect to get the same percentage of all rewards as the portion of the total mining power you contribute. This principle remains the same whether you solo mine or pool mine (minus any fees the pool costs you).
However, the pool combines its power to find more rewards, which it distributes among its contributers according to the size of the contribution of shares to the pool. I assume the operator gets a percentage of the reward in some fashion. That way you gain a steady small income instead of winning the lottery every few decades.
So, whether we are talking about mining pools in the network or participants in a mining pool, if watched for a sufficiently long period of time the entity with 10 GH/s will earn 12.5 times the amount of the entity with 800 MH/s.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Organization to keep track of wrongfully obtained bitcoins
I am curious whether there are any organizations that are actively trying to monitor bitcoins from illegal sources.
I understand that 'when done properly' you can make bitcoins practically untraceable, but I have just witnessed a rather amateuristic attack where people were suggested to transfer funds to
3EaRJ5p172iLYJKH8YYnPYFw9pKgxYg1sj and I wonder if anyone is trying to do something about these cases.
Just one partial solution I could think of would be to alert exchanges or vendors when the bitcoins are traced to them, so they can hold the funds untill the situation has been cleared up.
I am not asking whether my proposed solution makes sense, but I do ask  if there is any organization/solution that structurally tries to make life difficult for bitcoin criminals

So far I have seen a lot of answers explaining you cannot catch all criminals, but I would be surprised if we cannot even catch some.
I also found a reference to nomoreransom.org but ultimately that just referred me to the local authorities, which makes me doubt there is a structured approach behind this.

There are companies such as Chainalysis (no affiliation) and Elliptic (also no affiliation) that attempt to perform such analysis and group addresses into clusters based on the entity (exchange, scam, unknown, mining pool, gambling, payment services, etc.) that is believed to control them.
They offer their analysis to exchanges, governments, merchants, etc. for a price, as any other business.

That is somewhat comforting, I upvoted but still wonder if this is really doing what I was hoping for. I understand that people need to pay to see the results of their analysis, but I don't see any opportunity to conveniently flag an address or transactions as being related to fraud on their websites, so probably that is not a regular source of input for them.

@DennisJaheruddin the existence of chain analysis companies is almost certainly not comforting, they actively attack user privacy and thus represent a very real risk to the usefulness of the Bitcoin network.

After some more searching I ended up flagging the address on https://bitcoinwhoswho.com
The website is very slow, and once the submission even failed, but eventually I was able to flag the address, and it also showed that the address was already reported by someone else when I got there.
It looks like they mostly just report what people put in, so i doubt they proactively track illegal funds down the line, or alert other parties. However, I guess this still enables other parties to take some action if they want to.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
New params of chainparams.cpp. What put on them and how generate?
What do these parameters do and what to insert there
        uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); //what this do ? end what put to here

        consensus.nRuleChangeActivationThreshold = 6048; // 75% of 8064 //what this do end what put ?
        consensus.nMinerConfirmationWindow = 8064; // nPowTargetTimespan / nPowTargetSpacing * 4  //what this do ?
        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; //what this setting's do ?
        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008

        // Deployment of BIP68, BIP112, and BIP113.
        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1485561600; // January 28, 2017
        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1517356801; // January 31st, 2018

        // Deployment of SegWit (BIP141, BIP143, and BIP147)
        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1485561600; // January 28, 2017
        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1517356801; // January 31st, 2018

        // The best chain should have at least this much work.
        consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000006805c7318ce2736c0"); //what this do end what put here ?

        // By default assume that the signatures in ancestors of this block are valid.
        consensus.defaultAssumeValid = uint256S("0x1673fa904a93848eca83d5ca82c7af974511a7e640e22edc2976420744f2e56a"); //1155631  //what this do ?

        nPruneAfterHeight = 100000;  //what this do ?

i need to reconfigure exist coin to new wallet but stuck on this param's.
For all who down vote question, i try find about this param info , but do not find anything, or you simple down vote what you do not understand ?
I understand it's start end time out time. But how it work's.

uint256S("00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); //what this do ? end what put to here

The first line describes a minimum difficulty.
consensus.nRuleChangeActivationThreshold = 6048; // 75% of 8064 //what this do end what put ?
consensus.nMinerConfirmationWindow = 8064; // nPowTargetTimespan / nPowTargetSpacing * 4  //what this do ?

The next two lines say that rule changes require 75% agreement, measured across 4 retargeting periods.
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28; //what this setting's do ?
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 1230767999; // December 31, 2008

// Deployment of BIP68, BIP112, and BIP113.
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 1485561600; // January 28, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 1517356801; // January 31st, 2018

// Deployment of SegWit (BIP141, BIP143, and BIP147)
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 1485561600; // January 28, 2017
consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 1517356801; // January 31st, 2018

The next eleven lines describe the minimum and maximum times that three softforks can activate, and how they are to be signaled using version bits.
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000006805c7318ce2736c0"); //what this do end what put here ?

The next two lines specify the minimum amount of chain work that a client must have before it will consider itself synchronized.
// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x1673fa904a93848eca83d5ca82c7af974511a7e640e22edc2976420744f2e56a"); //1155631  //what this do ?

The next two lines disables signature checks on blocks that are ancestors of the block specified by that block hash.
nPruneAfterHeight = 100000;  //what this do ?

The next two lines disable block pruning on blocks below a certain height. In Bitcoin, this is because most of the initial blocks are empty. This is documented in this commit.

about 2 , how i understand it's it's in time block *4 but it's on minute or second's if i have  block time 2 minutes .
consensus.nPowTargetTimespan = 10 * 60; // 10 minute
consensus.nPowTargetSpacing = 5 * 60; //5 minute
i need put  the 8 or how сcalculate this parameter right correctly

@tseries Neither, it's expressed in terms of blocks.

this i understand but if use this rule i have 8 second, i think it's to low.
Whether this value is claimed on these parameters or it can be any value.

@tseries Decreasing that value makes a rule change activate faster. Increasing it makes a rule change activate more slowly.

authors: Ирина Казакова

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Problems restoring wallet
First of all .. yes im stupid.
Now .. I had some BTC a few years ago. Thought I had kept it safe, now I seem to have reinstalled the OS on that PC and wiped profile folder. I looked around for a wallet.dat file and found one, but it could also be a file of another crypto currency .. not sure, it's so long ago I'm not sure what I did anymore but the date on the file seems on the old side (december 2013).
I installed Bitcoin Core (I used what existed before CORE came out .. just bitcoin afaik ?), I let it sync for a day and am now caught up.
I replaced the wallet.dat file and started the client again. First it took a few minutes rescanning, then crashed at 100% (???). I restarted client again, now it said it had to update the blockchain a bit more, it was at 99.9% and quickly finished.
Now it shows my wallet is empty, but it also tells me it is encrypted and locked. I tried unlocking from the debug console, but it tells me the pw is incorrect. This is weird because the only thing I'm sure of is that this is the correct password.
Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something ?
Even without unlocking should I be able to see the balance at least ?
I know its also possible to have the private key saved somewhere (thats what I should have done, but what I have saved looks short to me, I assume its the password.)
Looking at the balance of 0 BTC i have a feeling this jsut means I'm screwed. I only have myself to blame. I'm still going to attempt to find another backup file, or attempt to restore deleted files from that disk, maybe there's still something there.

Maybe you should try again with the final version of bitcoin-qt... bitcoin-0.8.6-win32-setup.exe. It is available at compzets.com and has the right sha256

Even without the password you'd still be able to see a transaction history. So likely this wallet.dat is for an altcoin if you're sure you had activity on it

Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something?
According to https://en.bitcoin.it/wiki/Wallet_encryption

This page describes the algorithm used for encrypting the wallet.dat file used in the original Bitcoin client.
Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase using SHA-512 and OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption (and is updated based on the speed of a computer which does a subsequent passphrase change)

According to https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README

Bitcoin 0.4.1 BETA
Technical details of wallet encryption
Wallet encryption uses AES-256-CBC to encrypt only the private keys
  that are held in a wallet.  The keys are encrypted with a master key
  which is entirely random.  This master key is then encrypted with
  AES-256-CBC with a key derived from the passphrase using SHA512 and
  OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by
  the speed of the machine which does the initial encryption (and is
  updated based on the speed of a computer which does a subsequent
  passphrase change).

The current version's C++ code at https://github.com/bitcoin/bitcoin/blob/master/src/wallet/crypter.cpp mentions the same algorithms but I haven't tried to work out if the encryption is in fact identical to the early versions or if this is even the relevant source file (though it's name and location suggests so).

It seems likely the encryption method is compatible between current and older versions.
I would hope that any competent software developer, when changing the encryption method, would implement a wallet version number or other indicator that would allow new software to detect older wallet.dat files and either upgrade them silently or provide an appropriate message to the user.
I may be wrong though.

The encryption algorithm has never been changed (as of april 2021). Wallet files created by older versions should be compatible with all new releases afterwards.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
How many bytes long should nSequence be?
When I look at the following raw transaction from: https://blockstream.info/tx/a175425ee2f3c01acc97ef32ab1082db14eaa94e5af4c54f02f3b01dec72558e?expand
020000000001018e5572ec1db0f3024fc5f45a4ea9ea14db8210ab32ef97cc1ac0f3e25e4275a100000000**00cf050000**01d2ddbc0000000000160014b82d832b2e5c0d80c771b06ce0da50fbccf12f3e0347304402204a54d94068512c22847cc07fa85f2b93feaf758411920a9b20ce9b85831e8aa5022005924cb82c331c5173e21477a4d8298eb25c0d967ace065b883455f2537c3d0a01004d632103f96d73ffe138690f032e97408af933a71782ad27a28df66a750b48c56b2d7fa96702cf05b275210304f332f50363cd01b679d9fb50fb8691fb0fb638737867bd02f06850c6191a2268ac00000000

When I parse it manually, specifically at this section: a100000000**00cf050000**01...
a1 is the last byte of the input tx (in little endian),
00000000 is the output index (4-bytes),
and at the end the 01 is the tx_out_count.
But that would make the sequence number 00cf050000, which is longer than 4 bytes? What am I missing here?

The sequence number is always 4 bytes, it is a fixed size, little endian, 32 bit integer which makes it always 4 bytes.
What you are missing is the scriptSig. The scriptSig always begins with the size of the script (as a compact size unsigned integer). If the scriptSig is empty, then the size must still be there to say that it is a 0 length byte. So the first byte of your "sequence" is actually the length byte for the scriptSig that says it is of length 0.


text:
What is the scriptCode in a P2WSH transaction?
Let's say I am spending from a 2-of-2 multisig with this script:
522103c2f21de0f430251d8e3987fbe89ff51f3d6f3a48b234b84b60ddb9f24d587cf52103e0948a03f50377290847d27c93d383b8ab7e2d0bc065e96e0e1136b315388b5452ae

OP_2 <len(pubkey1)> <pubkey1> <len(pubkey2)> <pubkey2> OP_2 OP_CHECKMULTISIG

What would go in the scriptCode according to BIP143? Is it just the script listed above? Here is the relevant part from BIP143.

For P2WSH witness program,
  - if the witnessScript does not contain any OP_CODESEPARATOR, the scriptCode is the witnessScript serialized as scripts inside CTxOut.
  - if the witnessScript contains any OP_CODESEPARATOR, the scriptCode is the witnessScript but removing everything up to and including the last executed OP_CODESEPARATOR before the signature checking opcode being executed, serialized as scripts inside CTxOut. (The exact semantics is demonstrated in the examples below)

Yes, the scriptCode would be that multisig script.

Thanks.
Now that I just found out, I wanted to add that in the bip143 transaction digest, the scriptCode needs to be preceded by a byte indicating the length of the scriptCode.


text:
Are redeemScripts private?
When I do createmultisig in bitcoin core, I get the redeemscript as output. I of course want to save this information, but can I put this in my regular database or do I need to take extra precaution with the redeemScript?
In Short: Should I treat the redeem script as a private key, public key, or address hash (what level of security/and do i need to treat it with). This is from a "if it get stolen" perspective. What is the worst thing someone can do with a redeemScript?

You can treat the redeemScript as the public key. The redeemScript, like the public key, is revealed entirely when you spend from your multisig address. So it will become public information, much like your public key will also become public information when it is used in an input.
The redeemScript cannot really be used to do anything particularly bad unless the redeemScript has certain conditions which allows someone to do so. For multisig, there are no such conditions. Having the redeemScript only allows you to see what the specific conditions for spending an output are, and that information by itself is not useful.


text:
How to implement Multisig transaction without using OP_CHECKMULTISIG
I've learned that OP_CHECKMULTISIG is a Bitcoin builtin opcode to validate Multisig transactions. Can I write Bitcoin script to validate the Multisig transactions without invoking OP_CHECKMULTISIG? If so, what do I need to change in the redeemScript?

Yes, you can use a redeemScript that has a lot of OP_CHECKSIGs and boolean operations. You would have to enumerate all possible combinations of signatures however.
As a simple example, if you used a 2-of-2 multisig, traditionally your redeemScript would be
OP_2 <pubkey1> <pubkey2> OP_2 OP_CHECKMULTISIG

and the scriptSig is then
OP_0 <sig1> <sig2> <redeemScript>

Without OP_CHECKMULTISIG, your redeemScript would be
<pubkey1> OP_CHECKSIG OP_SWAP <pubkey2> OP_CHECKSIG OP_BOOLAND

and the scriptSig would be
<sig2> <sig1> <redeemScript>

For more complex multisigs with more keys and m-of-n, the scripts will be much more complicated with more OP_SWAPs, OP_BOOLORs, and OP_BOOLANDs.

There was also this very old tx with a more complicated script, which you and me have replied to: https://bitcoin.stackexchange.com/questions/71326/what-does-this-transaction-script-mean/71407#71407


text:
What is the behavior of the try catch statement in lines 1707-1729 in the ui.cpp in the release 0.1?
In the first public release, ui.cpp has this code on the lines in the subject:
void CSendingDialog::OnReply3(CDataStream& vRecv)
{
    int nRet;
    try
    {
        vRecv >> nRet;
        if (nRet > 0)
        {
            Error("The payment was sent, but the recipient was
                unable to verify it.\n"
                "The transaction is recorded and will credit to
                the recipient if it is valid,\n"
                "but without comment information.");
        return;
        }
    }
    catch (...)
    {
        //// what do we want to do about this?
        Error("Payment was sent, but an invalid response was received");
        return;
}

The try catch statement at the bottom shows the error as payment sent but invalid response was received. In this case, does this mean that the send BTC would be lost forever as in this question or does this mean that the transaction would be part of some orphaned block (like here).
Bonus, was something done to address the comment in the code?

Bitcoin originally had a "send to IP address" feature where you would connect to an IP address, ask them for a public key, and create a transaction using that public key as output.  This code is part of that feature.  This mechanism was eventually removed, so that's the eventual answer to "was something done".


text:
Which method/programme can create a wallet using the least amount of space?
On a first attempt to create a wallet with bitcoind, the process failed after filling the 160 Gb available in my home disk.
Which method or programme would allow me to create a wallet using the least space possible?
Update: I removed bitcoind and am now using Electrum. However, this freed up hardly any space on disk. How can I delete whatever files bitcoind created?

What do you need the wallet for? Do you just want to use it privately once a month, or are you building a service that needs to hear about every transaction within seconds?

A personal wallet for occasional use.

related: What is a good resource to help newbies choose their first wallet/s?, Where is the data folder for Bitcoin-Qt?

Delete the old files from the location described here: http://bitcoin.stackexchange.com/questions/4006/where-is-the-data-folder-for-bitcoin-qt

When you are running a bitcoind server, you can enable pruning. This means only a part of the blockchain is saved.
How can I run bitcoind in pruning mode?

You may not need to have its entire blockchain on your machine, depending on your situation:
You should clarify / update your question to include why you are running bitcoind from a command-line in the first place.
If you JUST want a wallet/Bitcoin-address, there are plenty of options.
I personally use "Electrum Bitcoin Wallet" GUI and find it easy to use - again your question is unclear so this may not be your complete answer but should provide a start.


text:
How to free up the space taken by bitcoind?
I am trying to create a wallet on my computer with bitcoind following this guide. I installed it, ran it, and monitored the process with bitcoin-cli. It went on for about 15 hours, at which it failed with an error message: "Error: Error: Disk space is low!". bitcoind had taken up the whole 160 Gb available in my home disk.
How can I safely free up the space taken by bitcoind? Should it be uninstalled? Or delete files (which?) will suffice?

The quide you followed is 3 years old. Since then, there was an option added called prune - add it to a line in your bitcoind.conf, like so:

prune=50000

And restart bitcoind. This would effectively limit your blockchain size to only 50Gb of recent blocks.
In case you need to have a full blockchain available for research & analysis, there is no other way but to buy a bigger HD.
In case you don't need the local blockchain at all, then there is very little reason not to use a lightweight client like Electrum which does not store anything on your HD but instead relies on proprietary servers.

I am now happily using Electrum.


text:
How to denouce a scam exchange?
I was scammed by an exchange called BitNake. It is referenced in the Bitcoin Wiki as a fast and secure exchange seeded in Germany. I could not find any negative comments on the web and decided to try it. I paid the minimum amount but never got any Bitcoin deposited in my wallet. Repeated e-mails to the support address went unanswered.
As it turns out, the BitNake website seems to have been created just last month and is actually installed in California. I guess I am one of the first to fall for this.
The question then is: how do I tell the world this website is a scam? So that others do not fall for it too.
Update I: here is the scam report at CoinTalk.
Update II: BitNake had been previously reported as a scam. However the search engine I use, DuckDuckGo, seems to be blind to BitcoinTalk. Another interesting aspect in this story is PayPal actively protecting the scammer.

Spreading the word about your experiences (and supporting it by the hard facts of website domain registration etc.) is the best way. You might be able to edit the wiki entry to add a warning. In addition, the scam accusation section on bitcointalk.org might be a good place to make your warning visible to many potential victims.

Start posting your story where you can by searching key phrases on google.com.
Example: BitNake, Bitnake review, BitNake scam..etc, anything related to BitNake. If you search BitNake you have a bitcoitalk thread; for bitnake review you have scamanalyze.com where you can leave a comment.
After that contact them and ask for you money and in exchange you will delete the bad reviews.


text:
Bitcoin Core coin control via RPC (CLI)
Bitcoin Core introduced nice Coin Control feature accessible via the GUI client. To my surprise though, I don't see any obvious way how to make use of Coin Control via RPC/bitcoin-cli.
How can I pick a particular unspent output when creating a transaction via RPC?

You can, but the process is broken up into multiple RPCs.
First you use the listunspent RPC to find outputs to spend.
Then you use createrawtransaction with the inputs you want, and the outputs (destinations) you want.
If you didn't select all inputs and outputs already (including change, if necessary - any difference between inputs and outputs goes to fees), you can use fundrawtransaction to add more inputs using the normal coin selection algorithm, or to add change.
Then you use signrawtransaction to sign your inputs.
When all is ready, you can broadcast your transaction using sendrawtransaction.

Thanks, this really seems to be the only way as of now. Perhaps we'll get a more higher level API someday.


text:
Is there a maximum size of a scriptSig/scriptPubKey?
Previous research:

Transaction's maximum size
What is the maximum size of a transaction?
The maximum size of a standard transaction is 100k bytes.

Are there any consensus rules that prohibit scripts from being too large? I know each individual element of a script has to be less than 520 bytes, as shown here, but a script could still have many many individual elements and create an extremely large block.
For example, a malicious miner wants to make the blockchain as big as possible and creates a coinbase transaction with a particular output that has the OP_RETURN opcode followed by enough data to make their block just less than the 1 MB limit. Will the malicious miner's block, in which 99% of the block data is encoded into a dummy OP_RETURN output, be accepted or rejected?

stack elements of a txout script need not be less than 520 bytes - there are examples in the live blockchain of stack elements larger than this. however i think that the MAX_SCRIPT_ELEMENT_SIZE criteria you mention will prevent this txout from ever being spent

10,000 bytes.  See Bitcoin Core source code: https://github.com/bitcoin/bitcoin/blob/v0.17.0/src/script/script.h#L31-L32
https://github.com/bitcoin/bitcoin/blob/v0.17.0/src/script/interpreter.cpp#L299-L300
Note that the EvalScript function only runs when someone tries to spend a script, so it doesn't apply to unspendable outputs like OP_RETURN.  In that case, the consensus rules allow you to include as much data as you want in the output up to the maximum block weight limit.  Bitcoin Core has long placed much more restrictive limits on what transactions it'll relay and mine when they contain OP_RETURN outputs, so we rarely see transactions exceeding those limits.

It was right under my nose :)

There are no checks specifically on OP_RETURN. There is a standardness rule, which is that they must embed up to 40 bytes of data. Of course, if you're mining your own blocks, you can ignore standardness rules.
There is a rule against scripts more than 10 kilobytes long, but since there's no limit on the number of outputs you can create, that's not a meaningful restriction.
However, this isn't a very good way to attack the network. It costs roughly $1000 of electricity to make a block. (You recoup some of that from the Bitcoins you get, of course.) It would take 104 years for 10000 nodes storing your block to cost more than mining it costed you in the first place.

authors: ชาลี กาสุวรรณ


text:
Why is your Bitcoin balance displayed on paper wallets?
Sites like bitaddress.org and Blockchain.info where you can print out a paper wallet also show your current Bitcoin balance on your paper wallet. But your balance is something that is constantly changing, so why would it be printed on a paper wallet?

BitAddress.org generates new addresses.  These never have funds on them at the time they are generated, of course.  Are you referring to some other source?

@StephenGornick: Apparently bitaddress.org has a new design for paper wallets, with some art (including Satoshi's formula for the probability of successful double-spend) and an "Amount:" label. It looks blank so maybe it's intended to be filled in after printing.

The balance of an address only changes if you send bitcoins into or from it. Paper wallets are usually intended to be swiped only once, so you should not have outgoing transactions while the paper wallet is still valid. You could add coins to it, as a sort of piggy bank, but there are also use cases where the amount will be fixed.
So, if the paper wallet is intended to be used with a fixed balance, it can be printed on it for convenience; if not and an amount is printed anyway, it can simply be ignored.


text:
Easiest way to set up non computer-literate person with Bitcoin
What would be the easiest/quickest way to get somebody who isn't computer-literate set up to have the ability to transfer money to me via Bitcoin? Also, Bitcoin touts that it is anonymous. Is it any more anonymous or untraceable than a simple cash transaction?

Bitcoin is not anonymous, all transactions are public. The only thing private is your identity behind your addresses. So if you send or receive bitcoin to someone who know who you are they will able to trace the transactions you do but with only that address. You can get anonymity if you mix the address you use.

The easiest way would be to create an online wallet on blockchain.info, and use one of the easy deposit features it offers. This however is impractical both for traceability (his, not yours), and for fees (which might even be higher than the taxes AFAIK).
That said, bear in mind that usually you might convince people to use bitcoins when they have something to gain, not when you do: consider carefully why should they do it before asking them to.

That doesn't answer my question though...Lets take the assumption that they do have something to gain, and are willing to do this for me

That being said, I'm more than happy to remove the entire premise for the questions and just leave the two questions. Because whether you're right or not (and I think you probably are) my questions still stand as things I'd like to know

Yes, it would be better if you did that.

done and done. Can you edit your answer as well?

I'm not sure that Mt. Gox meets what I'm looking for with the non computer-literate requirement. The reason being, you need to scan and upload a picture. If somebody were to tell my mom that was a requirement, she would end up calling me. Do you know of different exchange where signing up is "easier"

@bitCoinUser321 true, try this https://blockchain.info/wallet/sms-phone-deposits

LocalBitcoins.com offers secure and easy ways buying bitcoins locally in-person. There traders are very friendly towards novice bitcoin users and LocalBitcoins.com has messaging system where the buyer can ask about the bitcoin and get help how to set it up and.

Go to LocalBitcoins.com and enter where you are into the location search box
You'll see a list of nearby traders who are selling bitcoins to you
LocalBitcoins.com is in-person and you are discussing with a local trader, so language should not be a problem
Buy bitcoins with cash or online banking. Note that buying bitcoins is always safe, since LocalBitcoins.com has public reputation history of traders and holds bitcoins in escrow process until the trade has been succesfully complete
After bitcoins have been bought they appear in LocalBitcons.com website wallet
From there the person can directly transfer bitcoins to you

Is the screenshot really necessary?

In the United States, by far the easiest way to get up and running is with Coinbase.  It's very easy to get up and running - anyone who has a bank account can buy bitcoins with Coinbase by providing them with a bank account number and routing number.  Aside from being a Coinbase customer, I'm not affiliated with them.
Since this is how I bought my own bitcoin stash in the past, here's what you need to do to buy bitcoins on Coinbase:
1) Register an account on Coinbase.com.
2) Provide your bank account number and routing number and wait a few days for them to send you a small amount of money to your account so they can verify that you actually control it.
3) Confirm the transactions they sent.
4) Decide how many bitcoins you want to buy, and initiate the transaction from Coinbase.com.
That's it.  The bitcoins will arrive in the account about five business days later, if my transaction with Coinbase is typical.
I have to address what you said about Bitcoin being anonymous, however.  Bitcoin is not anonymous, it is far less anonymous than cash in that all transactions are stored forever in the blockchain.  In that sense, it is far less anonymous than cash since with bitcoin, if someone knows your bitcoin address, they can track what you spent your bitcoins on, what the recipient spent your bitcoins on, and so on.  Unless you use a mixer, bitcoins are definitely not anonymous.


text:
Sending BTC using Seed Hex or mnemonic
I’m interested in sending BTC from wallet to another and probably automate it through some libraries.
I have a question: if I have a seed hex or 12 words I can generate all my wallets (addresses, private keys) with BIP39 mnemonic tool.
How could I know what of external wallets (private keys) I should use to send btc using libraries assuming it usually changes?
How could I basically send BTC to some wallet having only seed hex or 12 words?

How could I know what of external wallets (private keys) I should use to send btc using libraries assuming it usually changes?

You can't without scanning the entire blockchain to find out what addresses have been used before.

How could I basically send BTC to some wallet having only seed hex or 12 words?

You can't without scanning the entire blockchain to find the UTXOs that you can spend.

In general, a mnemonic phrase or a seed is not enough to be able to send Bitcoin to someone else. You need to generate keys and scan the entire blockchain to find UTXOs that you can spend. This is why many wallets store more than just the seed phrase in their wallet files.

Thanks for your answer. What keys should I generate to scan for UTXOs? I can generate all the private keys for wallets... Btw I have xpub and xpriv keys from wallet.

This Bitcoin example, posted almost 3 years ago, should succinctly answer most your questions. BIP 44 paths levels (m or M / purpose' / coin_type' / account' / change / address_index) can be tweaked as needed. Some of the adjacent examples demonstrate how BIP 32/39/44 technology can be extended to other altcoins.
For a given coin type, blockchain scanning of synthesized addresses, associated with a given sequential M, is required to identify applicable UTXOs. For a given M with associated UTXOs, there is a companion m. HD wallets applications innately perform such bookkeeping operations.  HD wallets also tend to use compressed private keys, compressed public keys, and compressed addresses to minimize transaction fees.
Either use something like bx (bitcoin-explorer) to synthesize the keys of the other wallet and use the synthesized addressed to send funds, or use commercial products like Trezor, Ledger, Jaxx, Mycellium... However, HD paths and details for Ethereum and Monero will vary and will introduce seed word interoperability issues.
For example, Ledger Ethereum paths do not follow the BIP 44 Standard. Also, details for standardizing Monero key synthesis from BIP 39 seed words is non existent.  This is likely to create seed word interoperability issues between existing Ledger support and future Trezor support.
Existing functionality at https://github.com/bholben/seaweed can be extended to accomplish what you desire on a old decommissioned permanently air-gapped iOS or Android device to synthesize addresses for another HD wallet.


text:
Sign transaction legacy with Openssl
I want to understand how Bitcoin sign transactions with Openssl. I saw this post But I have some issues.
Above my private and public keys.
Private keys:
$ cat chiave_priv_3.pem

    -----BEGIN EC PARAMETERS-----
    BgUrgQQACg==
    -----END EC PARAMETERS-----
    -----BEGIN EC PRIVATE KEY-----
    MHQCAQEEIOLcjvH4RhZFl1hthXl7DD3MHXUCWKiI2b/zoYlvBmKboAcGBSuBBAAK
    oUQDQgAE3Qc0PacS/HmhnZjIot48dZ++rvh121Rq+xjreFKrf/QCl2sDXTncDbe0
    wcCtq4yaUpdbmzV9OgrP94EFsEC/1w==
    -----END EC PRIVATE KEY-----

public key compressed
$ cat chiave_pubblica_compressa_3.txt
03dd07343da712fc79a19d98c8a2de3c759fbeaef875db546afb18eb7852ab7ff4

I'm working on regtest and my UTXO is:
 {
    "txid": "0c647aadcb4028260ecb753c727e0237658873a0cbdbeb5695b8cb85ea87f98d",
    "vout": 0,
    "address": "myiGTzGG8rJikr2HcVyPYqprh6Ds1kdY7v",
    "label": "",
    "scriptPubKey": "76a914c79602205abbe1d35ee6dcb4a19791cbd5a26e1588ac",
    "amount": 49.99900000,
    "confirmations": 6,
    "spendable": true,
    "solvable": true,
    "desc": "pkh([c7960220]03dd07343da712fc79a19d98c8a2de3c759fbeaef875db546afb18eb7852ab7ff4)#5c03vyak",
    "safe": true
  },

I can create transaction data with this parameters:
TXID=0c647aadcb4028260ecb753c727e0237658873a0cbdbeb5695b8cb85ea87f98d
VOUT=0
AMOUNT=49.998
ADDR_MITT=msPjuNgbmbRSkNGJPvquKJRRmrbzS96s62

bitcoin-cli createrawtransaction '[{"txid":"'$TXID'","vout":'$VOUT'}]' '[{"'$ADDR_MITT'":'$AMOUNT'}]'

02000000018df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c0000000000ffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac00000000

Now I get the scriptPubKey and put in ScriptSig and add SIGHASH in little endian.
02000000018df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c000000001976a914c79602205abbe1d35ee6dcb4a19791cbd5a26e1588acffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac0000000001000000

Where
02000000
01
8df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c
00000000
19 76a914c79602205abbe1d35ee6dcb4a19791cbd5a26e1588ac
ffffffff
01
c0e4022a01000000
19 76a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac
00000000
01000000

Sha256 twice
$ printf 02000000018df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c000000001976a914c79602205abbe1d35ee6dcb4a19791cbd5a26e1588acffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac0000000001000000 | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b | awk '{ print $1 }' > a.txt
daac47088b7eba5593282013442dbcba59556d095982d470f0a02972269bc0e1

Sign with chiave_priv_3.pem
$ openssl dgst -sha256 -hex -sign chiave_priv_3.pem a.txt | sed 's/^.* //'
304402207071c9fd7341a15cacfea72e215b44bed42d1a00c7fc5bfed5e01d36acd953c20220308e45aedd080ba65993b69b4c82cc928db8c3e70a6f402fe0258157a4690c6e

Add 01 at the end of signature and check the length
printf 304402207071c9fd7341a15cacfea72e215b44bed42d1a00c7fc5bfed5e01d36acd953c20220308e45aedd080ba65993b69b4c82cc928db8c3e70a6f402fe0258157a4690c6e01 | wc -c
 142

142 char is 47
Debug DER signature
30 DER prefix
44 Length of rest of Signature
02 Marker for r value
20 Length of r value
r = 7071c9fd7341a15cacfea72e215b44bed42d1a00c7fc5bfed5e01d36acd953c2
02 Marker for s value
20 Length of s value
s = 308e45aedd080ba65993b69b4c82cc928db8c3e70a6f402fe0258157a4690c6e
01 SIGHASH_ALL

concatenate with public key compressed
47304402207071c9fd7341a15cacfea72e215b44bed42d1a00c7fc5bfed5e01d36acd953c20220308e45aedd080ba65993b69b4c82cc928db8c3e70a6f402fe0258157a4690c6e012103dd07343da712fc79a19d98c8a2de3c759fbeaef875db546afb18eb7852ab7ff4

the whole scriptSig length is: 6A (212 char hex)
Now I can build my transaction:
02000000018df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c000000006A47304402207071c9fd7341a15cacfea72e215b44bed42d1a00c7fc5bfed5e01d36acd953c20220308e45aedd080ba65993b69b4c82cc928db8c3e70a6f402fe0258157a4690c6e012103dd07343da712fc79a19d98c8a2de3c759fbeaef875db546afb18eb7852ab7ff4ffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac00000000

Sendrawtransaction
bitcoin-cli sendrawtransaction 02000000018df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c000000006A47304402207071c9fd7341a15cacfea72e215b44bed42d1a00c7fc5bfed5e01d36acd953c20220308e45aedd080ba65993b69b4c82cc928db8c3e70a6f402fe0258157a4690c6e012103dd07343da712fc79a19d98c8a2de3c759fbeaef875db546afb18eb7852ab7ff4ffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac00000000
error code: -26
error message:
mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code 16)`

The problem is that you are doing all of the hashing (and putting it into hex) and then having OpenSSL hash it again. openssl dgst will hash the message before signing, but this is incorrect for Bitcoin. Traditionally, in ECDSA, the message is hashed once and then signed. But with Bitcoin, it is actually hashed twice. Another way to think of this is that the message is a hash.
So you have already double hashed the transaction. But OpenSSL will hash it again, making it triple-hashed, which means that you sign a different message. Furthermore, OpenSSL will read your message as binary data, not interpret the hex that you gave it. So really your hashing command should be
printf 02000000018df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c000000001976a914c79602205abbe1d35ee6dcb4a19791cbd5a26e1588acffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac0000000001000000 | xxd -r -p | sha256sum -b | xxd -r -p > a.txt

This will hash the sighash message once and put the binary data into a.txt.
Then you can sign it as you did.

Alternatively, OpenSSL has a pkeyutl tool that does not do any additional hashing on the data to be signed and instead expects that you have already hashed it. You could use this instead, but you will still need your hash to be binary rather than hex. So you can do
printf 02000000018df987ea85cbb89556ebdbcba073886537027e723c75cb0e262840cbad7a640c000000001976a914c79602205abbe1d35ee6dcb4a19791cbd5a26e1588acffffffff01c0e4022a010000001976a914824441111b374bec1952a5b3fa9dd4e3ed679b3888ac0000000001000000 | xxd -r -p | sha256sum -b | xxd -r -p | sha256sum -b | xxd -r -p > a.txt

to get the double hash. Then do
openssl pkeyutl -inkey chiave_priv_3.pem -sign -in a.txt -pkeyopt digest:sha256 | xxd -p -c 256

to sign.

Thanks for reply, I tried both solutions but I get the same error. the second solution has a little error openssl pkeyutl -inkey chiave_priv_3.pem -sign -in a.txt -pkeyopt digest:sha256 | xxd -p -c 256

It works but sometime I get this error mandatory-script-verify-flag-failed (Non-canonical signature: S value is unnecessarily high) (code 16)

That's expected. There's a standardness rule that requires the S value to be low. You can tell if the S value is low by checking it's length; it needs to be 32 bytes or less. A high S can be converted into a low S by negating it, but if you don't know how to do that manually, just make signatures until one has a low S. There's a 50% probability that any given signature has a low S.

thanks for your time, I will repeat the signature for now. Next step is sign P2SH custom.


text:
Was experimenting with Timelock transactions its now past the time of the timelock expiration however I still get the (non-final) Error
I am getting the Non-Final error on some timelocked BTC even through it is past the time set. I have searched around and seen someone post that this can happen with unconfirmed transactions. My original timelock transaction is confirmed.
Here is the original locked transaction 38eVWPirWs7j54Y8FtuHY9RZ3aXnMaEijY
I used a guide located here and followed the steps accurately
https://steemit.com/bitcoin/@daan/how-to-create-time-locked-transactions-with-bitcoin-free-bitcoins-inside
and used a local copy of coinb.in

yeah I suspect its because I used a BC1 address and not a 1/3 address as per the guide. Ill give all the details if anyone wants to investigate if you solve it you can spend the transaction its like 3$ usd please let me know how to do it properly next time and what worked. Thanks
Redeem script
0490a87065b17521031c924ba9400b2f2fec7c167b4c4bf5e6d6a691f36af8633e50ae36d3fbb34ef0ac
Unsigned transaction
0100000001edad9d61ba76a2c47a6c46a1f024139f770d0519f30792260a8f5e38285d5e00000000002a0490a87065b17521031c924ba9400b2f2fec7c167b4c4bf5e6d6a691f36af8633e50ae36d3fbb34ef0acfdffffff016022000000000000160014705becd1fde498c9b8fd1b634036f8a8b24d3a8090a87065
Signed transaction
0100000001edad9d61ba76a2c47a6c46a1f024139f770d0519f30792260a8f5e38285d5e000000000073473044022077b81991d3055e13705eeccad01949261518530abef53ae65de5a05db0f0060802207eb0259f77ca510270ccd65d3b8fc2144c51b3c3fcc7f65d947c3d2e13821d78012a0490a87065b17521031c924ba9400b2f2fec7c167b4c4bf5e6d6a691f36af8633e50ae36d3fbb34ef0acfdffffff016022000000000000160014705becd1fde498c9b8fd1b634036f8a8b24d3a8090a87065
Original encoding address
031c924ba9400b2f2fec7c167b4c4bf5e6d6a691f36af8633e50ae36d3fbb34ef0
(bc1qjkg4tvxw8t2zwq9ullvgkq939ranns447macwx) Suspect this address is what made it not work
Private key for above address
L35XvrBVMfChdZLvEuJdpgaadSMny4dTpKqCSASC4Ykr8Za6rqCv

Here is the original locked transaction 38eVWPirWs7j54Y8FtuHY9RZ3aXnMaEijY

That isn't a transaction-ID it is an address.
That address is associated with only one transaction so far. The transaction ID is 005e5d28385e8f0a269207f319050d779f1324f0a1466c7ac4a276ba619daded
That transaction has a locktime of 0 according to a blockchain explorer
blockchair.com shows this transactions "raw TX" data in JSON as
{
    "txid": "005e5d28385e8f0a269207f319050d779f1324f0a1466c7ac4a276ba619daded",
    "hash": "8edd5bbdcdfe2bb7b7ca8b2f6b4808f1fd1023b5da91f6802b51fd9b46e8cd75",
    "version": 1,
    "size": 224,
    "vsize": 142,
    "weight": 566,
    "locktime": 0,
    "vin": [
        {
            "txid": "0f862b7e37471bc6481d3066fc06a2a8eb58b5b482077c024af0d0f3b9ac776c",
            "vout": 1,
            "scriptSig": {
                "asm": "",
                "hex": ""
            },
            "txinwitness": [
                "3045022100f58be5c334fbdeb582a6bd2f106520316fe5f42e365748e5fac6c60527f43696022067753fc4664b5dea501baddeb59f267d833654358b1e7a8d82cfe406b92270c101",
                "02cd50ac8a15a5ebd7c211dd28792901a77fe9e60b5ebe84f1cc42e31c18235e2a"
            ],
            "sequence": 0
        }
    ],
    "vout": [
        {
            "value": 0.0001,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_HASH160 4c4ea881d3c7767e25718fcc93714627fd989ff3 OP_EQUAL",
                "hex": "a9144c4ea881d3c7767e25718fcc93714627fd989ff387",
                "address": "38eVWPirWs7j54Y8FtuHY9RZ3aXnMaEijY",
                "type": "scripthash",
                "addresses": [
                    "38eVWPirWs7j54Y8FtuHY9RZ3aXnMaEijY"
                ],
                "reqSigs": 1
            }
        },
        {
            "value": 0.00016763,
            "n": 1,
            "scriptPubKey": {
                "asm": "0 30910f8b05507355168cf8d9f5bbf35a85d16898",
                "hex": "001430910f8b05507355168cf8d9f5bbf35a85d16898",
                "address": "bc1qxzgslzc92pe4295vlrvltwlnt2zaz6ycvy8w3f",
                "type": "witness_v0_keyhash",
                "addresses": [
                    "bc1qxzgslzc92pe4295vlrvltwlnt2zaz6ycvy8w3f"
                ],
                "reqSigs": 1
            }
        }
    ]
}

Note that
    "locktime": 0,

AFAIK locktime determines the earliest a transaction can be included in a block, it doesn't guarantee the transaction gets included in a block at the specified time or at the specified height.


text:
Transaction malleability in Testnet
I want to replicate transaction malleability to study it.
I have two transactions data signed in testnet.
One it's the original,
0200000001abb6c7df544b53eec11612ab9d82ef0fe0a3aa2ff33f41bbf5f149986d80af47000000006a47304402207a325de81b063d3e28023a63c37c554e7eb136d94612334bbd6715a05abb684e02203a87c85819815bb12d4386fa76aa6b990c65158b61ccb05a14a249e14095663b012103bf7b2ddadda97523405400ae95be2cb153768cce8b1bed55d1c8aca4bb2ee16dffffffff02e8030000000000001976a914fd1002f92de062322225735e24b85590a3ef7af288ac29e31100000000001976a9146162f487e0b293054f1fb8025769f1e1f14d379b88ac00000000

The second one is the transaction "malleated".
0200000001abb6c7df544b53eec11612ab9d82ef0fe0a3aa2ff33f41bbf5f149986d80af47000000006c527547304402207a325de81b063d3e28023a63c37c554e7eb136d94612334bbd6715a05abb684e02203a87c85819815bb12d4386fa76aa6b990c65158b61ccb05a14a249e14095663b012103bf7b2ddadda97523405400ae95be2cb153768cce8b1bed55d1c8aca4bb2ee16dffffffff02e8030000000000001976a914fd1002f92de062322225735e24b85590a3ef7af288ac29e31100000000001976a9146162f487e0b293054f1fb8025769f1e1f14d379b88ac00000000

Before send the first one and after send the malleated transaction.
I receive txn-mempool-conflict (code 18)
I can't replicate the transaction malleability if the original is already in the mempool?
I'm using bitcoin-core 0.19.0.1

What malleability means is that you can create a transaction that is identical in its meaning (same inputs, same outputs) but with a different TXID. That is problematic for 2nd layer protocols where transactions build onto each other but aren't necessarily published to chain.
But a "malleated" transaction is still a double spend. And it appears newer versions  of bitcoin-core that support RBF won't accept double spends into their mempool.
See code snippet here: Validation Error: Error #-26: 258: txn-mempool-conflict

Thanks @guggero, Can I disable RBF in my node? I don't find any option

RBF (as specified in BIP125) only applies when you signature replacement. The problem is here that you don't do that, and as a result the replacement is not accepted.

This is unrelated to RBF. Double spends have never been accepted.


text:
Bitcoin confirmed but have not received anything
Transaction number 2f1271a411b296ee2fbc5941809cbf4d4718a0c564de4a437f505073a92da3b8
Why have my not received the Bitcoin

You probably have to wait for your node to sync i.e. download 200+GB of the blockchain. I suggest making a thread on https://reddit.com/r/bitcoinbeginners and posting a link here so we can help you further. Stack exchange is not suitable for a back and forth diagnoses session.


text:
Where is the QR code listed in Electrum 3.0.3
Quick question...Where can I get the QR code for Electrum 3.0.3
where is it stored? I looked at the different tabs but NO luck
Someone is trying to send me some coins and asked me for the QR code.
Where can I see this code? and are they maybe referring to the address of the wallet?
Clarity needed here, Help out please!
Thanks,

I assume you are talking about the QR code for an address in your wallet. If you go to the receive tab, you will see a receiving address filled in the Received address text box. Next to that, there's a QR code. That QR code is for your address.


text:
Calculate Z from r and s
Can anyone explain me any clearly answer or code in python with examples how we can calculate Z value from r and s and inputs outputs order ?? I search in google and youtube and i not saw any correctly answer i just see scam posts or video in youtube.
I tried different methods in python and i can’t get right results. 2coin.org is closed and I want to know how to calculate manually.
thank you in advance

z can be calculated more easily from the raw transaction.
To get z this way, you have to simply delete all the script signatures in the raw transaction. Then place the script_pubkey of the input you are trying to evaluate where the script_sig used to be. (in the case of a multi-signature transaction you have to replace the scriptSigs for the correspondent redeem script).
This has to be done for each input, so the raw transaction will contain no script_sigs at all, and only one script_pubkey (where the script_sig was for the input being evaluated).
Then, you have to append the type of sig_hash which is almost always SIGHASH_ALL at the end of the raw transaction. The sighash field has 4 bytes of length and SIGHASH_ALL has the code value of 1, which is represented by 01000000 in hexadecimal which is 1 in little endian.
After you empty all the script_sigs, and put the script_pubkey of the input being evaluated, and also append the 01000000 at the end of the raw transaction, you can procede to calculate the double SHA256 (HASH256) of the modified raw transaction. Check out https://en.bitcoin.it/wiki/OP_CHECKSIG.
The outcome of this hash will be interpreted as a big-endian integer, and that will be your z for the particular input.
You have to repeat this for every input, so there is a different z for each input.
To evaluate your signatures (r,s), you will have to use the mathematical formula of the ECDSA which is:
A)  uG + vP = R.
B)  kG = R.
where:
C)  u=z/s; v=r/s
G is the originating point of the secp256k1. https://en.bitcoin.it/wiki/Secp256k1
P is the point of the public key on the curve.
u and v are integer scalars and, therefore, uG and vP are points on the curve.
R is just another point in the curve as a result of the addition of the other 2 points uG and vP , and will be the point that will verify the signature.
If you already have r and s (as is implied from your question), and you already calculated z, then you can calculate u and v from the formulas in C. Once you get u and v, and since you have your Public key P and G is defined by the secp256k1, then you can procede to calculate R from formula A. Just remember that this addition happens on the curve which is also on a finite field.
Once you get R, you will extract the x coordinate of this point on the curve which has to be exactly the same as r from the signature. If they match, the signature is correct.
If you want some code to get z, here is a function from an excellent book called Programming Bitcoin by Jimmy Song :
def sig_hash(self, input_index):
    s = int_to_little_endian(self.version, 4)
    s += encode_varint(len(self.tx_ins))
    for i, tx_in in enumerate(self.tx_ins):
        if i == input_index:
            s += TxIn(
                prev_tx=tx_in.prev_tx,
                prev_index=tx_in.prev_index,
                script_sig=tx_in.script_pubkey(self.testnet),
                sequence=tx_in.sequence,
            ).serialize()
        else:
            s += TxIn(
                prev_tx=tx_in.prev_tx,
                prev_index=tx_in.prev_index,
                sequence=tx_in.sequence,
            ).serialize()
    s += encode_varint(len(self.tx_outs))
    for tx_out in self.tx_outs:
        s += tx_out.serialize()
    s += int_to_little_endian(self.locktime, 4)
    s += int_to_little_endian(SIGHASH_ALL, 4)
    h256 = hash256(s)
    return int.from_bytes(h256, 'big')

However, you will have to take into account that this is just for the basic case of a P2PKH. In a P2SH transaction you will have a small variation.


text:
Is there a way to determine the difference between a BTC prefix 3 address and a LTC prefix 3 address?
I am trying to determine if there is a way to tell the difference between a BTC prefix 3 address and a LTC prefix 3 address, for validation purpose.
Example if given this public key address:
3HpwVq6zSd3wxSrAypFYJGKE2JTm3fvuC9
Would there be a way to definitively say it is a BTC or LTC address?

Note that Litecoin changed their P2SH address format to reduce confusion; see https://bitcoin.stackexchange.com/questions/62781/litecoin-constants-and-prefixes

No, there is not. There isn't anything network specific about an address. Such addresses can be used on both Bitcoin and Litecoin. You could also spend both the Bitcoin and Litecoin associated with that address so long as you have the private key. Because Bitcoin and Litecoin use the same Elliptic Curve and the same scripting system, all you would need to do is to export the private key from one wallet and import it into the other.


text:
Bitcoin built with a newer Berkeley Database incompatible with a older wallet?
Is a Bitcoin client built with a newer Berkeley Database incompatible with a wallet file from a older client? Or is it that a wallet made from a newer Berkeley Database not compatible with an older client?
EDIT: What I'm trying to figure out... If I have a wallet from years ago and I import it into a newer client that was built with a different Berkeley database unknowingly would I have any issues?

You can always open a wallet.dat file created with an older BDB using software using a newer BDB. However, when doing so, the file will be upgraded and not be compatible anymore with the older BDB version that created it. This is even the case for minor version upgrades (4.7 vs 4.8 for example).
Bitcoin Core release binaries have used BDB 4.8 since release 0.4 (September 2011), but self-compiled versions or versions shipped with Linux distributions may use other BDB versions.

This is what I wondering. Thanks for answering. I just wanted to be sure that opening a file from years ago with a newer client wasn't going to break the wallet file.

Newer BerkeleyDB databases are not backwards compatible.
Details: https://github.com/bitcoin/bitcoin/issues/6253
https://github.com/bitcoin/bitcoin/issues/3686#issuecomment-74836708
Especially:

BDB is very painful to upgrade. My impression is that it was designed for setups where a database upgrade only happened with professional supervision. In particular, the write log files created for durability were sometimes not readable by later versions. This is the reason why Bitcoin Core releases have for years stuck with BDB 4.8 for the wallet.

https://bitcoin.stackexchange.com/a/51446

What I'm trying to figure out...  If I have a wallet from years ago and I import it into a newer client that was built with a different Berkeley database unknowingly would I have any issues?

I'd suggest creating a backup of the wallet. It might or might not work, it's impossible to know without experimenting. However, all (most? I'm sure that it is since 0.8.0, and 100% the same major release, 4) Bitcoin Core versions use the same version of Berkeley DB.

I use Arch Linux and I'm only now noticing the official package they have is built with the newest DB they have.  I may have deleted old wallets I thought were empty.   It did display a wallet address.

@RansuDoragon You can build Bitcoin Core from depends. It downloads the dependencies with preferred versions automatically using scripts. Here are the instructions: https://github.com/bitcoin/bitcoin/tree/master/depends


text:
Errors when building/sending multisig transactions
Going by the example here: https://bitcoinj.github.io/working-with-contracts
I believe I've done everything correctly.  Yet my program fails either to propagate correctly or because of a tx error and I cannot determine why
A few things I believe to be the reason
1) My peergroup.broadcastTransaction(spendTx) is not broadcasting properly
2) A malformed raw transaction or scriptsig ( I assume it is this, but again, no errors)
3) Generally not understanding the best method of linking outputs to inputs and signing them appropriately (for instance, do I use UTXO class, or TransactionSignature)
3) Trying to spend funds from a watched address.  I have the necessary keys to unlock the UTXO's but I would like to see if I can spend the funds without the use of the wallet class
4) Multisig support in general for bitcoinj is lacking or incomplete.  i hope it's not this as I would really like to get this working.  But -- I don't think this is the biggest issue because I ran the unit tests and they still all check out clean.
A step through the code to be thorough:
Create 3 ECKeys for a 2-of-3 multisig contract, put them into a list, create a redeem script that sorts keys in lexicographical order and writes a m-of-n multisigoutputscript, then instantiate a Transaction object and assign it as the OUTPUT that I will be using as my INPUT (amount + redeemscript) AKA the UTXO that I will be spending (EDIT: Quick mention.  The ECKeys I'm really using are hardcoded values that I made a while ago, these are for illustration purposes.  I also should mention that this is a P2SH multisig, not the raw non-standard multisig.
ECKey keyA = new ECKey();
ECKey keyB = new ECKey();
ECKey keyC = new ECKey();

List<ECKey> keys = ImmutableList.of(key1, key2, key3);

Script script = ScriptBuilder.createRedeemScript(2, keys);
Script scriptPubKey = ScriptBuilder.createP2SHOutputScript(script);

Transaction contract = new Transaction(params);
TransactionOutput multiSigOutput = contract.addOutput(Coin.valueOf(50000), scriptPubKey);

Create a second transaction object that I will be using to assemble the output script AKA the (value + destination) address that i will be signing my UTXO over to.  Also where the sigHash is signed by 2 of my keys and added to the scriptSig of the transaction
                        Transaction spendTx = new Transaction(params);
                        Address address = Address.fromBase58(params, "19EfMrs5WkcvtBBnuEqP6v1yppeWww61Kc");
                        Script outputScript = ScriptBuilder.createOutputScript(address);
                        spendTx.addOutput(multiSigOutput.getValue(), outputScript);
//                        System.out.println(spendTx.getOutputs());
                        TransactionInput input = spendTx.addInput(multiSigOutput);

now manually sign the inputs...(signatures are in same order as they are in script)
//sign transaction manually
Sha256Hash sigHash = spendTx.hashForSignature(0, script, Transaction.SigHash.ALL, false);
ECKey.ECDSASignature signature = list.get(0).sign(sigHash);
ECKey.ECDSASignature signature1 = list.get(1).sign(sigHash);
TransactionSignature txSig = new TransactionSignature(signature, Transaction.SigHash.ALL, false);
TransactionSignature txSig1 = new TransactionSignature(signature1, Transaction.SigHash.ALL, false);

...now create multisiginputscript, validate and broadcast tx
                        Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript((ImmutableList.of(txSig, txSig1)));
//                        System.out.println(inputScript);
                        input.setScriptSig(inputScript);
                        input.verify(multiSigOutput);

                        peerGroup.broadcastTransaction(spendTx);

                        System.out.println(kit.peerGroup().getConnectedPeers());
                        System.out.println("transaction broadcasted");

ok...this doesn't propagate, but the verification checks out. and I don't even know if it's so much a network problem as it is a code problem because when I change the value in the output script to > the balance of the UTXO it doesn't throw a InsufficientMoneyException like I imagine it should.  I'd show some error logs but there aren't any.  The only error is when I change the createmultisiginputscript to createP2SHmultisiginputscript, the console puts out a non-null nulldummy error which I also have problems fixing, so I've never been able to know if changing to that method is the correct fix either.  I think I set up the connection to the peergroup correctly as well
File chainFile = new File(this.getFilesDir(), "test.spvchain");
System.out.println("does chainfile exist?"  + chainFile.exists());
if(chainFile.exists()) {
    try {
        SPVBlockStore chainStore = new SPVBlockStore(params, chainFile);
        BlockChain chain = new BlockChain(params, chainStore);
        peerGroup = new PeerGroup(params, chain);
        peerGroup.addPeerDiscovery(new DnsDiscovery(params));
        peerGroup.startAsync();
    } catch (BlockStoreException e) {
        e.printStackTrace();
    }

So I don't really get it... I've come to the conclusion my understanding is off somehow.  Sorry for the confusing long post.  It's been days.  Can anyone help?
EDIT: Here's the raw transaction
In hex:
0100000001d917c0a19e19fa1cf2314baf037fdf952877daa4da845ab35d44ef33b45838c300000000fc00473044022022b97b9372d35acaea70f3735dee290f5697cab7b5d6be6f7cdfe31139fba4f90220651091b83570843d4fe8afe02d81417194908b0f6af6f8f3b8f1ad020592409f01473044022036eff4f54b8bf3f834f7bb6e417a04a6a696047f5c75a896c6f9b624ad87680a02200bf2115b64b3b15647178b69151d4588d8a4ade16a4d66e375d0e1265c79fad6014c695221025ab78e076801b45ccb2172bce562103cce1714edbeb02ce6123ce1235eb08c762102d1b74577050b696d5886a7afa61d099ea7ab0a3797766f9819dbd72526b0ce512103facf04db5d9bee657151e30c21e839489c326a277891ebcf75b736ec1e17fc1f53aeffffffff0150c30000000000001976a9145a566f4eda18e818b8d5ca04ee7c5fa3cfbf0e0088ac00000000
In logs:
fbb119d8990cd3912a9ec0118fe3ad8ad61a8388e4a13dd342d9eb67aacfdc65

01-12 17:49:20.670 2507-2507/com.cryptoapp.app I/System.out:      in   0[] PUSHDATA(71)[3044022022b97b9372d35acaea70f3735dee290f5697cab7b5d6be6f7cdfe31139fba4f90220651091b83570843d4fe8afe02d81417194908b0f6af6f8f3b8f1ad020592409f01] PUSHDATA(71)[3044022036eff4f54b8bf3f834f7bb6e417a04a6a696047f5c75a896c6f9b624ad87680a02200bf2115b64b3b15647178b69151d4588d8a4ade16a4d66e375d0e1265c79fad601] PUSHDATA1[5221025ab78e076801b45ccb2172bce562103cce1714edbeb02ce6123ce1235eb08c762102d1b74577050b696d5886a7afa61d099ea7ab0a3797766f9819dbd72526b0ce512103facf04db5d9bee657151e30c21e839489c326a277891ebcf75b736ec1e17fc1f53ae] 0.0005 BTC
01-12 17:49:20.670 2507-2507/com.cryptoapp.app I/System.out:           outpoint:c33858b433ef445db35a84daa4da772895df7f03af4b31f21cfa199ea1c017d9:0 hash160:6d49586d7529626aaab49812bcd7839aee7e5800
01-12 17:49:20.670 2507-2507/com.cryptoapp.app I/System.out:      out  DUP HASH160 PUSHDATA(20)[5a566f4eda18e818b8d5ca04ee7c5fa3cfbf0e00] EQUALVERIFY CHECKSIG 0.0005 BTC
01-12 17:49:20.670 2507-2507/com.cryptoapp.app I/System.out:      fee  0.00 BTC/kB, 0.00 BTC for 337 bytes
01-12 17:49:20.670 2507-2507/com.cryptoapp.app I/System.out:      prps UNKNOWN

A couple comments from inspecting the Transaction data you posted.
1) I checked the UTXO you are spending from, which is UTXO

9e7562d19165077d566af47bfbc18283629ed6799da8862660dfb037c353de11
Index 0

However, your transaction input is currently referencing the following UTXO:

c33858b433ef445db35a84daa4da772895df7f03af4b31f21cfa199ea1c017d9
Index 0

Which is not a confirmed transaction on main net.
2) Your input script seems properly formed to spend your P2SH(Multisig) output:

zero
[3044022022b97b9372d35acaea70f3735dee290f5697cab7b5d6be6f7cdfe31139fba4f90220651091b83570843d4fe8afe02d81417194908b0f6af6f8f3b8f1ad020592409f01]
[3044022036eff4f54b8bf3f834f7bb6e417a04a6a696047f5c75a896c6f9b624ad87680a02200bf2115b64b3b15647178b69151d4588d8a4ade16a4d66e375d0e1265c79fad601]
[2 [025ab78e076801b45ccb2172bce562103cce1714edbeb02ce6123ce1235eb08c76] [02d1b74577050b696d5886a7afa61d099ea7ab0a3797766f9819dbd72526b0ce51] [03facf04db5d9bee657151e30c21e839489c326a277891ebcf75b736ec1e17fc1f] 3 checkmultisig]

The final element is the embedded script, and should hash to the 20B digest in your UTXO you are spending: it does indeed hash160 correctly to 6d49586d7529626aaab49812bcd7839aee7e5800.
For your reference the P2SH(Multisig) output script of your UTXO is: "hash160 [6d49586d7529626aaab49812bcd7839aee7e5800] equal", note that the hashes are the same, so that's good.
3) You haven't included a fee in your transaction. The output amount of 50000 sats is identical to the UTXO amount. There needs to be a minimum fee for this transaction to be accepted by the mempool.
I hope this helps.

Thanks for your comment.  It does verify.  If it did not it would throw an error.

Script script = ScriptBuilder.createRedeemScript(2, keys); and Script script = ScriptBuilder.createMultiSigOutputScript(2, keys); are the same thing except createRedeemScript puts the keys in lexicographical order but it returns the same function

Can u post both raw tx here, would be easier to help debug.

Ah ok. So u still need to confirm the first tx before broadcasting the second.

So I'm a little bit confused.  I thought the first tx was an output script which creates the template for the UTXO as context for the second transaction(and the verification).  So you're saying I have to broadcast where i created the multisig script and then broadcast the spend as well?

Yes. Your spending script has nothing to spend: You generate new keys at the beginning of your script, so that means there is no multisig output in the blockchain yet that u are can spend with those keys. Only after this tx with the multisig output is mined, can it be spent. However, your first multisig tx would also need an input, otherwise we would be creating Bitcoin out of thin air.

Oh I get the confusion.  Those ECKeys keys are actually a template to the real keys I am using.  There's already a UTXO at my real address here: https://www.blockchain.com/btc/address/3BesSajTyegQaBeyJXes6kyav3srZC3p7D  So I'm trying to get that output and spend it with the same keys/script I used to create that P2SH address.  I just didn't want to expose them here.  Sorry for the mix up.  I'll try to change it to be less ambiguous

Ok, so you didn't mention the P2SH wrapper above. If that's a P2SH wrapped Multisig you are spending, you are not recreating the P2SH wrapper in your output template above, just the raw multisig, and also not a P2SH redeem script in your spending input.

Ok.  Thanks.  I tried using a P2SHredeemscript in my spending input but it throws a "non-null nulldummy" error using bitcoinj 0.14.7.  Thanks for that tip though.  I figured I needed to add an OP_0 code to the top of the stack but that didn't seem to work by itself.  I'll play with it some more.  Please let me know of anything else that might be wrong.

Post edited for clarification hopefully

Also make sure that you construct your first template TX exactly as the one that is mined. That is, it must have the exact same in/outputs. This is because the second TX references this first TX by TXID, which is a Bitcoin256 hash of the full TX data serialisation. If you omit inputs or anything else in your first transaction (compared to the TX which is already confirmed), the second transaction will be referencing the wrong TXID.

Great. I appreciate your help sir.  Can I email you for some slight clarification?

Generally speaking yes, but it might be better to keep the discussion related to this question public in this forum for others to view and validate as well. You can always revise your question or post a reformulated one and I will be happy to help where I can.

Hi, I've migrated both of my input and output functions to match the P2SH format of the original UTXO (updated post to show).  I'm still getting the same silent fail however, although everything seems to match up.  Now I'm not sure what could possibly be the issue other than it not broadcasting to the peer network

Can u post raw tx’s?

Hey.  I edited my post to include the raw tx in hex and the way it appears in my console

ahh.  okay.  After using the blockcypher transaction decoder https://live.blockcypher.com/btc/decodetx/ and putting in my raw transaction hex from the above post...I think I have compiled a malformed transaction.  Hmm

I edited the answer above to point out several observations made from inspecting your posted transaction.

Yes.  Thank you. I've been trying to change that outpoint for the better part of a day now.  I have no idea why it's referring to that transaction id

Thank you so much.  I fixed the issue by writing in my own outpoint because I have no idea why the library seemed to change my txid for no reason.  I'll be writing a bug report

Awesome! Do could u mark the answer (check) if it helped u solve ur question? Much appreciated.

I would love to but i do not have enough rep to mark an answer as accepted.  I don't know why they add that limit but once I get enough rep I will be happy to

No worries, just a nice-to-have. As long as you got the answer you needed and can continue with your project, everybody is happy.

Sir, I just saw that you were the instructor for teachbitcoin.io.  No reason to post this I just thought it was cool since I had that site bookmarked

Cheers Stephen, happy that you are working on Bitcoin :)

@Stephen: I think there is a misunderstanding here. You cannot upvote a post until you have some rep, but you can always mark answers to your question as the most helpful answer. I think you may have tried to click the "up arrow" which is to upvote a post. Try to click the "checkmark" instead!


text:
How does copying main stack prevent malformed unlocking scripts vulnerabilities?
https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch06.asciidoc

In the original bitcoin client, the unlocking and locking scripts were
  concatenated and executed in sequence. For security reasons, this was
  changed in 2010, because of a vulnerability that allowed a malformed
  unlocking script to push data onto the stack and corrupt the locking
  script. In the current implementation, the scripts are executed
  separately with the stack transferred between the two executions, as
  described next.
First, the unlocking script is executed, using the stack execution
  engine. If the unlocking script is executed without errors (e.g., it
  has no "dangling" operators left over), the main stack is copied and
  the locking script is executed. If the result of executing the locking
  script with the stack data copied from the unlocking script is "TRUE,"
  the unlocking script has succeeded in resolving the conditions imposed
  by the locking script and, therefore, the input is a valid
  authorization to spend the UTXO.

In this chapter, Andreas states that due to a bug with malformed unlocking scripts, the scripts are now executed separately.
Here is my understanding:
The unlocking script is first executed on the main stack.
If the unlocking script is valid, the entire stack is copied and the locking script is then executed.
Is there a reason why the stack is not copied to an alternate stack and then the unlocking script is executed on the alt stack? This way, if the unlocking script is malformed, it would not corrupt the rest of the main stack.

you can find explanation here:
https://bitcointalk.org/index.php?topic=5095376.msg49150302#msg49150302

the issue was actually with OP_RETURN. What OP_RETURN used to do is it would skip to the end of the script so whatever was on the stack was interpreted for the final script result. So what you could do was create a scriptSig that was just

OP_TRUE OP_RETURN

which would push true to the stack and skip the rest of the script (which included the scriptPubKey at this time). The interpreter would see that at the end of script execution a true was left on the stack so it would say that the script passed. Obviously this is bad because the nothing in the scriptPubKey was evaluated so none of the spending conditions were actually met.
In fixing this bug, Satoshi disabled many other opcodes, changed OP_RETURN to always cause script execution to fail, and separated the execution of the scriptSig and the scriptPubKey so that the scriptPubKey is always executed.

I don't think that this is correct.  At the point when the change to separate scriptSig and scriptPubKey execution OP_RETURN was already returning a false, causing the execution to fail.

Actually, version 0.3.6 changed the behavior of OP_RETURN and version 0.3.7 had script execution change.  Granted, the two versions are two days apart from each other and there is a single commit in between which is only a docs and build system change

I think Liu is correct. Before the upgrade for input and output script runs to be 2 consecutive runs (where the 2nd run inherits the stack state of the 1st), they were effectively concatenated and evaluated as a single script run. In such a case, a data push or op_return would relegate the output script to data.

But what I'm saying is, it seems that there was no way to abuse op_return at the time when the change was done to execute scriptsig and scriptpubkey separately.  op_return was already returning false at that point so prepending it would not help.  A PUSHDATA op along with the size of the scriptpubkey seems like it would though!  Though this is not the part that is quoted.


text:
Help recovering funds: Wallet created with non-standard public key format (no 02/03/04 prefix)
Title: Help recovering funds: Wallet created with non-standard public key format (no 02/03/04 prefix)
I have a Bitcoin address (19CLgD8MqfWzE3BzzUGjyXKM4EP72XgYJ8) containing ~0.064 BTC that was created using a non-standard public key format. I can cryptographically prove ownership but can't create a valid transaction due to the format issue.
Technical details:

Public key (raw bytes, no prefix): 1f6483705a513b4d81fca6369b6bfca80c9c103eb57dbda575b94b8127727aba8c0019d4f08d49187ead5294d641f35a419e14c8783bb1436ae06f4969c93108
Address: 19CLgD8MqfWzE3BzzUGjyXKM4EP72XgYJ8

The wallet was created using this Python script:
from ecdsa import SigningKey, SECP256k1
public_key = SigningKey.from_string(bytes.fromhex(private_key_hex), curve=SECP256k1).get_verifying_key()
public_key_bytes = public_key.to_string()  # Used raw bytes without standard Bitcoin prefix

I can generate the correct address (verified on blockchain), but can't create valid transactions because:
The public key lacks the standard 02/03 (compressed) or 04 (uncompressed) prefix
Attempts to import to standard wallets fail
Raw transaction creation fails with "mandatory-script-verify-flag-failed (Public key is neither compressed or uncompressed)"
I've tried:
Converting to WIF format (doesn't maintain correct public key format)
Using older Bitcoin Core versions
Creating raw transactions maintaining original format
Various public key format conversions
Is there any way to create a valid transaction that modern nodes will accept using this non-standard public key format?

Is there any way to create a valid transaction that modern nodes will accept using this non-standard public key format?

No. The consensus rules for public keys require that they follow the specific format. If the pubkey does not follow that format, then it will not be recognized as a pubkey and therefore validation will fail. Since your pubkey does not follow that format, it is not possible to create a valid transaction that spends the outputs.
Those coins are unspendable, sorry for your loss.


text:
How Bitcoin Core calculate extended private masterkey from hdseed
I am testing a Bitcoin application, and to test the signing of transactions I use regtest with Bitcoin Core. But I have some problems, the first I have already published in a question that I still have no convenient answer.
But the problem generated by this new question is:
If a Bitcoin Core wallet can be saved and loaded with just the hdseed, then the extended private masterkey is calculated from it. Then, how Bitcoin Core calculate that?
Thanks in advance

Conversion from a HD seed to a master private key is specified by BIP 32.
It is done by computing a HMAC-SHA512 where the key is the text Bitcoin seed and the data is the HD seed itself. The first 32 bytes (256 bits) is the master private key. The last 32 byte is the chaincode for the master key.


text:
Bitcoin P2P API getBlocks always returns 500 inv items
I'm trying to build a mini full node so that I can understand exactly how they operate. I've managed to get a few parts of the P2P api working however I am stuck with basic things like 'getblocks' and 'getheaders'
For example I have the following block hashes I am interested in:
block_hash = "000000000000592589e55cda6e8a093998e8356ea770d4aaeb7c0f5439b147d7"
block_stop = "000000000000017a09017d52db538d7a9ddcc48311866d7e5fdbbbec7d0faad5"

Command: getblocks
Request: 0b110907676574626c6f636b73000000450000002a0af9950100000001000000000000592589e55cda6e8a093998e8356ea770d4aaeb7c0f5439b147d7000000000000017a09017d52db538d7a9ddcc48311866d7e5fdbbbec7d0faad5

My question is: Why am I getting back 500 inv items when the stop hash is only 1 block away from the block locator ? (Btw the same thing happens to me when I'm using getheaders instead of getblocks)
EDIT
Ok so I have swapped the endian-ness of the data I'm sending. I also had to swap the block locator and stop around in order to get a response (so the stop hash is at a block height lower than the locator) which makes me feel like I'm making more mistakes here.
When doing this I still receive 500 inv on the example above, however if I use these two instead:
block_stop = "0000000000000049a7ce260de7fcf63f34acf3fe1c5b2040ae77b9bdaf1abb38"
block_hash = "000000000000013d8a77f222805b1dca31d0fb48d60b29098c77609de5f93811

ACTUAL MESSAGE: 0b110907676574626c6f636b7300000045000000a83c12f901000000011138f9e59d60778c09290bd648fbd031ca1d5b8022f2778a3d0100000000000038bb1aafbdb977ae40205b1cfef3ac343ff6fce70d26cea74900000000000000

it correctly returns from the height I require, however it returns all of the blocks until the latest block instead of the one that I'm after. Am I misunderstanding the point of this API ? I was under the impression it returns block details but instead it just returns missing block hashes. How do I then find out what transactions happened in that block?

It looks like you have your block hashes in the wrong byte order. You have them in the display byte order, but the network actually handles block hashes in the reverse byte order, the zeroes are at the end.
I think the blocks that you are getting in response are going to be the first 500 blocks of the blockchain as well.

So what's happening is that a node sees your start hash, does not find it in your blockchain so it starts with the genesis block. It keeps going for each block and finds that it does not find the stop hash. This would be both because the stop hash is in the wrong byte order, and because it is starting from genesis and not your start hash.
So the response you get is the maximum of 500 blocks starting from the genesis block - the most recent common ancestor between your start hash and it's current tip.

Am I misunderstanding the point of this API ? I was under the impression it returns block details but instead it just returns missing block hashes. How do I then find out what transactions happened in that block?

getblocks gets the block hashes. To get actual block itself, you need to use getdata with the hashes you've received.


text:
How to Install bitcoind 0.7.2 Server on Ubuntu for bitcoin-testnet-box
I am trying to setup a private test net with the source at:
https://github.com/freewil/bitcoin-testnet-box
However, it requires bitcoind 0.7.2 (the latest version is 0.8.0).
I tried installing 0.7.2 with the following:
wget http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.7.2/bitcoin-0.7.2-linux.tar.gz/download

but then get the following errors when I install:
sudo dpkg -i bitcoind_0.7.2-3_amd64.deb

Selecting previously unselected package bitcoind.
(Reading database ... 65728 files and directories currently installed.)
Unpacking bitcoind (from bitcoind_0.7.2-3_amd64.deb) ...
dpkg: dependency problems prevent configuration of bitcoind:
 bitcoind depends on libboost-filesystem1.49.0 (>= 1.49.0-1); however:
  Package libboost-filesystem1.49.0 is not installed.
 bitcoind depends on libboost-program-options1.49.0 (>= 1.49.0-1); however:
  Package libboost-program-options1.49.0 is not installed.
 bitcoind depends on libboost-system1.49.0 (>= 1.49.0-1); however:
  Package libboost-system1.49.0 is not installed.
 bitcoind depends on libboost-thread1.49.0 (>= 1.49.0-1); however:
  Package libboost-thread1.49.0 is not installed.
 bitcoind depends on libdb5.1++; however:
  Package libdb5.1++ is not installed.
dpkg: error processing bitcoind (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 bitcoind

Following with
sudo apt-get -f install

Still gives these errors:
dpkg: dependency problems prevent configuration of bitcoind:
 bitcoind depends on libboost-filesystem1.49.0 (>= 1.49.0-1); however:
  Package libboost-filesystem1.49.0 is not installed.
 bitcoind depends on libboost-program-options1.49.0 (>= 1.49.0-1); however:
  Package libboost-program-options1.49.0 is not installed.
 bitcoind depends on libboost-system1.49.0 (>= 1.49.0-1); however:
  Package libboost-system1.49.0 is not installed.
 bitcoind depends on libboost-thread1.49.0 (>= 1.49.0-1); however:
  Package libboost-thread1.49.0 is not installed.
 bitcoind depends on libdb5.1++; however:
  Package libdb5.1++ is not installed.
dpkg: error processing bitcoind (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 bitcoind

I can't seem to figure out how to install these packages with apt-get even though they are listed here:
http://packages.ubuntu.com/quantal-updates/libboost-filesystem1.49.0
Edit: This may be of help, though I haven't gotten it completely working yet:
http://askubuntu.com/questions/168053/how-to-install-all-the-boost-development-libraries

Zen, it looks like linebreaks are missing from the first error message. Is that the correct message?

Fixed it. I guess it needed to be copied and pasted as code. Still the same error message though.


text:
Can Ethereum support compressed secp256k1 public keys to compute Keccak addresses?
Starting from a private key, a working functional example provides details for how an Ethereum address can be calculated from an uncompressed secp256k1 elliptic curve public key. This functional example made it clear the computation of an Ethereum address had to use the proper Keccak hashing function, quite different from the NIST SHA3 implementation. Was wondering if Ethereum supports compressed secp256k1 public keys, if so are there any test vectors for testing implementations?

Uncompressed Address Synthesis: % echo b205a1e03ddf50247d8483435cd91f9c732bad281ad420061ab4310c33166276 | bx ec-to-public -u
046cb84859e85b1d9a27e060fdede38bb818c93850fb6e42d9c7e4bd879f8b9153fd94ed48e1f63312dce58f4d778ff45a2e5abb08a39c1bc0241139f5e54de7df

% ./kec -x -256 6cb84859e85b1d9a27e060fdede38bb818c93850fb6e42d9c7e4bd879f8b9153fd94ed48e1f63312dce58f4d778ff45a2e5abb08a39c1bc0241139f5e54de7df
787EC5A5313A976F7BDF9EEDAFDEFC1937AE294C3BD55386A8B9775539D81653

Hypothesized Compressed Address Synthesis: % echo b205a1e03ddf50247d8483435cd91f9c732bad281ad420061ab4310c33166276 | bx ec-to-public
036cb84859e85b1d9a27e060fdede38bb818c93850fb6e42d9c7e4bd879f8b9153

% ./kec -x -256 6cb84859e85b1d9a27e060fdede38bb818c93850fb6e42d9c7e4bd879f8b9153
78389290CA1CDEE2ADC06DF05477163B24B75D3AE4714F48E76C144F4766CDE7

Since the public addresses above are not encoded, it does not appear there is a means to determine if the Ethereum key is uncompressed or compressed. This makes me think all Ethereum public addresses must be derived only from uncompressed addresses.

authors: Бодя Бондаренко


text:
Tie Breaking in bitcoin transaction

If two nodes broadcast different versions of the next block simultaneously , some nodes may receive one or the other first. In that case, they work on the first one they received but save the other branch in case it becomes longer. The tie will be broken when the next proof-of-work is found and one branch becomes longer;

I got this information from the original publication about Bitcoin. But how long is this second branch saved in memory pool of nodes? How is this conflict resolved actually? Is there any paper mentioning this?

Most difficult (highest) chain wins. Side chains are stored forever just in case they become valid again.

Isn't the storing of the side chains implementation depndent?

@placeybordeaux The storing of the side chains are implementation dependent. The protocol can't enforce you to store or not side chains.


text:
How to exploit the possibilites of blockchain for proof of authorship?
I want to to create some kind of Proof-of-Authorship mechanism, that's something that many artists had asked before: How can I prove authorship of my work
To accomplish my objective I need to deal with 2 problems:

first, how to precisely and uniquely define a work, and
second, use something like a public ledger to store and validate that information.

I will think about first later; it's a very complex problem; I want to know if I could use the blockchain for the second one. (If you can give me some suggestions for the first problem they will be appreciated too.)

It already exists: http://www.proofofexistence.com/

If expressing the (artistic) work in any kind of document (be it sheets, photos or audio/video recording) is good enough, then you can use something called proof of existence. This simple method allows you to store a hash of any document into the Blockchain, thus proving it existed at the time when a particular block was mined.
You can indlude the autor's name (or other identifier) into the document, making it clear that he (at least) knew about it back then. If nobody proves the possesion/familiarity with that particular file/work dated before, the author should be able to claim his rights.
One (perhaps the first) proof-of-existence service is proofofexistence.com.

Mmmh, so there was already a possibility there, but don't seems so popular, I have been in the Crypto-world for a long time and never heard about that. Maybe I will try to promote it or create similar improved system. Thanks for the info

There is now a service called ascribe. It combines blockchain hashes for verification with a website for browsing.


text:
SignRawTransaction - What is scriptPubKey and redeemScript? [SOLVED]
Let me talk about how I got to the situation I'm in right now. I am using PHP and the JSON library to control bitcoind. And doing so.....
I created a multisignature address requiring 2 of 3 signatures with createmultisig.
I then sent funds to the multisignature address and was able to confirm the transactions sent to this address with using getrawtransaction and decoderawtransaction.
Next, I wanted to release those funds to a specific address (because I control all the keys, this is just a test run)
So I created a raw transaction in which I entered the transaction ID that I used for one of the transactions to send funds to the multisignature wallet. I also added the desired address and amount. After this, it spit out a raw transaction hex.
My next step is to sign the raw transaction. This is where I am stuck.
The parameters for signrawtransaction are confusing to me, and I need it explained to me as if I was 5 years old.

hexstring - assuming this is the hex string that createrawtransaction spit out
transaction id - is this the transaction id from when I transferred in the amount to the multisig wallet?
scriptPubKey - no idea what this is
redeemScript - no idea what this is

I grabbed scriptPubKey and redeemScript from the transaction I used to transfer funds into the multisig wallet, but the resulting output was the exact input of the hex string, so it is obviously not signing it correctly. I am not sure what these 2 paramters are.
Can somebody please help me with this. I need it explained to me like I am retarded because none of the explanations I have read online have helped.
Thanks.
EDIT to RE: Jonathan
Here is what I have done so far.
1) Created a multisig address using 3 public keys that I generated.
I took note of the private keys as well, and the outputted multisig address (ABC) and redeemScript (redeem1)
2) Sent coins to the multisig address and by searching through the blockchain found that the transactions exist. I had multiple transaction IDs, to send to this address but I am focusing on one that I am trying to use as an output. We will call it (txid1). In txid1, when I called getrawtransaction, it also had a 46 byte hexed pubkey attached to the output, I will call that (pubkey1)
3) Next I created a raw transaction which included the paramters;
txid1, vout=0, address (address to spend to) and amount (matches the same amount transferred to the multsig address with txid1) and it spits out a hexstring, which I will call (hex1)
4) SignRawTransaction - here is where I am stuck.
The parameters it asks for are;
 [{"txid":txid,"vout":n,"scriptPubKey":hex, "redeemScript":hex},...] [,...]
So I am inputting signrawtransaction(hex1, ["txid"=>txid1, "vout"=>0, "scriptPubKey"=>pubkey1, "redeemScript"=>redeem1, array(oneofmyprivatekeys))
But the resulting output is just the hex1, without a single change to it. I am not getting any error messages, just an outputed string identical to hex1.
Can you give me an idea of what I am doing wrong? Thank you so much!

The issue is that I was using the wrong redeem script.
I had created two muli-signature addresses with similar names and got them mixed up

StackExchange is not a forum, please do not add "[SOLVED]" "tags" to question titles. See the [help] entries for when someone answers and/or for self answering.

First of all, take a look at https://gist.github.com/gavinandresen/3966071.  That's a script that creates two raw transactions: one to fund a multisig address, and another to spend the funds.  It shows each of the steps necessary to create and spend from a multisig address.  Unfortunately, the script doesn't do a good job of explaining where the parameters come from.  I'll try to explain the parameters you need.
As you guessed, hexstring is the output from createrawtransaction, and transaction id is the ID of the transaction that sent the coins to the multisig address.  redeemScript is easy.  When you first generated the multisig address, the command returned both the address and the redeemScript.  If you don't have that value, you can recreate the multisig address with the same public keys and you'll see it in the output.  scriptPubKey is the one I'm not sure about.  I think I know what it is, but I don't have bitcoind in front of me so I can't be sure.  If you decode the raw transaction that send coins to the multisig address, you'll see one or two outputs, one of which sends coins to the multisig address.  (The other output sends the rest of the coins to a change address.)  There will be a scriptPubKey section in that output.  Copy the hex string from that section and use it as the scriptPubKey parameter.
Once you have those parameters, you can sign the raw transaction and send it.  If it doesn't work, leave a comment here and I'll try to work it out when I get home.

thank you for clarifying, I edited the original post to clarify the steps I have taken and while I was using the wrong redeemScript, I am still not getting the desired output.