怎么读取区块链中的数据库,怎么读取区块链中的数据信息
要读取区块链中的数据库和数据信息,我们需要了解三个关键词:区块链API、区块链浏览器以及区块链查询语言。
区块链API:API(Application Programming Interface)是指应用程序编程接口,是一组程序接口,它定义了软件组件如何相互交互。区块链API是一种特殊的API,它可以让开发者访问区块链数据库,从而提供更多的功能,比如:读取区块链中的数据库、查询区块链的交易记录、查看区块链的账户余额等。
区块链浏览器:区块链浏览器是一种特殊的网页浏览器,它可以访问区块链上的数据库,让用户可以查看区块链上的所有交易记录,查看区块链账户的余额,查看区块链的状态等。使用区块链浏览器可以轻松、快捷地读取区块链上的数据库。
区块链查询语言:区块链查询语言是一种特殊的编程语言,它可以用来查询区块链上的数据库,从而获取更多的信息,比如:查询区块链的交易记录、查看区块链的账户余额等。使用区块链查询语言可以获取更多的信息,从而更好地了解区块链上的数据库。
总之,要读取区块链中的数据库和数据信息,我们需要了解区块链API、区块链浏览器以及区块链查询语言,这三者可以帮助我们更好地读取区块链上的数据库和数据信息。
请查看相关英文文档
A. Introduction to Blockstack
1. Overview
Blockstack is a new Internet of decentralized applications, equipped with a complete set of open source development tools to build and bootstrap decentralized applications. ecosystem of applications and protocols. Users own their data, the browser is all they need to get started, and Blockstack is the “Google” of blockchain.
Blockstack is a blockchain browser application that integrates decentralized data, decentralized applications, and decentralized user data.
In the so-called distributed Internet, users have ownership of their identities, and data is bound to their identities and stored on their own private devices or in the cloud, thus eliminating dependence on third-party institutions. Developers can develop distributed applications to run locally, call the user's API, and access user data with the user's permission, without having to consider data storage issues. In this way, Blockstack returns data sovereignty to users. User data is kept by users and no third party can access user data without user permission. Since users have data sovereignty, they can transfer it as they wish without being restricted by the platform.
2. Implementation Principle of Blockstack
Blockstack builds an isolated naming system on top of the underlying blockchain. The underlying blockchain is used to record the status changes of "name-value" pairs. Using the consensus protocol of the blockchain, various operations in the naming system (such as naming registration, update, transfer, etc.) can be The entire network reaches a consensus and cannot be tampered with.
Blockstack adopts the idea of separating the data plane and the control plane to separate naming control and naming related data.
The control plane includes the underlying blockchain and the virtual chain above it, which defines the protocol for registering names and creating name-identity bindings.
The data plane is responsible for data storage, mainly including
(1) zone file used to find data through hash value or URL
(2) External storage (Dropbox, S3, IPFS, etc.). Data is signed by the key pair corresponding to the name to which it is bound. The client reads data from the data plane and verifies its integrity and authenticity using the data hash in the zone file and the name owner's public key.
This idea of separation of the data plane and the control plane makes Blockstack not attached to any specific blockchain, which means that users can choose different blockchains according to their own needs
/>
3. Blockstack levels
In order to realize naming and storage functions,Blockstack has four layers: the blockchain layer and virtual chain layer of the control plane, and the routing layer and data storage layer of the data plane. The specific implementation is shown in the figure below
1. Blockchain Layer
The blockchain layer is at the bottom and mainly provides two services:
(1) Blockstack Each operation is encoded in the transaction record of the underlying blockchain, and the blockchain layer is responsible for storing the sequence of operations of Blockstack;
(2) Provide consensus for the order of operations written to the blockchain.
2. Virtual chain layer (Virtualchain Layer)
The virtual chain layer is the core of Blockstack, which defines various operations of Blockstack nodes, and only Blockstack nodes can perceive this layer. Simply Although the blockchain node can read the original text of the operation, it cannot parse it.
The virtual chain layer also defines rules for accepting and rejecting Blockstack operations. For example, a registered naming operation is accepted only if no other user has registered the name yet.
3. Routing Layer
Blockstack separates the routing request (how to find the data) from the actual data storage, which gives the user a choice of data storage. You can choose commercial cloud storage (such as Amazon S3, or Dropbox) or your own private storage or p2p storage system.
Routing information is stored in zone files, which are almost identical in form to DNS zone files, as shown in the figure above. The virtual chain binds the name to the hash value of the zone file and stores it in the control plane, while the zone file itself is stored in the routing layer (the current implementation is to store it in a distributed hash table). Users can fully trust the routing layer because users can compare the zone file with the hash value of the control plane at any time to verify whether the zone file has been modified.
4. Storage Layer
The storage layer is where users actually store data. All data will be signed by the key pair corresponding to the name owner. Through this off-chain storage method, users can store data of any size, and because the hash value of the data is stored in the control layer, users do not have to worry about data being tampered with.
There are two ways to store data in the storage layer: volatile storage and non-volatile storage. The main difference between the two lies in modifying the numberWhether to modify the zone file at the same time when data is used is applicable to situations where data often needs to be modified and data is rarely modified.
5. Naming system
Blockstack uses a four-layer structure to implement a distributed naming system. The name belongs to the address of the underlying blockchain and the corresponding private key. Like Namecoin, users need to pre-order (preoder) before they can register (register) their name. The first user to successfully write scheduled operations and registration operations to the blockchain can gain ownership of a name. After the name is registered, the user can use the update command to send updated data to the name. Users can also use the transfer operation to transfer the name to another address. The revoke command temporarily terminates operations on this name.
4. Summary
Blockchain technology has brought exciting prospects to the Internet. The distributed naming and storage system allows users to retain absolute control over their identities and data. Third-party programs that want to access user data require user authorization. Although the Blockstack project is not yet very mature, its design ideas and concepts are very consistent with the future development direction of the Internet, and it is also a model for the implementation of blockchain technology.
https://zhuanlan.hu.com/p/29823215
B. What is the concept of blockchain
Literally understood, block Chain includes two concepts: block and chain. The blockchain itself is composed of blocks, and the network built by linking different nodes together is the blockchain. The main function of the blockchain is to store information. Any information that needs to be saved can be written to the blockchain or read from it.
Each block stores: some valid record or transaction; information involving the block; links to the previous block and the next block through the hash of each block - which can be considered a block The unique code of the fingerprint.
Each block therefore has a specific and immovable position within the chain, as each block contains information from the hash of the previous block. The entire chain is stored in every network node that makes up the blockchain, so an exact copy of the chain is stored among all network participants.
Uses
Essentially, blockchain can be used to store any type of information that must remain intact and be more secure than going through a middleman. , decentralized and cheaper ways remain available. Additionally, since the stored information is encrypted, its confidentiality is guaranteed as only those with the encryption key can access it.
Using blockchain in healthcare. For example, health records can be consolidated and stored on the blockchain. This means that each patient’s medical history is safe and, at the same time,It is available to every authorized physician, regardless of the health center where the patient receives treatment. Even the pharmaceutical industry could use this technology to authenticate medicines and prevent counterfeiting.
Blockchain is also very useful for managing digital assets and documents. The problem with digitization so far has been that everything is easily copied, but Blockchain allows you to record purchases, deeds, documents or any other type of online asset without it being counterfeited.
C. What channels can be used to query Bitcoin’s on-chain data?
Blockchain is an important concept of Bitcoin. It is essentially a disintermediated database. , and as the underlying technology of Bitcoin, it is a series of data blocks generated using cryptographic methods. Each data block contains information about a Bitcoin network transaction, which is used to verify the validity of its information (anti-counterfeiting) and Generate the next block.
The data on the Bitcoin blockchain is what we call on-chain data, which generally includes: Bitcoin active addresses, new addresses, and continuous active addresses. , reactivation address, on-chain transaction volume, number of on-chain transactions, TSP, on-chain transaction transfer fees, large transfers, mining difficulty and other data.
We generally use the blockchain browser to query the on-chain data of certain blockchains, bit The more commonly used blockchain browsers for coins are:
https://www.blockchain.com/explorerhttps://blockexplorer.com/https://insight.bitpay.com/https://btc. com/More information about blockchain projects, blockchain investments, blockchain applications, and blockchain celebrities , all in Lianxiaohu: https://www.lianxiaohu.com/
D. New ways to track and manage digital assets, teach you how to view blockchain bills
Bill records Value circulation and status are the basic functions of financial services.
Our commonly used banks, Alipay, WeChat Pay, etc. will record a transaction for ordinary users and merchants, and provide query, statistics and analysis services in different dimensions.
For example, the Alipay annual bill that everyone loves to post will count the user's total income and expenditure throughout the year, consumption types, Yu'E Bao and other financial management income, and the number of takeaway orders. Through big data technology, consumer interests and trends in various regions and different age groups are displayed, so that consumers can better understand the consumption environment around them, and merchants can grasp market demand in a timely manner.
In a decentralized areaIn the blockchain network, transactions are permanently recorded on the chain, open and transparent, and accessible to everyone.
However, since the design of the blockchain is more inclined to ensure non-tampering and data compression requirements, the filtering query function at the business level is missing. Coupled with the different rules of different chains, it becomes extremely difficult to track and manage crypto assets. This is why digital asset investors often lament that they “always feel like they don’t have a clear account.”
SixPencer launches a new blockchain accounting artifact, which currently supports asset tracking and management at the bottom of Bitcoin and Ethereum. It is free to use and does not require registration.
Once launched, it has been loved by miners, asset management institutions, OTC merchants, encryption startups, and digital asset investors.
As a professional asset management tool, it can not only query all transaction records on the chain, but also view account balances and It holds assets and provides daily income and expenditure status of various currencies, supports single or multi-address aggregate income and expenditure statistics, address portrait analysis and charts, large transaction record rankings, contact management, etc.
After entering the website, enter the Bitcoin or Ethereum address in the search box on the homepage, and click Search to enter the overview page of the address.
We use the address that currently ranks first in ETH holdings on the entire network: (tag: bitfinex 1) account as a demo account for demonstration, and all data are real on-chain data.
Here is a brief introduction to the difference between addresses and bank accounts on the blockchain. On the blockchain, an address is similar to a bank card number. Knowing the address is the same as knowing the bank card number, and you can transfer money to it.
But the difference is that the blockchain is a distributed public ledger that cannot be tampered with. It is usually anonymous and anyone can conduct public queries on any address. The bank account can only query your own account information, and you cannot know other people's account information through the bank card number.
If the user has multiple addresses or wants to track other addresses, they can search. All searched address information will be summarized on the asset portfolio page. Click the drop-down box to switch or delete accounts.
In addition to the basic information provided by the blockchain browser, SixPencerIn addition, some personalized indicators have been added to help users understand their own on-chain portraits and track the on-chain trajectories of other accounts. On the overview page below, you can view the address's asset overview, historical indicators, income and expenditure statistics, and asset holding information.
Address overview
Creation time: date of first receipt of ETH
Net assets: all assets, including ERC20 tokens Total USD value of assets
ETH ranking: Ranking of ETH holdings among all Ethereum addresses
p>
ETH balance and valuation: Amount of ETH held and its corresponding USD value
Historical indicators
< p> Historical indicators display four major dimensions: transaction volume, number of transactions, token analysis and contact analysis. Through statistics, the unclear and confusing accounts can finally be settled. For example, the simplest accounting calculation, total ETH income = ETH balance + total ETH expenditure + total ETH handling fee. Another example is the total number of transactions = the number of transfer-in transactions + the number of transfer-out transactions.Due to the particularity of the Ethereum network, all transfer fees are paid in ETH. Therefore, we list the handling fees separately, and also support separate screening of handling fees in the transaction details to help users count handling fee expenditures.
Some interesting data, the demo account fee is 1.1556ETH, a single large ETH transfer reaches 900,000 ETH, and the number of tokens held is There are 350 types, and the most traded token is USDT, with only 37 addresses that have been traded with it.
Generally speaking, addresses holding hundreds of different assets are usually exchange addresses. In addition, the number of transactions and contacts are not many, so it can be ruled out that it is an external address, and it can basically be judged that it is used internally by the bitfinex exchange. address.
Income and Expenditure
Statistics of the total income and expenditure of all assets this month, including handling fees.
Assets held
Display the number, value, and assets of assets heldPrice and 24h increase and decrease. The address of an exchange such as a demo account, which holds assets, usually does not fit on 10 pages.
In addition to providing the transaction flow of addresses, SixPencer also supports query and filtering of full historical transaction records, balance information, daily income and expenditure statistics, etc.
Transaction details
From the following page, you can clearly know the income and expenditure of ETH assets this month. Users can also filter based on date, fund flow, transaction classification and labeling system. If you need more detailed statistics, we will introduce how to filter transactions at specified addresses later.
Click the ETH drop-down box in the picture above to switch to the transaction details page of other currencies. For example, switch to the transaction details of USDT to view the detailed status of USDT.
In addition to monthly bills, SixPencer displays the transaction details of each transaction, providing information such as transaction direction, transaction counterparty, transaction amount, account balance, transaction time, daily income and expenses, etc. As you can see in the picture below, the nearly 6 ETH transactions were all transferred from the bitfinex 3 account to bitfinex 1.
Transaction details
Click on any transaction details to enter the transaction details page of that transaction. The transaction hash is a unique and immutable transaction ID for each on-chain transfer, similar to the concept of an order number.
The specific information of a transaction can be queried through the transaction hash.
The transaction quantity, transaction status, transaction time, sender and recipient, handling fee, etc. shown below are the specific information of this transaction and will not be repeated here. It is worth noting that SixPencer provides a personal tag and remark system. Users can make personalized classifications and notes for individual transactions to help remember and not forget every transaction.
How to quickly find and specify the transaction information of the address?
As time goes by and the number of transactions increases, it becomes extremely complex and difficult to query the specified transaction information on the chain. SixPencer refines the transaction information according to business needs and provides a tag system to assist users in customization. Transaction inquiries and statistics.
For example, if you want to query 2020How much ETH was transferred to the demo account from the address (label: bitfinex 3) in June of this year. Through our billing system, it only takes two steps to check.
1. Label: For demonstration, we will rename the label "bitfinex 3" to "test test".
2. Filter: Filter the dates to June 1st - June 30th, select "Transfer" in the filter bar, select "Test" in the bottom tab bar, and click Save.
After saving, you can search for all the transaction information transferred to the demo account from "test test" in June. As can be seen from the figure below, in June, the demo account transferred from the address labeled "test test" 58,440.2489 ETH received.
If the user wants to query transactions with multiple specified addresses, select multiple tags and adjust the date, fund flow and other information to perform automatic statistics of assets.
In the analysis column, users can query the chart analysis information of the address in different dimensions, including the four major dimensions of balance, transaction, classification and ranking. You can also view more detailed data and charts by clicking on each dimension separately.
Balance: Balance displays the balance quantity and value trend of assets
Transaction: Transaction displays all transactions, the number of transactions transferred in and out, and the number of transactions Trends in value and number of transactions
Classification: Classification counts transaction types based on the platform's address label system, reflecting the transaction preferences of the address
< p>
Ranking: The ranking displays active contacts according to the number of transactions, and displays large transactions according to the transaction amount
For example, ranking Analysis, you can quickly check the specific transaction amount and large-amount transfers with a certain address. As shown in the figure below, the demo account and the address labeled "test" have a total of 177 transactions this month. Other transactions with the demo account that have more transactions are ERC20 Token contract call transactions.
From the picture below, the large-amount rankings are also transaction information with the address labeled "test".The grid displays the transaction object, transaction time, transaction direction, transaction quantity and value. If you are interested in large accounts on the exchange, you can check the large transfer information of the exchange address to see which addresses are large deposits and withdrawals.
The address book displays all addresses that have transaction records with the demo account. In addition to the platform's own label system, users can add labels to addresses or rename labels.
Tags: tags known by the display platform tag system and tags added by users
Recent Contacts: Displays addresses/labels with transaction records in the last 30 days
All Contacts: Displays all contacts with transaction records Addresses/tags, addresses with more than 10,000 transactions, display of contacts for the last 10,000 transactions
In summary, SixPencer’s new asset tracking and management tools can provide It has more comprehensive query and analysis functions than a blockchain browser or wallet. As a tool product, it is intended to assist users in digital asset management and help everyone make better decisions through further analysis of user profiles on the chain.
We believe that the open and transparent mechanism of blockchain should make data query easier, but currently it is still difficult and painful to quickly query blockchain data according to actual business needs, and has become a major obstacle to commercial implementation.
Digital asset transactions are only a small part of it. A large amount of valuable data will be stored on the blockchain in the future. SixPencer will continue to launch more practical tools to allow Data better serves the business.
E. How to analyze blockchain in a simple and easy-to-understand way
For many people, they may not notice such a lofty vocabulary when they see it. , as soon as I saw such an obscure technical explanation, and then measured my knowledge reserve, I was frightened and backed away a little.
In a word, it is a special distributed database. First of all, the main function of blockchain is to store information. Any information that needs to be saved can be written to the blockchain and read from it, so it is a database. Secondly, anyone can set up a server, join the blockchain network and become a node. In the world of blockchain, there is no central node. Every node is equal and stores the entire database. You can write/read data to any node, because all nodes will eventually be synchronized to ensure that the blockchain is consistent.
Blockchain
The biggest feature of blockchain: distributed databases are not a new invention, and such products have long been on the market. However, blockchain has a revolutionary feature. The blockchain has no administrators and is completely centerless. Other databases have administrators, but blockchain does not. If one wanted to add auditing to the blockchain, it would not be possible because it is designed to prevent the emergence of a central authority. It is precisely because it cannot be managed that the blockchain cannot be controlled. Otherwise, once big companies and large groups control the management, they will control the entire platform, and other users will have to take orders from them. However, without an administrator, everyone can write data into it. How can we ensure that the data is trustworthy? What should I do if I am changed by a bad person? Please read on, this is the wonderful place of blockchain.
The Xueshuo Innovation Blockchain Technology Workstation under Lianqiao Education Online is the "Smart Learning Workshop 2020- Xueshuo" launched by the School Planning and Construction Development Center of the Ministry of Education of China. "Innovation Workstation" is the only approved "blockchain technology professional" pilot workstation. The professional position is based on providing students with diversified growth paths, promoting the reform of the training model integrating professional degree research, production, and research, and building an applied and compound talent training system.
F. The data in the blockchain is encrypted, so how can other nodes access it?
"Longlu Network" is happy to answer your questions.
First of all, the encryption in blockchain technology refers to the compilation of data using an encryption technology when transmitting, rather than encrypting the displayed data, because blockchain still One feature is that information is open and transparent. All transaction records, asset quantities and other information stored on the blockchain can be traced and queried. In the blockchain, every transaction completed will be identified as the initiator. The origin is broadcast to the surroundings and the information is synchronized to the surrounding nodes. These nodes that receive the information will continue to broadcast to the surrounding nodes and continue to send the information to the surrounding nodes. Eventually, this transaction information will spread to the entire network, realizing common accounting for the entire network.
Therefore, this data is visible to everyone, but cannot be modified, which is equivalent to a "read-only" state. This is another major feature of the blockchain "anti-tampering".
What is used in the blockchain is "asymmetric encryption technology", which means that encryption and decryption do not use the same key. There are usually two keys, called the "public key" and " Private Key", they must be paired together, otherwise the encrypted file cannot be opened. The "public key" here means that it can be disclosed to the outside world, but the "private key" cannot, and can only be known by the holder. Its superiority lies here, because if the symmetric encryption method is transmitting encrypted files on the network, it will be difficult not to tell the other party the key. No matter what method is used, it may be eavesdropped. The asymmetric encryption method has two keys, and the "public key" can be made public, so there is no fear of others knowing. The recipient only needs to use his or her private key when decrypting. In this wayThis effectively avoids key transmission security issues.
The private key is usually needed when you need to use the digital currency in your encrypted wallet. When you want to initiate a transfer transaction, you must use your own private key pair. Abstract: Asymmetric encryption is performed. The public key and the private key are the only corresponding relationship. If the public key is used to encrypt data, decryption can only be achieved with the corresponding private key.
I hope the answer from "Longlu Network" can help you.
G. How to obtain the blockchain key file
1. A method for retrieving the blockchain system key, which is characterized by including the following steps: Step 1. Create the original key pair; Step 2. Calculate the business key pair based on the original key pair; Step 3. Calculate the address and account based on the business key pair; Step 4. When the business key is lost, perform Step 2. 2. According to the rights The method for retrieving a blockchain system key according to claim 1, characterized in that the original key pair includes an original private key and an original public key. 3. The method for retrieving the blockchain system key according to claim 2, characterized in that in step 1, creating an original key pair includes the following steps: Step 11. Generate an original seed using a random number. ; Step 12: Generate an original key pair from the original seed through an asymmetric encryption algorithm. The original key pair includes an original private key and an original public key. 4. The blockchain system key retrieval method according to claim 1, characterized in that in step 2, the business key pair includes a business private key and a business public key. 5. The method for retrieving the blockchain system key according to claim 4, characterized in that in step 2, specifically, a business seed is generated according to the seed production data, and a business key is generated according to the business seed. Yes, it specifically includes the following steps: Step 21, use the original private key as the encryption key, perform a seed generation operation on the seed production data, and obtain a unique ciphertext as the business seed; Step 22, use the business seed The non-pair encryption algorithm generates a business key pair, which includes a business private key and a business public key. 6. The blockchain system key retrieval method according to claim 5, characterized in that in step 21, the seed production data includes the original public key or any other selected data. 7. The method for retrieving the blockchain system key according to claim 5, characterized in that in the step 21, the seed generation operation includes an hmac encryption algorithm operation, a salted hash encryption algorithm operation, Symmetric encryption algorithm operation or asymmetric encryption algorithm operation. 8. The method for retrieving the blockchain system key according to claim 3 or 5, characterized in that the asymmetric encryption algorithm includes rsa algorithm, ecc algorithm, ecdsa algorithm, sm2 algorithm and sm9 algorithm. Any of them. 9. The method for retrieving the blockchain system key according to claim 5, characterized in that if the unique ciphertext is not a hash value, then a hash operation is performed on the ciphertext to obtain The ciphertextThe hash value is used as the business seed; if the ciphertext is a hash value, it can be directly used as the business seed, or the hash operation can be performed again or multiple times, and the obtained hash value is used as the business seed. 10. The method for retrieving the blockchain system key according to claim 7, characterized in that the symmetric encryption algorithm includes des algorithm, 3des algorithm, rc2 algorithm, rc4 algorithm, rc5 algorithm, aes algorithm, Any one of the sm1 algorithm, sm4 algorithm, sm7 algorithm and zuc algorithm.
H. Where is the data in the blockchain stored?
The data in the blockchain all exists in the terminal or in the server. Because we are talking about blockchain, its user terminal can also be a server, and the server can also be a user terminal, so it is all stored on these devices.
I. How to check other people’s blockchain information
1. If you are querying account balance, historical transaction data of the account and other information, it is recommended to directly enter the wallet address to query; if you are querying a certain To obtain relevant information about a transfer, such as whether it has been received and how the progress is, it is most convenient to enter the transaction ID. Of course, the blockchain browser can not only query your own account, but also query all contacts of other people's accounts: display all contact addresses/tags with transaction records, addresses with more than 10,000 transactions, and take the most recent 1 Contact display for 10,000 transactions In summary, SixPencer’s new asset tracking and management tool can provide more comprehensive query and analysis functions than a blockchain browser or wallet. As a tool product, it is intended to assist users.
2. It can be queried through the blockchain browser. In the blockchain browser, we can know what transactions a wallet address has conducted, how many assets are on the account, etc. You can view it with a blockchain browser. Enter the wallet address you want to query in the search input box. If the address you enter is incomplete, but this address has been ETH traded or queried on the blockchain before, the input box will automatically query it for you p>