bitcoin Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/category/bitcoin/ Production Grade Technical Solutions | Data Encryption and Public Cloud Expert Thu, 23 Jan 2025 19:37:15 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.2 https://www.anujvarma.com/wp-content/uploads/anujtech.png bitcoin Archives - Anuj Varma, Hands-On Technology Architect, Clean Air Activist https://www.anujvarma.com/category/bitcoin/ 32 32 UTXOs and Transaction Fees https://www.anujvarma.com/utxos-and-transaction-fees/ https://www.anujvarma.com/utxos-and-transaction-fees/#respond Thu, 23 Jan 2025 19:37:15 +0000 https://www.anujvarma.com/?p=9642   Understanding Risks of Small Value UTXOs What is a UTXO? UTXO stands for Unspent Transaction Output, which represents chunks of bitcoin you own. When you send or receive bitcoin, […]

The post UTXOs and Transaction Fees appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
 

Understanding Risks of Small Value UTXOs

What is a UTXO?

UTXO stands for Unspent Transaction Output, which represents chunks of bitcoin you own. When you send or receive bitcoin, it’s tracked as UTXOs. Think of it like having several prepaid cards, each with its own balance.

Why Are Small UTXOs Problematic?

Whenever you use a UTXO, the transaction fee depends on the data size, not the value of the UTXO. This can create issues such as:

  • Small-value UTXOs may have their entire value consumed by fees.
  • Even medium-value UTXOs can lose a significant percentage of their worth to fees, reducing their effectiveness.

For instance:

  • If sending a UTXO costs 10,000 satoshis in fees, and the UTXO itself is worth 10,000 satoshis, there’s nothing left for the recipient.
  • If the UTXO is worth 50,000 satoshis, a 10,000-satoshi fee represents 20% of its value.

What is Considered a “Small” UTXO?

Generally, a UTXO smaller than 1,000,000 satoshis (0.01 BTC) is considered small, as higher fees can make them uneconomical to use.

Multisignature wallets or older wallets that don’t use Segwit (a technology that reduces transaction size) require even larger UTXOs to avoid these issues because they involve more data and higher fees.

Why Bitcoin Price Influences UTXOs

As bitcoin’s price increases, the cost of creating properly sized UTXOs also rises:

  • In 2019, 0.01 BTC was worth $50.
  • By 2025, 0.01 BTC is worth $1,000.

If bitcoin’s price continues to climb, acquiring a “safe” UTXO size could cost thousands of dollars, making it harder for small-scale users to manage their funds effectively.

Steps to Protect Yourself

  • Withdraw Larger Amounts: Avoid withdrawing small amounts of bitcoin from exchanges. Instead, wait until your balance reaches a “healthy” UTXO size (e.g., 0.01 BTC or more) before moving it to your wallet.
  • Review Your UTXOs: Use wallet tools (like Sparrow Wallet) to check how many UTXOs you hold and their values.
  • Combine Small UTXOs: If you have many small UTXOs, consider consolidating them into larger ones when fees are low. This reduces the risk of losing value due to rising fees in the future.
  • Explore Collaborative Custody: You can use multisig setups with trusted partners to securely and efficiently manage your UTXOs without handling everything alone.

Key Takeaway

Small UTXOs risk losing most or all of their value to transaction fees, especially as bitcoin’s price rises or network fees increase. Managing UTXOs carefully ensures you can spend your bitcoin efficiently without significant losses.

 

The post UTXOs and Transaction Fees appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/utxos-and-transaction-fees/feed/ 0
MyNOde – Lightning Node update hangs https://www.anujvarma.com/mynode-lightning-node-update-hangs/ https://www.anujvarma.com/mynode-lightning-node-update-hangs/#respond Sun, 14 Nov 2021 19:42:54 +0000 https://www.anujvarma.com/?p=8602 Simply go into Apps –> Look for anything lightning related that needs an update – and update it.   That.’s it – fixed my issues.

The post MyNOde – Lightning Node update hangs appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Simply go into Apps –> Look for anything lightning related that needs an update – and update it.

 

That.’s it – fixed my issues.

The post MyNOde – Lightning Node update hangs appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/mynode-lightning-node-update-hangs/feed/ 0
So you think you understand how bitcoin works? https://www.anujvarma.com/so-you-think-you-understand-how-bitcoin-works/ https://www.anujvarma.com/so-you-think-you-understand-how-bitcoin-works/#respond Fri, 02 Jul 2021 21:45:05 +0000 https://www.anujvarma.com/?p=7282 Also read – The physics of Gold and Bitcoin Why can you not copy your wallet.dat file – and have DOUBLE your money now? If miners are unable to make […]

