I recently read some where the speaker mentioned bitcoin doesn't store addresses in the block chain. If addresses do not exist on the blockchain, how can you check their balances on - for example - blockchain com?
Payment addresses stored within transactions, and transactions stored within blockchain. Thus, speaker is not right - addresses stored in the blockchain, and by scanning the blockchain, you can fetch all activity for any address. Of course, balance - just result (sum) of all activities.
However, Bitcoin (or other bitcoin-like crypto) does not build it's own address index, and there is impossible quickly fetch balance or activity history for some specific address directly from a node. Explorers scans blockchain and build his own transaction history withing his own database. Of course, when new block comes in, explorer updates his own DB, and by this way - he maintains actual history for all accounts.
Related
What is the difference between an Account and a Block in Solana Blockchain technology?
As per solana docs,
Block: A contiguous set of entries on the ledger covered by a vote. A leader produces at most one block per slot.
Account: A record in the Solana ledger that either holds data or is an executable program.
From the definitions, it seems like they both are the same which becomes part of the ledger as an individual transaction. Is it like this or something other concept
The word "ledger" is unfortunately overloaded in Solana, since it refers to both transactions and records that hold data. Maybe this will clarify a bit more:
A block is a set of transactions that have been executed (success or failure)
An account is like a file on an operating system. Transactions read / modify accounts based on the behavior of programs / smart contracts
I am trying to learn how blockchain works. I know that blockchain is nothing but list of blocks containing transactions, what I cannot understand is how do we then know how much money is contained in each account, since we are only maintaining list of transactions?
In distributed platforms, 2 models of accounting for account balances are most commonly used:
a state model, when each of the nodes, after the execution (or reception) of the transaction, accordingly changes the account state record in its local database (Ethereum, Hyperleger Fabric)
model of unspent remainings (UTXO), when the account balance is formed from the sum of the balances of "unused" transactions (Bitcoin, Corda)
I have a website, and I need each user of the site to have their own unique bitcoin address. Any funds sent to these addresses I need to be automatically transferred to a master wallet for me.
Any ideas on how I can set this up easily? The first stage is to generate bitcoin wallet addresses with code. I have no idea how to do this. The second question is then how do I access those funds and withdraw the money.
You can use the Bitcoin Core Api getaccountaddress with the account parameter as the user Unique ID from your Database. It will generate addresses that belongs to specific user but with a single Private Key that you own.
You can spend the funds with just normal transaction on Bitcoin Core Wallet.
I found a paper which is talking about a way to store data off-chain using the blockchain. The data are sent to the blockchain with a transaction which subsequently routes it to an off-blockchain store, while retaining only a pointer to the data on the public ledger.
In particular the paper says:
Consider the following example: a user installs an application that uses our platform for preserving her privacy. As the user signs up for the first time, a new shared (user, service) identity is generated and sent, along with the associated permissions, to the blockchain in a Taccess transaction. Data collected on the phone (e.g., sensor data such as location) is encrypted using a shared encryption key and sent to the blockchain in a Tdata transaction, which subsequently routes it to an off-blockchain key-value store, while retaining only a pointer to the data on the public ledger (the pointer is the SHA-256 hash of the data).
What I cannot understand is how they do it! If all the nodes on the blockchain have to execute that very transaction, it means that they all have to save those information off-blockchain causing a duplication of contents. Did I get it wrong?
After a quick glance at the paper in question, it makes no mention of storage replication. The use case they are describing here is to use blockchain transactions as references to physical data that is stored somewhere. The data can be accessed by anyone who has the reference to it; i.e. access to that particular blockchain system, however the data is encrypted such that only parties with the encryption key can actually decipher it. This approach allows for quick validation of data integrity while maintaining privacy.
From the perspective of the blockchain node all they see is a transaction that will be added to their local ledger, they don't actually save the data themselves.
How to get Ethereum internal transaction list / contract transaction list by RPC ?
Contract: 0xa5025faba6e70b84f74e9b1113e5f7f4e7f4859f
How to get the contract address transaction list by RPC ?
enter image description here
What you are trying to do is iterate through the blockchain and check each transaction in each block for a transaction that you are describing. While this will work (with a bit of code), you are better off reading the data from an existing block explorer. By doing it on your own, you will be creating a limited-functionality block explorer, when you should be using other resources.
Take a look at the Etherscan APIs, as they contain all the data you need.