为广大币圈朋友提供币圈基础入门专业知识!
当前位置首页 > 区块链知识> 正文

比特币和区块链技术的关系,比特币和区块链技术的区别

发布时间:2023-12-06-07:55:00 来源:网络 区块链知识 区块   技术

比特币和区块链技术的关系,比特币和区块链技术的区别


请查看相关英文文档

⑴ What are the differences and connections between blockchain and Bitcoin

Blockchain technology is a new technology derived from the development of the Bitcoin economy. Blockchain technology can effectively serve the Bitcoin economy, they are interconnected. Bitcoin is a virtual currency that only circulates in a specific network economic environment. Blockchain technology can not only be applied to the economy, but can also be used in all walks of life. This is their difference.

Blockchain Technology

Because blockchain technology is still an emerging product, it does not yet have an accurate or definite definition and concept. Simply put, blockchain technology is a model for encrypted management of data, which can protect data to a large extent. Blockchain technology has the distinctive characteristics of decentralization, openness, independence, security and anonymity. Its characteristics are well adapted to today's requirements for information protection and information disclosure in all walks of life. On the one hand, it ensures data security and prevents data processing from being interfered by factors such as human subjective emotions and system failures. On the other hand, it is up to the individual data to decide whether to hide their details from the group to the greatest extent possible to achieve the purpose of protecting privacy.

At the same time, there is no doubt that blockchain technology is still in a preliminary state of development. Society's understanding of it is not deep enough, and scholars are still in the stage of continuous exploration. Through correct application, blockchain technology will bring many positive impacts to society.

⑵ What is blockchain technology? What exactly is blockchain?

1. The so-called blockchain technology, referred to as BT (Blockchain technology), is also called Distributed ledger technology is an Internet database technology that is characterized by decentralization, openness and transparency, allowing everyone to participate in database records.

Explain in layman’s terms: If we assume that the database is a ledger, reading and writing the database can be regarded as an accounting behavior. The principle of blockchain technology is to find out the accounting information within a period of time. The fastest and best person will keep accounts, and then send this page of information to everyone else in the entire system.

2. Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.

Blockchain is an important concept of Bitcoin. It is essentially a decentralized database. At the same time, as the underlying technology of Bitcoin, it is a series of cryptographic methods related to each other. Each data block generated contains a batch of Bitcoin network transaction information, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block.

(2) Extended reading on Bitcoin and blockchain technology:

The blockchain system consists of data layer, network layer, consensus layer, and incentive layer , contract layer and application layer. Among them, the data layer encapsulates the underlying data blocks and related data encryption and timestamps.and other basic data and basic algorithms; the network layer includes distributed networking mechanisms, data dissemination mechanisms, and data verification mechanisms; the consensus layer mainly encapsulates various consensus algorithms of network nodes.

The incentive layer integrates economic factors into the blockchain technology system, mainly including the issuance mechanism and distribution mechanism of economic incentives; the contract layer mainly encapsulates various scripts, algorithms and smart contracts, and is the The basis of the chain's programmable features; the application layer encapsulates various application scenarios and cases of the blockchain.

⑶ What is the relationship between blockchain and Bitcoin?

Blockchain technology is the basic technology of Bitcoin and is also the core and infrastructure of Bitcoin. Bitcoin has always been operated and managed without any centralized organization. Later, Bitcoin technology was abstracted and called blockchain technology, or distributed ledger technology.

(1) Blockchain is the core and infrastructure of Bitcoin:

1. In the Bitcoin system , "currency" is simply the unit of account used in that ledger. The most important thing is not the concept of "currency", but the concept of "ledger" without a central storage organization. For example: I lend 50 yuan to someone else. At this time, I asked the financial staff to help me keep accounts.

2. Blockchain technology is the basic technology of Bitcoin and the core and infrastructure of Bitcoin. Bitcoin has always been operated and managed without any centralized organization. Later, Bitcoin technology was abstracted and called blockchain technology, or distributed ledger technology.

(2) Blockchain is the core and infrastructure of Bitcoin:

1. In the Bitcoin system, “currency” is just the accounting used in the ledger. unit. The most important thing is not the concept of "currency", but the concept of "ledger" without a central storage organization. For example: I lend 50 yuan to someone else. At this time, I asked the financial staff to help me keep accounts. Bookkeeping must be paid, so I need to pay the financial staff.