The post So you think you understand how bitcoin works? appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
sample bitcoin wallet address
sample bitcoin wallet address

Also read – The physics of Gold and Bitcoin

  1. Why can you not copy your wallet.dat file – and have DOUBLE your money now?
  2. If miners are unable to make a profit, what will keep the network going?
  3. You can send directly to an IP address instead of a bitcoin wallet. What are the pros and cons of doing a transaction to an IP?
  4. A wallet has multiple private keys. How does it keep track of the hundreds of keys?
  5. If a balance is split across blocks – some as far back as a thousand blocks, how does the balance get reconciled?
  6. If part of a network gets ‘cut off’, what happens to the transactions that flow through the cut off network?
  7. What can cause a SEND transaction to fail (to be not received)? What is the remedy for such failures?
  8. Can you get the public key from a wallet address?

The post So you think you understand how bitcoin works? appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/so-you-think-you-understand-how-bitcoin-works/feed/ 0
Secrecy versus Privacy in RSA based Schemes https://www.anujvarma.com/secrecy-versus-privacy/ https://www.anujvarma.com/secrecy-versus-privacy/#respond Fri, 11 Jun 2021 16:50:55 +0000 https://www.anujvarma.com/?p=8331 RSA is a scheme that can be used for two purposes. Secrecy – Encrypting in transit data – Data Encryption. This is the basis for all certificate based data encryption […]

The post Secrecy versus Privacy in RSA based Schemes appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
RSA is a scheme that can be used for two purposes.

Secrecy – Encrypting in transit data – Data Encryption. This is the basis for all certificate based data encryption schemes.

Privacy – Hiding or Proving your identity – Digital Signatures.

More on Secrecy –  Does RSA encrypt data in transit?

Actually, no. All RSA does is establish the session key that is to be used for the in-transit encryption.

Bitcoin  Transactions

For example, in bitcoin transactions, you are more interested in PROVING the identity of the SENDER (the one who signs the transaction). For this, the digital signature aspect of RSA is used. The encryption algorithm used in bitcoin is ECSDA (not SHA256)

””’




Need an experienced AWS/GCP/Azure/DevSecOps Professional to help out with your Public Cloud Strategy? Set up a time with Anuj Varma.

The post Secrecy versus Privacy in RSA based Schemes appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/secrecy-versus-privacy/feed/ 0
Bitcoin Private Key, Public Key, Addresses and Wallets – Bitcoin Consultant https://www.anujvarma.com/bitcoin-private-key-public-key-addresses-and-wallets-bitcoin-consultant/ https://www.anujvarma.com/bitcoin-private-key-public-key-addresses-and-wallets-bitcoin-consultant/#respond Sat, 22 May 2021 14:47:33 +0000 https://www.anujvarma.com/?p=8158 Also read SSL and TLS Certificate Basics Getting Bitcoind to accept HTTPS requests What is the difference between a bitcoin public key and a wallet address? Public Keys are used […]

The post Bitcoin Private Key, Public Key, Addresses and Wallets – Bitcoin Consultant appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Also read

What is the difference between a bitcoin public key and a wallet address?

Public Keys are used to create wallet addresses. How that public key is created is independent of the bitcoin protocol.

Both the public and the private key are stored in the wallet software. It is possible to offload these to a cold wallet.

If all you have is the bitcoin address, without any other record on the chain, then it is not possible to retrieve the public key.

The post Bitcoin Private Key, Public Key, Addresses and Wallets – Bitcoin Consultant appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/bitcoin-private-key-public-key-addresses-and-wallets-bitcoin-consultant/feed/ 0
Decentralized vs. Distributed Database Systems – Blockchain and Bitcoin Databases https://www.anujvarma.com/decentralized-vs-distributed-database-systems-blockchain-and-bitcoin-databases/ https://www.anujvarma.com/decentralized-vs-distributed-database-systems-blockchain-and-bitcoin-databases/#respond Mon, 12 Apr 2021 19:10:15 +0000 https://www.anujvarma.com/?p=8211 Decentralized – The nodes do not need to trust each other (or even know about each other) Distributed – The nodes all trust each other – in a master-slave or […]

The post Decentralized vs. Distributed Database Systems – Blockchain and Bitcoin Databases appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Decentralized – The nodes do not need to trust each other (or even know about each other)

Distributed – The nodes all trust each other – in a master-slave or a peer-to-peer relationship.

What database does Bitcoin Core use?

The bitcoin network itself does not use a database engine. Bitcoin Core uses LevelDB to index the blockchain and store the chain state data (UTXO set, current best block, etc.). It uses BerkeleyDB for the wallet.

