Send bitcoins using just a pub and private key

If I install the bitcoin command line client for linux, can I use just a public and private key to send coins from an address? I don’t want to add it to my wallet file, I just want to move coins out of an address.


Update: After reading some of the answers I realize that I should have been more clear about my purposes. This is for more of a computer controlled money system. I want to be able to create addresses, and move money between them, and be able to move money out of addresses to other public addresses. I wanted it to be super light weight and not have to download the whole block-chain to achieve anything, and I don’t want it to use wallets because they don’t conform very well to what I am doing.

I want to be able to be given a private key and public address of a source, and a public address of a destination, to be able to send coins from one to another, and do it by just sending a message to the network. I want to be able to do it with only 10-20 MB of storage, and be able to do it by only connecting to a few nodes. Confirmations & balances will just be handled by hitting up some public resource like blockchain explorer.

Note: if it is not possible to do without the blockchain handy, then that can be accommodated for (though it throws in the need for a server for me rather than being purely client based.).

Can you send bitcoins together from the same wallet if they have been received via various different addresses?

What has been sent to your individual bitcoin addresses is supposedly recorded in the blockchain, but can you then send all of the combined bitcoins (that you received via various different addresses) at once with your public key? For example, if I received 1 bitcoin via address 1, 2 via address 2 and 5 via address 3, all of these addresses being derived from the same public key, and I wanted to send 6 btc to a friend, could I send all of them at once with my public key? Or would I have to send a combination of bitcoins from different addresses, i.e. by separate transactions? And if I could send them all together using the public key, how is it determined that I am in possession of all of these bitcoins if they were sent not directly to my public key, but to various irreversibly hashed addresses derived from my public key?

How does one lock their own Bitcoins for X amount of blocks and prove that you locked it?

Is there a method of locking Bitcoins for X amount of blocks and also being able to prove its locked? How would one do this and with what wallet? Mobile wallet possible?

Reason why is I’d imagine one can build some interesting applications for this if you can PROVE you locked the coins for X amount of time. What if there was some type of bounty reward paid if X amount of bitcoins was locked for say 1-5 years?

can i ever regain my lost bitcoins?

Even if you don’t know Bitcoin from blockchain, it’s likely you’ve heard something about cryptocurrencies. Also known as virtual currencies, digital assets such as Bitcoin, Ether and hundreds more are a hot commodity in online trading, and it’s possible for a smart investor to make a big profit. But the prospect of quick riches can blind some people to the risks and enable crooks to lure them into scams.

What is cryptocurrency? According to the U.S. Commodity Futures Trading Commission (CFTC), it’s a digital representation of value that isn’t backed by any government or central bank. Even so, this virtual money can be used to make purchases, and it can be exchanged for U.S. dollars or other conventional currencies.

But unlike government-backed money, a virtual currency’s value is driven entirely by supply and demand. That can create wild swings that produce big gains for investors, or big losses. And cryptocurrency investments are subject to far less regulatory protection than traditional financial products like stocks, bonds and mutual funds. (The CFTC does oversee virtual currency options and futures contracts, because it considers digital money to be a tradable commodity. The Securities and Exchange Commission has called for applying securities law to cover cryptocurrency exchanges.)

For all virtual currency’s high-tech gloss, many of the related scams are just newfangled versions of classic frauds. The CFTC has warned about “pump and dump” scammers who use messaging apps and chat rooms to plant rumors that a famous business mogul is pouring millions of dollars into a certain digital currency, or that a major retailer, bank or credit card company is going to partner with it. Once they’ve lured investors to buy and driven up the price, the scammers sell their stake and the currency plummets in value.

recently a friend was involved in this scam, he invested 50000USD after been convinced to do so in a certain commodity only for it to dip after doing so, it was his life savings, i suggested a certain global capital retriever to him, through the process of assets mapping, they effectively and successfully initiate chargebacks by leveraging the intelligence that we have collected on the company and the company bank accounts. hopefully this helps someone out there that has already been scammed, theres still a silver linning their skype contact is Gcapitalretriever and electronic mail is Gcapitalretriever @ outlook . com