Because an incentive mechanism has also been invented in the Bitcoin system technology, which is equivalent to what I just said, you can help me keep accounts and I will pay you, but not everyone can keep accounts. rewards. Therefore, the blockchain has designed a corresponding mechanism competition mechanism.

2. The competition mechanism uses a hash algorithm to determine the ownership of rewards. Generally speaking, everyone is given a math problem. The reward is for whoever calculates the result first. The calculation process of the hash algorithm is a process in which a professional computer (we call it a miner) uses the hash algorithm to calculate the results, which is called mining.

For the fastest and best bookkeepers, the system writes the recorded contents into the account books and sends the account book contents to everyone in the system for backup. This way, everyone in the system has a complete ledger called blockchain technology.

(3) The origin of blockchain:

1. The origin of the word "blockchain" is from the original English version of the Bitcoin white paper "Blockchain". When translating this sentence, the Chinese market directly uses "blockchain"The word was then directly written as "blockchain" and became a proper noun for the global blockchain technology level.

So, no matter who explains the blockchain, Bitcoin cannot be bypassed. If you want to introduce the history of cars, just like you can't avoid Carl Benz; if you want to introduce the history of airplanes, just like the Wright brothers.

2. Bitcoin "invented" and proved the feasibility of blockchain technology. Bitcoin is not the entire blockchain technology, just one of its applications. But without Bitcoin, or if Bitcoin's applications were not successful, blockchain might not have emerged, or at least not for many years. Therefore, it is difficult for the blockchain to be "isolated" from Bitcoin for a long time.

(3) Extended reading on Bitcoin and blockchain technology:

Blockchain technology applied to digital currencies Disadvantages:

First, "decentralization" does not have a circulation management agency. In essence, blockchain technology is a distributed database system, its logical structure is a one-way linked list, and its design model is based on P2P network, which determines that there is currently no unified virtual currency central control system based on blockchain technology. .

Second, quantity supply is difficult to effectively control. Based on blockchain technology, the issuance amount of virtual currency is fixed. According to the Fisher equation, at a certain price level, the total transaction volume of the whole society in a certain period has a certain ratio to the required nominal amount of money, and a fixed amount of money obviously cannot meet the requirements of the ever-increasing total price of social commodities.

Third, it is difficult for the “mining mechanism” to create recognized value. Bitcoin itself has no value and is not backed by national credit. Some people think that "value is injected into virtual currency by continuously consuming computing power and energy", but in order to find a hash value that meets the requirements, spending millions of calculations is obviously not the most efficient option.

Fourth, producers and early holders can easily obtain high seigniorage taxes. Any virtual currency based on blockchain technology will be held by a small number of people in the early stages of development. Take Bitcoin for example. At first, Bitcoin was just a product of a few people's game. In May 2010, the first transaction to buy Bitcoin was a $25 pizza purchased for 10,000 Bitcoins, and the first transaction completed in July of the same year was $0.04/Bitcoin.

⑷ Blockchain technology

Background: After the birth of Bitcoin, it was discovered that the technology was very advanced, and only then was blockchain technology discovered. Bitcoin and blockchain technology were discovered at the same time.

1.1 The purpose of the birth of Bitcoin:

①Currency transactions have records, that is, ledgers;

②The disadvantages of centralized institution accounting - it can be tampered with; Yi Chaofa

Bitcoin solves the first problem: anti-tampering - hash function

1.2 hash function (encryption method)

① Function: convert any length string, converted to a fixed length (sha256) output. The output is also called a hash value.

② Features: It is difficult to find two different x and y such that h(x)=h(y).

③Application: md5 file encryption

1.3 Blockchain

①Definition

Block: Split the general ledger into zones Block storage

Blockchain: On each block, add a block header. It records the hash value of the parent block. By storing the hash value of the parent block in each block, all blocks are connected in order to form a blockchain.

②How does the blockchain prevent transaction records from being tampered with?

After the blockchain is formed, tampering with any transaction will cause the hash value of the transaction block to be different from that of its sub-blocks. , tampering was discovered.

Even if you continue to tamper with the hash value in the sub-block header, the hash value in the sub-block will be different from that in the grandchild block, and the tampering will be discovered.