The post Decentralized vs. Distributed Database Systems – Blockchain and Bitcoin Databases appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/decentralized-vs-distributed-database-systems-blockchain-and-bitcoin-databases/feed/ 0
Getting bitcoind to accept https Requests https://www.anujvarma.com/getting-bitcoind-to-accept-https-requests/ https://www.anujvarma.com/getting-bitcoind-to-accept-https-requests/#comments Mon, 05 Apr 2021 01:21:35 +0000 https://www.anujvarma.com/?p=8224 Can bitcoind accept https requests? Bitcoind offers an RPC-JSON server – that can accept http requests.  It USED to be able to accept https requests using a simple switch in […]

The post Getting bitcoind to accept https Requests appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>

Can bitcoind accept https requests?

Bitcoind offers an RPC-JSON server – that can accept http requests.  It USED to be able to accept https requests using a simple switch in bitcoin.conf (see Appendix A below). However, this was droppped in 2015.
To do an encrypted tunnel to bitcoind, one needs to use SSH.
Before we do that, WHY do we need to do an encrypted tunnel to bitcoind?
If you want to connect to the JSON RPC server remotely, you will need to authenticate yourself.
This authentication happens over plain HTTP – and is basic HTTP authentication.

The JSON-RPC server requires basic HTTP authentication. For example, to send a request using curl:

curl --user av:mypassword \
--data-binary '{"jsonrpc":"1.0","id":"curltext","method":"listunspent","params":[]}' \
-H 'content-type:text/plain;' http://192.168.blah.blah:18443/ \

Authentication (Basic HTTP) Data is basically Plaintext

Authentication data (user name and password) is sent as base 64 encoded plaintext (which can be decoded online)

To avoid this plaintext send, our only option is to use SSH between the client machine and the bitcoind server.

Computer to Computer SSH

If the VM hosting yourbitcoind software has a way to SSH to the client sending the HTTP request.

  • Set up SSH local port forwarding on the client machine  – i.e. the computer that will send HTTP requests to the RPC server

ssh -v -fNL 5555:192.168.client.IP:18443 remote_user@192.168.client.IP

  • To use the tunnel, send traffic to localhost – i.e. 127.0.0.1:5555 host:port
Appendix A – PRE 2015 – How do you switch from http to https on bitcoind?  PRE-2015 – This functionality is no longer available
bitcoind offers an RPC-JSON server – that can accept http requests. To switch it to https,

Step 1 – Add rpcssl = 1 to the- bitcoin.conf config file:

rpcuser     = myUsername
rpcpassword = myPassword
rpcallowip  = ipAddressWhitelisteddHost
rpcssl      = 1

2. Generate a Self Signed Cert.. Navigate to your data directory .bitcoin and generate a self-signed certificate. Do not enter a password when it prompts you for one.
openssl genrsa -out server.pem 2048
openssl req -new -x509 -nodes -sha1 -days 3650 -key server.pem > server.cert

Restart bitcoind and test the SSL functionality.

You should see the certificate details. Pressing enter twice will return  – HTTP/1.0 401 Authorization Required.

openssl s_client -connect localhost:8332

bitcoind will now accept RPC-JSON commands through through HTTPS.

Appendix B

Python code for setting up the SSH tunnel

The post Getting bitcoind to accept https Requests appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/getting-bitcoind-to-accept-https-requests/feed/ 1
Ethereum and Crypto questions for Developers https://www.anujvarma.com/ethereum-and-crypto-questions-for-developers/ https://www.anujvarma.com/ethereum-and-crypto-questions-for-developers/#respond Tue, 23 Mar 2021 13:18:18 +0000 https://www.anujvarma.com/?p=8190 This is an ongoing list of questions for developer interviews (blockchain and crypto related) If there is NO function on the receiving end of an ether send, what happens to […]

The post Ethereum and Crypto questions for Developers appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
This is an ongoing list of questions for developer interviews (blockchain and crypto related)

If there is NO function on the receiving end of an ether send, what happens to the ether?

There’s usually a fallback function – and if that isn’t present, the ether is lost.

What does Interoperability mean in the crypto space?

  • Moving Information – e.g. – editing a word doc on your tablet and getting the latest version picked up on your laptop
  • Moving Users  – OAuth and OpenID type of interoperability
  • Moving Value  – e.g. Ethereum provides value to all tokens that live atop it.

What are sync proofs? 

How do you avoid double spend of an asset from a chain to another chain – e.g. how do you prevent BTC spend on LTC or Dash? The idea is to provide a sync proof (few KB of data) along with the asset

Re-Entrancy, Randomness