Python – Querying bitcoin’s block header using leveldb

I am facing a stupid problem. I am trying to read bitcoin/blocks/index leveldb using plyvel. I’ve set up a regtest and i know there is a block with the hash :

27ce8199dee22f96e4f392dec29ef207fcd8a3c9e43b7d58cb40a5ba01af674b 

I am trying to query it using plyvel.

Note that I already read the topics :

How does Bitcoin read from/write to LevelDB

What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?

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

Then, I know I have to swap the endianness so it becomes :

MYVAR = "4b67af01baa540cb587d3be4c9a3d8fc07f29ec2de92f3e4962fe2de9981ce27" 

Thus, I should query something like :

b + (byte) MYVAR  

However I do not get how. I guess I missunderstand something in encoding. I tried :

db.get(b'b4b67af01baa540cb587d3be4c9a3d8fc07f29ec2de92f3e4962fe2de9981ce27') db.get(b'b'+b'4b67af01baa540cb587d3be4c9a3d8fc07f29ec2de92f3e4962fe2de9981ce27') 

..

Then, I opened the bitcoin/blocks/index leveldb using a gui explorer and I noticed the key for this block is :

\x62\x4b\x67\xaf\x01\xba\xa5\x40\xcb\x58\x7d\x3b\xe4\xc9\xa3\xd8\xfc\x07\xf2\x9e\xc2\xde\x92\xf3\xe4\x96\x2f\xe2\xde\x99\x81\xce\x27 

which is \x62 corresponding to the “b” + the hash with \x (escaping caracter ? I know here is my misunderstanding on hex encoding)

and obviously

db.get(b'\x62\x4b\x67\xaf\x01\xba\xa5\x40\xcb\x58\x7d\x3b\xe4\xc9\xa3\xd8\xfc\x07\xf2\x9e\xc2\xde\x92\xf3\xe4\x96\x2f\xe2\xde\x99\x81\xce\x27') 

perfectly works

I also tried these methods :

https://stackoverflow.com/questions/5649407/hexadecimal-string-to-byte-array-in-python

No one of them works and I really don’t get why :

bytes.fromhex(hash) bytearray.fromhex(hash) 

Thank you in advance

How to change Bitcoin’s proof of work? Then enable miner

I’m using https://github.com/jgarzik/pyminer/blob/master/pyminer.py to test a few different hash functions. Instead, I’d like to try keccak, a few of them in some order like an “X5” and so on.

This is a toy project to try and change the proof of work in Bitcoin and recompile and test, either an old version < 0.10.0 since getwork() might be easier to test with, or the latest release – apparently bitcoin-cli can mine blocks if starting from a new genesis block and the difficulty is set so low that a CPU can mine as much as you like.

My problem is that I can’t find in Bitcoin Core where the proof of work is. I’ve looked in pow and validation files for near a week now, but no luck so far, or I just can’t see it for some reason.

I thought it might have been obvious in miner.cpp which I think is no longer used (but might be able to be enabled?), and the best I can find is CheckProofOfWork in pow.cpp.

It doesn’t seem to check whether the PoW is sha256d. Does it? I must be missing something. So it looks like I can just change the miner code and submit a proof of work and if it meets the requirements, it will be accepted.

Is there a reasonably easy way to use a toy miner, change the PoW algorithm, and modify Bitcoin Core if necessary to try a different proof of work?

What is Bitcoin’s “genesis hash”?

From Lightning Network documentation:

Used in several of the BOLT documents to denote the genesis hash of a target blockchain. This allows nodes to create and reference channels on several blockchains. Nodes are to ignore any messages that reference a chain_hash that are unknown to them. Unlike bitcoin-cli, the hash is not reversed but is used directly.

For the main chain Bitcoin blockchain, the chain_hash value MUST be (encoded in hex): 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000.

However this wiki entry about Bitcoin’s genesis block has

GetHash() = 0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

Indeed, inputting the latter value into blockchain.info yields Block 0, while the former value cannot be found on blockchain.info.

Why does the value 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 appear in Lightning Network as “Bitcoin’s genesis hash”?