1.4 The essence of blockchain

①The essence of Bitcoin and blockchain: a big ledger visible to everyone, only recording transactions .

②Core technology: Through cryptographic hash function + data structure, it ensures that the ledger records cannot be tampered with.

③Core function: Create trust. Fiat currency relies on government credibility, and Bitcoin relies on technology.

1.5 How to trade

① To conduct transactions, you need an account number and password, corresponding to the public key and private key

Private key: a string of 256-bit binary numbers , no application is required to obtain it, and you don’t even need a computer. You can generate the private key by tossing a coin 256 times.

The address is converted from the private key. The address cannot reverse the private key.

The address is the identity, which represents the ID in the Bitcoin world.

After an address is generated, it can only be known by everyone if it enters the blockchain ledger.

②Digital signature technology

Signature function sign (Zhang San’s private key, transfer information: Zhang San transfers 10 yuan to Li Si) = signature of this transfer

< p> Verify Korean verify (Zhang San’s address, transfer information: Zhang San transfers 10 yuan to Li Si, signature of this transfer) = True

Zhang San uses his own signature function sign() The private key signs this transaction.

Anyone can verify whether the signature was issued by Zhang San himself who holds Zhang San's private key by verifying the Korean vertify(). It returns true, otherwise it returns false.

sign() and verify() are cryptographically guaranteed not to be cracked. ·

③Complete the transaction

Zhang San will provide the transfer information and signature to the entire network. Under the premise that the account has a balance, after verifying that the signature is true, it will be recorded in the blockchain ledger. Once recorded, Zhang San's account will be reduced by 10 yuan, and Li Si's account will be increased by 10 yuan.

Supports one-to-one, one-to-many, many-to-one, and many-to-many transactions.


In the Bitcoin world, private keys are everything! ! !

1.6 Centralized Accounting

① Advantages of Centralized Accounting:

a. No matter which center keeps accounts, don’t worry too much

< p> b. Centralized accounting, high efficiency

②Disadvantages of centralized accounting:

a Denial of service attack

b Stop service after getting tired

p>

c Central institutions are vulnerable to attacks. For example, destroying servers and networks, committing self-intrusion, legal termination, government intervention, etc.

All attempts at confidential currencies with centralized institutions in history have failed.


Bitcoin solves the second problem: how to decentralize

1.7 Decentralized accounting

①Decentralization: Everyone can keep accounts. Everyone can keep a complete ledger.

Anyone can download open source programs, participate in the P2P network, monitor transactions sent around the world, become an accounting node, and participate in accounting.

② Decentralized accounting process

After someone initiates a transaction, it is broadcast to the entire network.

Each accounting node continues to monitor and continue transactions across the entire network. When a new transaction is received and the accuracy is verified, it is put into the transaction pool and continues to be propagated to other nodes.

Due to network propagation, the transactions of different accounting nodes at the same time are not necessarily the same.

Every 10 minutes, one person is selected from all accounting nodes in a certain way, and his transaction pool is used as the next block and broadcast to the entire network.

Other nodes delete the transactions that have been recorded in their own transaction pool based on the transactions in the latest block, continue accounting, and wait for the next selection.

③ Features of decentralized accounting

A block is generated every 10 minutes, but not all transactions within these 10 minutes can be recorded.

Accounting nodes that obtain accounting rights will get 50Bitcoin rewards. After every 210,000 blocks (approximately 4 years), the reward is halved. The total amount is about 21 million, and it is expected to be mined in 2040.

Recording the reward of a block is also the only way to issue Bitcoin.

④ How to allocate accounting rights: POW (proof of work) method

Compete for accounting rights by calculating mathematical problems on several accounting points.

Find a random number that makes the following inequality true:

There is no other solution except traversing the random numbers starting from 0 and trying your luck. The process of solving the problem is also called mining.

Whoever solves the problem correctly first will get the accounting rights.

If a certain accounting node finds the solution first, it will announce it to the entire network. After other nodes verify that it is correct, a new round of calculation will start again after the new block. This method is called POW.

⑤ Difficulty adjustment

The generation time of each block is not exactly 10 minutes

As Bitcoin develops, the computing power of the entire network does not increase.

In order to cope with changes in computing power, the difficulty will be increased or decreased every 2016 blocks (about 2 weeks), so that the average time for each block to be generated is 10 minutes.