The post Ethereum and Crypto questions for Developers appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/ethereum-and-crypto-questions-for-developers/feed/ 0
Tokens vs. Coins https://www.anujvarma.com/tokens-vs-coins/ https://www.anujvarma.com/tokens-vs-coins/#respond Sat, 20 Mar 2021 15:51:41 +0000 https://www.anujvarma.com/?p=8176 Coins are currencies in the true sense. They have recognized value outside of a given blockchain project (i.e. they are universally recognized  – by humans and other coin ecosystems – […]

The post Tokens vs. Coins appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Coins are currencies in the true sense.

They have recognized value outside of a given blockchain project (i.e. they are universally recognized  – by humans and other coin ecosystems – as a valid form of payment).

Tokens are digital assets that have existence and meaning only inside a project.

They are used as a way to facilitate payments within the project’s ecosystem.

Tokens can be further categorized into security tokens and utility tokens.

Security tokens give holders a share of a company’s ownership, for example, tokens issued by the Decentralized Autonomous Organization (DAO) project.

Utility tokens are based on a use case – e.g. filecoin is used for file storage, namecoin for decentralized DNS etc.

Need a blockchain consultant?

Set up a 1 on 1 appointment with Anuj Varma to assist with your blockchain journey

The post Tokens vs. Coins appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/tokens-vs-coins/feed/ 0
Bitcoin Transaction Basics https://www.anujvarma.com/bitcoin-transaction-basics/ https://www.anujvarma.com/bitcoin-transaction-basics/#respond Sat, 20 Mar 2021 15:49:04 +0000 https://www.anujvarma.com/?p=8170 Each transaction contains the following information: Sources (from the address) of the coins to be transferred from The number of coins to be transferred Destinations (send-to address) where coins should […]

The post Bitcoin Transaction Basics appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
Each transaction contains the following information:

  • Sources (from the address) of the coins to be transferred from
  • The number of coins to be transferred
  • Destinations (send-to address) where coins should be transferred to

What is an address? (Also read Private Key, Public Key and Addresses in bitcoin)

Both source and destination addresses are 64-character hashes. Here is an example:

34360re63b436433232897889f4ff13d068428d2f71312cf5594c132905bftyz

Bank Account Number versus Bitcoin Address

An address is like a customer’s bank account number. However, there are fundamental differences between them. For example, a bank has a centralized place for saving metadata on an account, for example, the customer name, account open date, and account type, and so on. Also, the balance of an account is calculated and saved. A bitcoin address does not have metadata and maintains no balance. Addresses are referred to only in bitcoin transactions. When an address does not contain any unused coins, a new request for transferring a coin from the address will fail a transaction validation due to an insufficient fund error.

A bitcoin coin does not associate with a physical object such as a file or a physical coin.

Only transactions and addresses support its existence. For example, if you want to know the total number of coins that have been minted so far, you have to go through all addresses with unused coins and add them up.

Address Balance Calculation (Transaction Sum Up)

When a user enters a transaction request at a node, bitcoin software installed at the node broadcasts the transaction to all nodes. Nodes on the network will validate the transaction by retrieving all historical transactions containing the input addresses and ensuring that coins that are transferred out from these addresses are legitimate and sufficient. After that, the mining nodes start to construct a block by collecting the validated transactions.

What exactly goes into validating a transaction?

A transaction has a sender’s wallet address and a recipient’s wallet address (and of course, the amount in btc). The BALANCE (unspent balance) of BTC in the sender’s wallet has to be validated (otherwise, you could simply double, triple spend).

One has to traverse the entire length of the chain and visit EVERY SINGLE transaction associated with that wallet address.

THIS IS THE ONLY WAY TO ENSURE THAT DOUBLE SPENDING DOES NOT OCCUR (this combined with grouping transactions into a block..see example below). Unless you verify every single transaction that involved the sender’s address, there is no way the transaction ‘passes’ even a single node’s ‘available balance check’.

Think of the simplest double spend example – the sender, in rapid succession sends two identical transactions to two different wallets, with the same BTC amount. The first transaction would be approved via the confirmation mechanism and then verified into the CURRENT block.

However, the second transaction would be recognized as invalid by the confirmation process and would fail validation, because traversing every transaction of the address would reveal the previous spend.

Who gets to add the block to the chain?

Normally, one block contains between 1,500 and 2,000 transactions. If a miner wins a race for resolving a difficult factoring puzzle, the miner gets the role for adding the new block to the blockchain. Bitcoin takes approximately every 10 minutes to add a new block.

Need a blockchain consultant?

Set up a 1 on 1 appointment with Anuj Varma to assist with your blockchain journey

The post Bitcoin Transaction Basics appeared first on Anuj Varma, Hands-On Technology Architect, Clean Air Activist.

]]>
https://www.anujvarma.com/bitcoin-transaction-basics/feed/ 0