Sending bitcoins using only public and private key
When using the Bitcoin Command Line Client (BCC) on Linux, you can only use public and private keys to send coins from an address. This requires some basic understanding of the Bitcoin blockchain structure and cryptography.
What is a public key and a private key?
In Bitcoin, each user has a unique pair of keys:
- Public Key: 65-character string used for transactions (e.g.
m/0/C/x/p/0/y/0/r/0/b/0/w/0/m/0/c/0/u/0/l/0/j/0/y/0/r/0/b/0/w/0/m/0/c/0/a/ 0/y/0/d/0/3/0/9/0/8/0/x/0/p/0/f/0/i/0/v/0/e/0/b/0/7/0/z/0/r/0/a/0/1/0/2/0
)
- Private Key: 33-character string used to sign transactions (eg
m/0/C/x/p/1/y/1/r/1/b/1/w/1/m/1/c/1/u/1/l/1/j/1/y/1/r/1/b/1/w/1/m/1/c/1/a /1/y/1/d/1/3/1/9/1/8/1/x/1/p/1/f/1/i/1/v/1/e/1/b/1/7/1/z/1/r/1/a/1/1/2/0
)
Using only public and private key to send coins
To send coins from an address using only the public and private key, you need to complete the following steps:
- Get your public and private keys: You can get your public and private keys by logging into your Bitcoin account on a local node (e.g.
bitcoin-cli getnewaddress
).
- Choose exchange or receiver address
: Select the receiver address you want to send coins to.
- Use the BCC command line client: Run the following command to create a new transaction and sign it with your private key:
bcc -q public_key private_key --from address < send_command
Replace public_key
with your actual public key, private_key
with your private key (no p/1/y/1/r/1/b/1/w/1/m/1/c/1/u/1/l/1/j/1/y/1/r/1/b/1/w/1/m/1/c/1/a/1/y /1/d/1/3/1/9/1/8/1/x/1/p/1/f/1/i/1/v/1/e/1/b/1/7/1/z/1/r/1/a/1/1/2/0
), and address
to the recipient’s address.
- Create a send command: replace
with a line containing only transaction data, for example:
"txid=1234567890abcdef00\n \
version=1\n \
nonce=1\n \
size=1000\n \
payload=... (your transaction data)"
Replace 1234567890abcdef00
with a unique transaction identifier. Other fields are optional and depend on the specific transaction you are creating.
Usage Example
Let’s say you want to send 10 BTC from your address m/0/C/x/p/1/y/1/r/1/b/1/w/1/m/1/c/1/u/1/l/1/j/1/y/1/r/1/b/1/w/1/m/1/c/1/ a/1/y/1/d/1/3/1/9/1/8/1/x/1/p/1/f/1/i/1/v/1/e/1/b/1/7/1/z/1/r/1/a/1/1/2/0
to your address m/0/C/x/p/10/g/0/r/0/b/0/f/0/m/0/s/0/u/0/l/0/k/0/g/0/r/0/b/0/f/0/m/0/s/0/a /0/у/0/д/0/3/0/9/0/8/0/х/0/п/0/е/0/и/0/в/0/е/0/б/0/7/0/з/0/р/0/а/0/1/0/2/0
.
In this example, the send_command
line looks like this:
"txid=1234567890abcdef00\n \
version=1\n \
nonce=1\n \
size=1000\n \
payload=... (your transaction data)"
Note: This is just a basic example to illustrate how you can use only public and private keys to send coins. In practice, you should always verify the signature of a transaction with your private key before sending it.
Hope this helps! Let me know if you have any questions or need further clarification on using the Bitcoin or BCC command line client.