#欧易OKEx# #BTC[超话]# #digital currency#

⑸ What is the blockchain? Does the blockchain originate from Bitcoin?

1. Blockchain is a term in the field of information technology. In essence, it is a shared database, and the data or information stored in it has the characteristics of "unforgeable", "full traces left", "traceable", "open and transparent" and "collectively maintained". Based on these characteristics, blockchain technology has laid a solid foundation of "trust", created a reliable "cooperation" mechanism, and has broad application prospects.

2. Blockchain originated from Bitcoin. On November 1, 2008, a person calling himself Satoshi Nakamoto published "Bitcoin: A Peer-to-Peer Electronic Cash System" "The article explains the architectural concept of an electronic cash system based on P2P network technology, encryption technology, timestamp technology, blockchain technology, etc., which marks the birth of Bitcoin. Two months later, the theory came into practice, and on January 3, 2009, the first genesis block with serial number 0 was born.

⑹ What is the relationship between blockchain technology and Bitcoin?

Blockchain technology is the underlying technology of Bitcoin. Bitcoin has always been operated and managed without any centralized organization. Later, Bitcoin technology was abstracted and called blockchain technology, or distributed ledger technology.

Bitcoin is the first application of blockchain and will be expanded to more and more industries in the future.

Blockchain technology, called distributed ledger technology, is an Internet database technology that is characterized by decentralization, openness and transparency, allowing everyone to participate in database records.

While Bitcoin is not issued by a specific monetary institution, the Bitcoin economy uses a distributed database composed of many nodes in the entire P2P network to confirm and record all transaction behaviors, and uses cryptographic design to ensure A currency that provides security in all aspects of currency circulation.

(6) Extended reading on Bitcoin and blockchain technology:

Bitcoin currency characteristics:

Decentralization: Bitcoin is the first distributed virtual currency. The entire network is composed of users and there is no central bank. Decentralization is the guarantee of Bitcoin’s security and freedom.

Worldwide circulation: Bitcoin can be managed on any computer connected to the Internet. Anyone can mine, buy, sell or receive Bitcoin regardless of location.

Exclusive ownership: Manipulating Bitcoin requires a private key, which can be isolated and stored on any storage medium. No one can obtain it except the user himself.

Low transaction fees: It is free to remit Bitcoin, but there will ultimately be a transaction fee of approximately 1 bit cent per transaction to ensure faster transaction execution.

No hidden costs: As a means of payment from A to B, Bitcoin has no cumbersome limits and procedures. You can make the payment by knowing the other party's Bitcoin address.

Cross-platform mining: Users can explore the computing capabilities of different hardware on many platforms.

Reference: Network-Blockchain Network-Bitcoin

⑺ The operating mechanism of Bitcoin and its connection with the blockchain

Anonymous

Every Bitcoin transaction will be recorded by the nodes in the blockchain network to enhance the credibility of the transaction and protect the interests of both parties to the transaction. However, if all nodes participate in recording, it is easy to cause inconsistency in ledger information due to network delays and other factors, and it is also difficult to prevent bookkeepers from tampering with transaction information.

Therefore, Bitcoin adopts the Proof of Work consensus mechanism, allowing all nodes to participate in the competition by solving the Proof of Work problem. The nodes that succeed in the competition have the accounting rights of the new block, and Ability to broadcast recorded information. After receiving it, other nodes will perform data synchronization based on this message to ensure that the ledger is consistent. This process of competing for accounting rights is called mining, and the nodes participating in mining are called miners. After successfully mining, the miner can obtain the block reward, which is a certain amount of Bitcoin, and can also charge transaction fees on the block. Driven by interests, nodes will actively participate in mining and maintain the authenticity and validity of transaction records.

There is only one way to issue Bitcoin, which is block reward, which means that Bitcoin is generated through mining. However, Bitcoin cannot be generated infinitely through mining. Its algorithm stipulatesEvery 210,100 blocks (approximately four years), the Bitcoin blockchain reward is halved. Since the total issuance of Bitcoin is constant at 21 million, it is expected to be mined out in 2140. This regulation ensures that Bitcoin will not suffer severe inflation due to artificial issuance and can protect the value of Bitcoin.

The operation of Bitcoin relies on blockchain technology, and Bitcoin and blockchain have an inseparable relationship. Bitcoin is an asset, and blockchain is the underlying technology that sets operating rules for this asset to ensure that every transaction proceeds smoothly. This is like the relationship between a video file and a player. Video playback must be processed by the underlying technology of the player. The birth of blockchain technology originated from the concept of Bitcoin. It can be said that blockchain technology is a product catalyzed by Bitcoin. Currently, blockchain technology is not only used in cryptocurrencies such as Bitcoin, but is widely used in various fields. However, Bitcoin is still the earliest and most successful application of blockchain technology.

⑻ Blockchain and Bitcoin (1)

Blockchain is a technology that has been proposed by academic circles for a long time but has only become popular with Bitcoin in recent years. a concept. Bitcoin is an implementation based on blockchain technology. Bitcoin is a cryptocurrency, or a digital currency. Let’s start with Bitcoin and talk about how Bitcoin uses blockchain technology.

Suppose that during the 2006 World Cup finals, two football fans who did not know each other met. Italy was playing France. The French fans said that France will definitely beat Italy with Zidane. The Italian fans were unconvinced and said that we Italy is invincible. If you don't believe it, let's bet 100 euros. In the real world, what should we do?

I have said before that we who work on computers spend more than 90% of our time dealing with abnormal situations. If humans were very trustworthy, the world might not be what it is now. The 600 miles that Qin promised King Huai of Chu were no longer 6 miles. Maybe it would be Chu who unified China. If you hand over the money to a third party, what if the third party also runs away? He stole the money. Therefore, in the real strange world, relying solely on a kind heart is unreliable. There must be means to firmly guarantee this commitment, legal contract, etc. Nowadays, a very common approach is for the third party to find an authoritative institution, such as the government, a bank, etc., or to find a reputable person or organization. In the final analysis, it is still to find an institution or person with credibility. But under normal circumstances, this third party will definitely "pluck out hair" and charge a certain percentage of handling fees.

So is there any way to solve this problem? This is one of the original intentions of Bitcoin's original design, to solve the trust problem between two strangers.

Encryption algorithm + multi-person accounting

Let’s talk about the encryption algorithm first, and here we need the asymmetric encryption I mentioned before, that is, the public key and private key. Everyone can have one or more pairs of public and private keys, but a public key can only have a corresponding private key, and vice versa. The principle is that two very large prime numbers (p and q) are multiplied to get a number (n). If you want to crack the private key based on the public key, you must theoretically crack it violently and figure out which two large prime numbers the number is multiplied by. Got it. Currently, there is no published private key in the world that can crack more than 1024 bits, so it is very safe to use a private key of 1024 or 2048 or even longer.

Then with the public key and private key, I as an individual can encrypt with the private key, and then publish the public key. Anyone can use my public key to decrypt to determine that this is what I published. . In the same way, when someone transfers money to me, I can also use his or her public key to decrypt it and determine that this is someone's identity. This is also called a digital signature. The principles are the same, they are all encryption algorithms, obtained by using mathematical Euler's formula, prime number multiplication and other principles. This is a very great algorithm called RSA, proposed by three mathematicians. As long as we ordinary people understand the concept and use of public keys and private keys.

In the previous traditional model, banks or government agencies had their own separate ledgers. For example, if Zhang San transferred 100 yuan to Li Si, how would it be recorded in the ledger? 100 is deducted from Zhang San’s account and 100 is added to Li Si’s account, right?

The same is true for multi-person ledgers, except that the previous centralized institution has become a distributed, decentralized multiple institutions and even individuals. For example, Li Bai transferred 100 taels of silver to Du Fu. In the past, the Ministry of Finance kept accounts. In the blockchain, Tang Taizong, Yang Yuhuan, Zhang Xiaojing, He Zhizhang and many other people kept accounts together. It was recorded that Li Taibai transferred 100 taels of silver to Du Zimei. , as evidence, with Li Bai's seal attached at the back. In this way, with multiple ledgers, it would be extremely difficult to tamper with them. Li Bai could safely transfer them to Du Fu without worrying that he would tamper with the amount or deny it.

This can solve the problem of fans betting mentioned at the beginning, but there is another question, why should others help us keep accounts?

The answer is to be paid, which is in line with human nature. Otherwise, who would be willing to help keep an account that has nothing to do with them?

But there is only one person who can ultimately keep accounts, otherwise everything will be in chaos.

On the premise that it is beneficial, how to ensure who will keep the accounts? There is a mathematical knowledge involved here. Everyone who wants to keep accounts, in fact, the so-called miners, must solve a mathematical problem when keeping money. There is no trick to this mathematical problem. The only way is to put the numbers into the formula. In hard calculation, the algorithm is a Hash algorithm, which is similar to calculating a series of numbers. Miners can only guess, but there is no other way. Moreover, the current probability of guessing this in Bitcoin is one in a trillion. It would take an ordinary computer to guess this continuously for about a year.number.

But there are thousands of computers in the world, and if they are calculated together, the speed will be much faster, because from a probability point of view, one computer will definitely calculate it, and this is indeed the case. Let’s look at a real-life example of Bitcoin.

In addition, you can also see who the Miner is and how many transactions (Number of Transactions) are included in this block.

What if this miner is an individual with ulterior motives, and after calculating the calculation, he tampered with the transfer record and amount privately?

A. Tampering with transaction records/amount

We introduced the public and private key encryption technology earlier. The miners themselves theoretically do not have the private keys of the sender or payee. Therefore, the transaction record that he tampered with will make errors when decrypted with the correct public key, and will eventually be deemed illegal (the author is not sure at what point in time the identification was made, but he is sure that this record can be falsified) ).

B. Delete transaction records

Assume a scenario where Zhang San wants to buy a two-bedroom, one-living house in Beijing’s 4th Ring Road, but Zhang San doesn’t want to pay for it. Occupying the house for free, I thought of a sneaky way to tamper with the transaction records. Theoretically, after Zhang San paid, this record was generated but not confirmed. The record needs to wait until a miner solves the puzzle. Assuming that the miner is one of his own, he asked the miner to erase the record. There is no problem. . But there are several ways to do it:

As we all know, Bitcoin mining takes a long time because of the troublesome math problems. The current cycle is about 10 minutes. This is based on the world Under the premise that hundreds of thousands of mining machines are working at full capacity at the same time. That is to say, tens of thousands of transactions will be uniformly confirmed and put into an immutable block every ten minutes, and these hundreds of thousands of mining machines will update their local records at the same time.

2.1 If the transaction is just generated and the landlord sees it, and then transfers the property rights to Zhang San the next second, then if Zhang San wants to tamper with the payment record, he must meet several conditions:

The difficulty of success depends on how many confirmed blocks follow the tampered record. If there is only one, it is too simple, because the blockchain algorithm defaults to miners using the first received longer block when publishing a new block. So after this modification, it will be done once and for all, because all the ledgers will be synchronized, but there is also a problem, that is, this synchronization will be recorded. If the landlord cannot check the account, Zhang San will eventually be arrested. If there are many, for example, after Zhang San completed the transfer, the landlord only completed the property transfer one hour after confirming the transfer.Then Zhang San must tamper with about 6 blocks of previous block information. This is very troublesome because each block will point to the previous block, and each block will have a digest (Hash), which is the current block. Summary of all transaction records. So if you try to modify a block that was written a long time ago, the digests of subsequent blocks will be changed. This is the hash tree (MerkleTree). Other nodes can report information that the blockchain has been tampered with. This involves the most important point. The 51% computing power that is often mentioned means that if Zhang San owns more than 50% of the ledgers and acknowledges this modification, then other nodes will also acknowledge this modification according to the algorithm design. . However, let’s not talk about the fact that almost no one in the world can do the above two things at the same time. Even if you can do it, if someone has questions about this, you can still force the system to be repaired. Similar problems have occurred in Ethereum before, and the outcome is Ethereum Entire blocks were tampered with and stolen property was recovered. Ethereum fork event.

The above is only a superficial introduction to the characteristics of Bitcoin implemented by applying blockchain technology. It can achieve openness, fairness, neutrality and equality. Any two strangers in the world can rely on Bitcoin or other blockchain technologies to trust each other.

博客主人唯心底涂
男,单身,无聊上班族,闲着没事喜欢研究股票,无时无刻分享股票入门基础知识,资深技术宅。
  • 36790 文章总数
  • 3637265访问次数
  • 3078建站天数