Non-native blockchain signature
By generating and verifying the combination of native signatures and non-native signatures in the blockchain, the problem of inability to verify the integrity of non-native signatures in the blockchain is solved, the functionality and security of the blockchain are improved, and signature transactions are ensured. immutability and credibility.
Patent Information
- Application Number
- CN202380036695.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-26
- Filing Date
- 2023-04-24
- Publication Date
- 2024-12-06
AI Technical Summary
The integrity of non-native signatures cannot be effectively verified in blockchain, which limits the improvement of blockchain functions and the integrity guarantee of signature transactions.
By generating a combination of native signatures and non-native signatures, the efficiency of native signatures is used to efficiently generate and verify native signatures, and include non-native signatures in the unlock script, ensuring the authenticity and integrity of signed messages during the verification process of non-native signatures. .
It realizes the integrity and authenticity of non-native signatures in the blockchain, improves the functionality and security of the blockchain, and ensures the immutability and credibility of signature transactions.
Smart Images

Figure CN119096519A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a method for verifying a non-native blockchain signature within a script, and to a method for performing in-script verification using a non-native blockchain signature. Background Art
[0002] Blockchain refers to a distributed data structure in which a copy of the blockchain is maintained at each of a plurality of nodes in a distributed peer-to-peer (P2P) network (hereinafter referred to as a "blockchain network") and is widely disclosed. The blockchain includes a series of data blocks, each of which includes one or more transactions. Except for the so-called "coinbase transaction", each transaction points to a previous transaction in a sequence, which can span one or more blocks back to one or more coinbase transactions. The coinbase transaction will be discussed further below. Transactions submitted to the blockchain network are included in new blocks. The process of creating a new block is generally referred to as "mining", which involves each of a plurality of nodes competing to perform "proof of work", i.e., solving a cryptographic puzzle based on a representation of a defined set of ordered and verified valid pending transactions waiting to be included in a new block of the blockchain. It should be noted that the blockchain can be pruned at some nodes, and the publication of blocks can be achieved by publishing only the block header.
[0003] Transactions in a blockchain can be used for one or more of the following purposes: transferring digital assets (i.e., a certain number of digital tokens); sorting a set of entries in a virtualized ledger or registry; receiving and processing time-stamped entries; and / or sorting index pointers by time. Blockchains can also be used to implement hierarchical additional functions on blockchains. For example, a blockchain protocol may allow additional user data or data indexes to be stored in a transaction. There is no pre-specified limit on the maximum data capacity that can be stored in a single transaction, so increasingly complex data can be incorporated. For example, this can be used to store electronic documents, audio, or video data in a blockchain.
[0004] The nodes of the blockchain network (commonly referred to as "miners") perform a distributed transaction registration and verification process, which will be described in more detail later. In summary, in this process, nodes verify transactions and insert them into block templates, which attempt to identify a valid proof-of-work solution for the block template. Once a valid solution is found, the new block is propagated to other nodes of the network, so that each node can record the new block on the blockchain. In order to record a transaction in the blockchain, a user (e.g., a blockchain client application) sends the transaction to one of the nodes in the network for propagation. The nodes receiving the transaction can compete to find a proof-of-work solution that incorporates the verified valid transaction into the new block. Each node is configured to execute the same node protocol, which will include one or more conditions for confirming that the transaction is valid. Invalid transactions will not be propagated or incorporated into the block. Assuming that the transaction has been verified to be valid and thus accepted on the blockchain, the transaction (including any user data) will therefore be registered and indexed as an immutable public record on each node in the blockchain network.
[0005] The node that successfully solves the proof-of-work puzzle to create the latest block is usually rewarded with a new transaction called a "coinbase transaction" that distributes the amount of digital assets, i.e. the number of tokens. The detection and rejection of invalid transactions is performed by the actions of competing nodes, which act as agents of the network and are incentivized to report and prevent improper behavior. The widespread publication of information allows users to continuously audit the performance of nodes. Publishing only block headers allows participants to ensure the continued integrity of the blockchain.
[0006] In the "output-based" model (sometimes referred to as the UTXO-based model), the data structure of a given transaction includes one or more inputs and one or more outputs. Any spendable output includes an element that specifies the amount of a digital asset, which can be derived from the ongoing sequence of transactions. Spendable outputs are sometimes called UTXOs ("unspent transaction outputs"). Outputs may also include a locking script that specifies future redemption conditions for the output. A locking script is a predicate that defines the conditions necessary to verify and transfer a digital token or asset. Each input of a transaction (except for a coinbase transaction) includes a pointer (i.e., a reference) to such an output in a previous transaction, and may also include an unlocking script for unlocking the locking script pointing to the output. Thus, consider a pair of transactions, referred to as a first transaction and a second transaction (or "target" transaction). The first transaction includes at least one output that specifies the amount of a digital asset, and includes a locking script that defines one or more conditions for unlocking the output. The second (target) transaction includes at least one input and an unlocking script, the at least one input including a pointer to the output of the first transaction; the unlocking script is used to unlock the output of the first transaction.
[0007] In such a model, when the second (target) transaction is sent to the blockchain network to be propagated and recorded in the blockchain, one of the validity conditions applied at each node will be that the unlocking script satisfies all of the one or more conditions defined in the locking script of the first transaction. Another condition will be that the output of the first transaction has not been redeemed by another earlier valid transaction. Any node that finds the target transaction invalid according to any of these conditions will not propagate the transaction (as a valid transaction, but may register an invalid transaction) nor include the transaction in a new block to be recorded in the blockchain.
[0008] Another transaction model is the account-based model. In this case, each transaction is defined not by reference to the UTXO of the previous transaction in the past transaction sequence, but by reference to the absolute account balance. The current state of all accounts is stored individually by the node in the blockchain and is constantly updated. Summary of the invention
[0009] Digital signatures are cryptographic primitives that provide message authenticity and integrity. They are typically calculated using a signing private key and verified using a verifying public key. Digital signatures are a fundamental aspect of most, if not all, blockchain protocols. They are used to sign transactions, among other things. Most blockchain protocols have native digital signature schemes. For example, the ECDSA signature (used by the Bitcoin blockchain). In a blockchain environment, a native signature is a signature that can be verified within a script using a dedicated verification function (e.g., an opcode) to verify the signature. For example, the OP_CHECKSIG opcode (used by the Bitcoin protocol) or its variants verify the ECDSA signature. A native signature can also be defined as a signature that, when verified by the dedicated function, causes the dedicated function (or more accurately, the script engine) to generate a signed message based on actual transaction data, and to verify the signature based on the generated message. In other words, the native signature verification function verifies the native signature by: using the actual transaction data (available for the signature verification function) to construct a candidate message; and verifying the signature based on the constructed candidate message. The native signature provides integrity of the signed message by verifying the native signature based on a message constructed from the actual transaction data (i.e., the spending transaction and, in some cases, the reference transaction).
[0010] While the native signature scheme is fundamental to a given blockchain protocol, its functionality is limited. Therefore, it is desirable to be able to use other non-native signature schemes on the blockchain. However, since only the native signature scheme enables the scripting engine to construct messages, the integrity of the non-native signature cannot be verified. In the context of the blockchain, this means that the integrity of the spending transaction containing the signature cannot be guaranteed. Therefore, the challenge remains how to improve the functionality of the blockchain by utilizing non-native signatures while ensuring that the integrity of the signed transaction is maintained.
[0011] According to one aspect disclosed herein, there is provided a computer-implemented method for enabling in-script verification of a non-native blockchain signature, wherein the method is performed by a first party and includes: obtaining a second blockchain transaction, wherein the second blockchain transaction references a first blockchain transaction; generating a first signature based on at least the second blockchain transaction, wherein a first private key used to generate the first signature is set equal to one; generating a second signature based on the first signature, wherein the first signature is a native blockchain signature and the second signature is a non-native blockchain signature; when an unlocking script of the second blockchain transaction is executed together with a locking script of the first blockchain transaction, including the first signature and the second signature in the unlocking script for verification; and causing the second blockchain transaction to be submitted to a blockchain network.
[0012] The first party obtains (e.g., generates or receives) the second transaction. The second transaction has an input that references the first transaction, i.e., an unspent transaction output of the first transaction. The first party signs a message based on the second transaction to generate a first signature. The first signature is a signature native to the blockchain, such as an ECDSA signature. The private key used to generate the first signature is set to one, i.e., the private key is equal to the number one, which means that its generation and verification are computationally very efficient.
[0013] The first party then signs the message based on the first signature to generate a second signature. The second signature is not a signature native to the blockchain. For example, if the first signature is an ECDSA signature, the second signature is not an ECDSA signature. The second signature can belong to any signature scheme. The first party includes the first signature and the second signature in the unlocking script of the input of the second transaction. When the unlocking script is executed, the first signature will be verified, thereby guaranteeing the integrity of the second transaction. Regardless of which scheme is chosen, the second signature can provide its benefits. Generally, the second signature scheme can provide the authenticity of the signed message. Therefore, the combination of the first signature and the second signature provides the authenticity and integrity of the second transaction.
[0014] According to one aspect disclosed herein, there is provided a computer-implemented method for verifying a non-native blockchain signature in-script, wherein the method is performed by a second party and comprises: generating a first blockchain transaction, the first blockchain transaction comprising a locking script, wherein the locking script comprises a first verification script and a second verification script; wherein when the locking script of the first blockchain transaction is executed together with an unlocking script of a second blockchain transaction, the first verification script is configured to verify a first signature based on a first public key, the first public key corresponding to a first private key set equal to one, and the second verification script is configured to verify a second signature; wherein the first signature is a native blockchain signature and the second signature is a non-native blockchain signature; and, causing the first blockchain transaction to be submitted to a blockchain network.
[0015] The second party verifies the first transaction. The first transaction has an output that includes a locking script. The locking script includes two verification scripts. The first verification script is configured to cause the script engine to verify a native signature, such as an ECDSA signature, when executed. The verification involves the script engine constructing a candidate version of the signed message (i.e., a message based on at least the second transaction) and verifying the first signature based on the candidate message and a public key. The public key corresponds to the number one. The second verification script is configured to verify a non-native signature. When the second verification script is executed, the script engine does not construct a candidate message based on the second transaction. If the script execution passes, the integrity of the second transaction is verified (via a valid native signature), just like the non-native signature.
[0016] In some embodiments, the non-native signature can be an identity-based signature. An identity-based signature (IBS) is a digital signature that does not require a public key for verification. Instead, verification of the signature (as well as the message and some public parameters) only requires the identity of the signer. These embodiments enable the integrity of the second transaction to be guaranteed while also providing authenticity of the transaction because the second non-native signature is associated with the identity of the first party.
[0017] In general, any non-native signature scheme may be used, thereby improving the blockchain by exploiting the advantages associated with a particular signature scheme. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To facilitate an understanding of the embodiments of the present disclosure and to show how such embodiments may be implemented, reference will now be made, by way of example only, to the accompanying drawings, in which:
[0019] Figure 1is a schematic block diagram of a system for implementing a blockchain;
[0020] Figure 2 Some examples of transactions that may be recorded in a blockchain are schematically shown;
[0021] Figure 3 is a schematic block diagram of a system for implementing non-native blockchain signature verification;
[0022] Figure 4A and Figure 4B The use of a virtual signature to generate and verify an identity-based signature is schematically illustrated;
[0023] Figure 5A and Figure 5B Schematically illustrates the use of a virtual signature to generate and verify a universal signature;
[0024] Figure 6 The use of identity-based signatures to revoke on-chain certificates is schematically illustrated. DETAILED DESCRIPTION
[0025] 1. Exemplary System Overview
[0026] Figure 1 An exemplary system 100 for implementing a blockchain 150 is shown. The system 100 may include a packet-switched network 101, typically a wide area internet such as the Internet. The packet-switched network 101 includes a plurality of blockchain nodes 104, which may be arranged to form a peer-to-peer (P2P) network 106 within the packet-switched network 101. Although not shown, the blockchain nodes 104 may be arranged as a nearly complete graph. Thus, each blockchain node 104 is highly connected to other blockchain nodes 104.
[0027] Each blockchain node 104 includes a computer device of a peer, and different nodes 104 belong to different peers. Each blockchain node 104 includes a processing device, which includes one or more processors, such as one or more central processing units (CPUs), accelerator processors, special processors and / or field programmable gate arrays (FPGAs), and other devices, such as application-specific integrated circuits (ASICs). Each node also includes a memory, that is, a computer-readable memory in the form of a non-transitory computer-readable medium. The memory may include one or more memory units, which use one or more memory media, such as magnetic media such as hard disks, electronic media such as solid-state drives (SSDs), flash memory, or electrically erasable programmable read-only memories (EEPROMs), and / or optical media such as optical disk drives.
[0028] The blockchain 150 includes a series of data blocks 151, wherein a respective copy of the blockchain 150 is maintained at each of the plurality of blockchain nodes 104 in the distributed or blockchain network 106. As described above, maintaining a copy of the blockchain 150 does not necessarily mean storing the blockchain 150 in its entirety. Instead, the blockchain 150 can be pruned as long as each blockchain node 150 stores a block header (discussed below) for each block 151. Each block 151 in the blockchain includes one or more transactions 152, wherein a transaction in this context refers to a data structure. The nature of the data structure will depend on the type of transaction protocol used as part of the transaction model or plan. A given blockchain uses a particular transaction protocol throughout. In a common transaction protocol, the data structure of each transaction 152 includes at least one input and at least one output. Each output specifies an amount of a digital asset represented as a property, an example of which is an output that is cryptographically locked to a user 103 (requiring the user's signature or other solution to unlock, thereby redeeming or spending). Each input points to the output of a previous transaction 152, thereby linking these transactions.
[0029] Each block 151 also includes a block pointer 155, which points to a previously created block 151 in the blockchain to define the order of blocks 151. Each transaction 152 (except for the coinbase transaction) includes a pointer to a previous transaction to define the order of the transaction sequence (Note: the sequence of transactions 152 can branch). The blockchain of blocks 151 is traced back to the genesis block (Gb) 153, which is the first block in the blockchain. One or more original transactions 152 earlier in the blockchain 150 point to the genesis block 153, not to the previous transaction.
[0030] Each blockchain node 104 is configured to forward transactions 152 to other blockchain nodes 104, so that transactions 152 are propagated throughout the network 106. Each blockchain node 104 is configured to create blocks 151 and store corresponding copies of the same blockchain 150 in its corresponding memory. Each blockchain node 104 also maintains an ordered set (or "pool") 154 of transactions 152 waiting to be incorporated into block 151. Ordered pools 154 are often referred to as "memory pools". In this article, the term is not intended to be limited to any particular blockchain, protocol, or model. The term refers to a set of ordered transactions that a node 104 has accepted as valid, and for which the node 104 is forced to not accept any other transaction that attempts to spend the same output.
[0031] In a given current transaction 152j, an input (or each input) includes a pointer that references an output of a previous transaction 152i in the transaction sequence, specifying that the output is to be redeemed or "spent" in the current transaction 152j. Spending or redeeming does not necessarily mean transferring a financial asset, although this is certainly a common application. More generally, spending can be described as consuming an output, or allocating it to one or more outputs in another subsequent transaction. In general, a previous transaction can be any transaction in an ordered set 154 or any block 151. Although a previous transaction 152i will need to exist and be verified to be valid in order to ensure that the current transaction is valid, it is not necessary for a previous transaction 152i to exist when the current transaction 152j is created or even sent to the network 106. Therefore, in this article, "previous" refers to the predecessor in a logical sequence linked by a pointer, and not necessarily the creation time or sending time in a time sequence, and therefore, does not necessarily exclude the situation where transactions 152i, 152j are created or sent out of order (see the discussion of isolated transactions below). A previous transaction 152i can also be called a predecessor transaction or a predecessor transaction.
[0032] The inputs of the current transaction 152j also include input authorizations, such as the signature of the user 103a to whom the outputs of the previous transaction 152i are locked. In turn, the outputs of the current transaction 152j may be cryptographically locked to the new user or entity 103b. Thus, the current transaction 152j may transfer the amounts defined in the inputs of the previous transaction 152i to the new user or entity 103b defined in the outputs of the current transaction 152j. In some cases, a transaction 152 may have multiple outputs to split the input amounts among multiple users or entities (one of which may be the original user or entity 103a for changes). In some cases, a transaction may also have multiple inputs to aggregate the amounts from multiple outputs of one or more previous transactions and reallocate them to one or more outputs of the current transaction.
[0033] According to an output-based transaction protocol, such as Bitcoin, when a party 103, such as an individual user or an organization, wishes to issue a new transaction 152j (either by an automated program employed by the party or manually), the issuing party sends the new transaction from its computer terminal 102 to a recipient. The issuing party or recipient will ultimately send the transaction to one or more blockchain nodes 104 of the network 106 (now typically a server or data center, but in principle it can also be other user terminals). It is also not excluded that the party 103 issuing the new transaction 152j can send the transaction directly to one or more blockchain nodes 104, and in some examples, the transaction may not be sent to the recipient. The blockchain node 104 receiving the transaction checks whether the transaction is valid according to the blockchain node protocol applied at each blockchain node 104. The blockchain node protocol typically requires the blockchain node 104 to check whether the cryptographic signature in the new transaction 152j matches the expected signature, which depends on the previous transaction 152i in the ordered sequence of transactions 152. In such an output-based transaction protocol, this may include checking whether the cryptographic signature or other authorization of the party 103 included in the input of the new transaction 152j matches the condition defined in the output of the previous transaction 152i that the new transaction spends (or "allocates"), where the condition typically includes at least checking whether the cryptographic signature or other authorization in the input of the new transaction 152j unlocks the output of the previous transaction 152i to which the input of the new transaction is linked. The condition may be defined at least in part by a script included in the output of the previous transaction 152i. Alternatively, this may be determined solely by the blockchain node protocol, or may be determined by a combination thereof. In either case, if the new transaction 152j is valid, the blockchain node 104 forwards it to one or more other blockchain nodes 104 in the blockchain network 106. These other blockchain nodes 104 apply the same test according to the same blockchain node protocol, and therefore forward the new transaction 152j to one or more other nodes 104, and so on. In this way, the new transaction is propagated throughout the network of blockchain nodes 104.
[0034] In the output-based model, the definition of whether a given output (e.g., UTXO) is allocated (or "spent") is whether it is validly redeemed by the input of another subsequent transaction 152j according to the blockchain node protocol. Another condition for a transaction to be valid is that the output of the previous transaction 152i that it attempts to redeem has not been redeemed by another transaction. Similarly, if invalid, transaction 152j will not be propagated (unless marked as invalid and propagated for reminder) or recorded in the blockchain 150. This prevents double spending, that is, the transaction processor allocates the output of the same transaction more than once. On the other hand, the account-based model prevents double spending by maintaining account balances. Because there is also a defined transaction order, the account balance has a single defined state at all times.
[0035] In addition to verifying that transactions are valid, blockchain nodes 104 compete to be the first node to create a block of transactions in a process generally referred to as mining, which is supported by "proof of work". At a blockchain node 104, a new transaction is added to an ordered pool 154 of valid transactions that have not yet appeared in a block 151 recorded on the blockchain 150. The blockchain nodes then compete to assemble a new valid transaction block 151 of transactions 152 in the ordered transaction set 154 by attempting to solve a cryptographic puzzle. Typically, this involves searching for a "nonce" value such that when the nonce is juxtaposed with a representation of the ordered pool 154 of pending transactions and hashed, the output of the hash value satisfies a predetermined condition. For example, the predetermined condition may be that the output of the hash value has a certain predefined number of leading zeros. Note that this is only one specific type of proof of work puzzle, and other types are not excluded. A property of a hash function is that it has an unpredictable output relative to its input. Therefore, this search can only be performed by brute force, consuming a large amount of processing resources at each blockchain node 104 that attempts to solve the puzzle.
[0036] The first blockchain node 104 that solves the puzzle announces the puzzle solution on the network 106, providing the solution as proof, which can then be easily checked by other blockchain nodes 104 in the network (once a solution to the hash value is given, it is directly possible to check whether the solution satisfies the output of the hash value). The first blockchain node 104 propagates a block to other nodes that accept the block to reach a threshold consensus, thereby enforcing the protocol rules. The ordered set of transactions 154 is then recorded by each blockchain node 104 as a new block 151 in the blockchain 150. A block pointer 155 is also assigned to the new block 151n pointing to the previously created block 151n-1 in the blockchain. The large amount of work required to create a proof-of-work solution (e.g., in the form of a hash) signals the intention of the first node 104 to follow the blockchain protocol. These rules include not accepting a transaction as valid if it spends or allocates the same output as a previously verified valid transaction, otherwise it is called a double spend. Once created, the block 151 cannot be modified because it is identified and maintained at each blockchain node 104 in the blockchain network 106. The block pointers 155 also impose an order on the blocks 151. Because transactions 152 are recorded in ordered blocks at each blockchain node 104 in the network 106, an immutable public ledger of transactions is provided.
[0037] It should be noted that the different blockchain nodes 104 competing to solve a puzzle at any given time may do so based on different snapshots of the pool 154 of transactions that have not yet been published at any given time, depending on when they began searching for a solution or the order in which they received the transactions. The person solving the corresponding puzzle first defines the transactions 152 included in the new block 151n and their order, and updates the current pool of unpublished transactions 154. The blockchain nodes 104 then continue to compete to create blocks from the newly defined ordered pool of unpublished transactions 154, and so on. In addition, there is a protocol to resolve any "forks" that may occur, where two blockchain nodes 104 solve puzzles within a short time of each other, thereby propagating conflicting views of the blockchain between the nodes 104. In short, the fork direction that is the longest becomes the final blockchain 150. It should be noted that this does not affect users or agents of the network, as the same transaction will appear in both forks.
[0038] According to the Bitcoin blockchain (and most other blockchains), a node that successfully constructs a new block 104 is granted the ability to newly allocate an additional, accepted amount of digital assets in a new special type of transaction that allocates an additional limited amount of digital assets (as opposed to an inter-agent or inter-user transaction, which transfers a certain amount of digital assets from one agent or user to another). This special type of transaction is often called a "coinbase transaction", but may also be called a "starting transaction" or "generating transaction". It usually forms the first transaction of a new block 151n. The proof of work signals the intention of the node that constructs the new block to follow the protocol rules, thereby allowing the particular transaction to be redeemed later. The blockchain protocol rules may require a maturation period, such as 100 blocks, before the special transaction can be redeemed. Typically, a regular (non-generating) transaction 152 will also specify an additional transaction fee in one of its outputs to further reward the blockchain node 104 that created the block 151n in which the transaction was published. This fee is often called a "transaction fee" and is discussed below.
[0039] Due to the resources involved in transaction verification and publication, typically at least each blockchain node 104 takes the form of a server comprising one or more physical server units, or even an entire data center. However, in principle, any given blockchain node 104 may take the form of a user terminal or a group of user terminals networked together.
[0040] The memory of each blockchain node 104 stores software configured to run on the processing device of the blockchain node 104 to perform its corresponding role according to the blockchain node protocol and process transactions 152. It should be understood that any action attributed to the blockchain node 104 herein can be performed by software running on the processing device of the corresponding computer device. The node software can be implemented in one or more applications at the application layer or a lower layer such as an operating system layer or a protocol layer, or any combination of these layers.
[0041] Computer devices 102 of each of the parties 103 acting as consuming users are also connected to the network 101. These users can interact with the blockchain network 106 but do not participate in verifying transactions or constructing blocks. Some of these users or agents 103 can act as senders and receivers in transactions. Other users can interact with the blockchain 150 without acting as senders or receivers. For example, some parties can act as storage entities that store a copy of the blockchain 150 (e.g., having obtained a copy of the blockchain from the blockchain node 104).
[0042] Some or all of the parties 103 may be connected as part of a different network, such as a network overlaid on the blockchain network 106. Users of the blockchain network (often referred to as "clients") may be referred to as being part of a system that includes the blockchain network 106; however, these users are not blockchain nodes 104 because they do not perform the roles required of blockchain nodes. Instead, each party 103 may interact with the blockchain network 106, thereby utilizing the blockchain 150 by connecting to (i.e., communicating with) the blockchain node 106. For illustrative purposes, two parties 103 and their corresponding devices 102 are shown: a first party 103a and its corresponding computer device 102a, and a second party 103b and its corresponding computer device 102b. It should be understood that more such parties 103 and their corresponding computer devices 102 may exist and participate in the system 100, but for convenience, they are not illustrated. Each party 103 may be an individual or an organization. For illustrative purposes only, in this document, the first party 103a is referred to as Alice and the second party 103b is referred to as Bob, but it should be understood that this is not limited to Alice or Bob, and any reference to Alice or Bob in this document can be replaced with "first party" and "second party" respectively.
[0043] The computer device 102 of each party 103 includes a corresponding processing device, which includes one or more processors, such as one or more CPUs, graphics processing units (GPUs), other accelerator processors, specific application processors and / or FPGAs. The computer device 102 of each party 103 also includes a memory, that is, a computer-readable memory in the form of a non-temporary computer-readable medium. The memory may include one or more memory units, which use one or more memory media, such as magnetic media such as hard disks, electronic media such as SSDs, flash memory or EEPROMs, and / or optical media such as optical disk drives. The memory on the computer device 102 of each party 103 stores software, which includes a corresponding instance of at least one client application 105 that is set to run on the processing device. It should be understood that any action attributed to a given party 103 in this article can be executed by software running on the processing device of the corresponding computer device 102. The computer device 102 of each party 103 includes at least one user terminal, such as a desktop or laptop computer, a tablet computer, a smart phone, or a wearable device such as a smart watch. The computer device 102 of a given party 103 may also include one or more other network resources, such as cloud computing resources accessed through a user terminal.
[0044] The client application 105 may initially be provided to the computer device 102 of any given party 103 via a suitable computer-readable storage medium downloaded from a server, for example, or via a removable storage device such as a removable SSD, flash memory key, removable EEPROM, removable disk drive, floppy disk or tape, an optical disk such as a CD or DVD ROM, or a removable optical drive, etc.
[0045] The client application 105 includes at least a "wallet" function. This has two main functions. One of the functions is to enable the corresponding party 103 to create, authorize (e.g., sign) and send transactions 152 to one or more Bitcoin nodes 104, which are then propagated in the network of blockchain nodes 104 and included in the blockchain 150. Another function is to report to the corresponding party the amount of digital assets it currently owns. In an output-based system, this second function includes collating the amounts defined in the outputs of various transactions 152 belonging to the relevant parties scattered in the blockchain 150.
[0046] Note: While various client functions may be described as being integrated into a given client application 105, this is not necessarily limiting, and rather, any client function described herein may be implemented in a suite consisting of two or more different applications, such as interfacing via an API or one application as a plug-in to another application. More generally, the client functions may be implemented at the application layer or at a lower layer such as an operating system, or any combination of these layers. The following description will be based on the client application 105, but it should be understood that this is not limiting.
[0047] An instance of a client application or software 105 on each computer device 102 is operably coupled to at least one of the blockchain nodes 104 of the network 106. This can enable a wallet function of the client 105 to send transactions 152 to the network 106. The client 105 can also contact the blockchain node 104 to query the blockchain 150 for any transactions to which the corresponding party 103 is a recipient (or indeed to check other parties' transactions in the blockchain 150, because in an embodiment, the blockchain 150 is a public facility that provides transaction trust to some extent through its public visibility). The wallet function on each computer device 102 is configured to formulate and send transactions 152 according to a transaction protocol. As described above, each blockchain node 104 runs software that is configured to verify transactions 152 according to the blockchain node protocol and forward transactions 152 for propagation in the blockchain network 106. The transaction protocol and the node protocol correspond to each other, and a given transaction protocol and a given node protocol together implement a given transaction model. The same transaction protocol is used for all transactions 152 in the blockchain 150. All nodes 104 in the network 106 use the same node protocol.
[0048] When a given party 103 (say Alice) wishes to send a new transaction 152j to be included in the blockchain 150, she will formulate the new transaction according to the relevant transaction protocol (using the wallet function in her client application 105). She will then send the transaction 152 from the client application 105 to one or more blockchain nodes 104 to which she is connected. For example, this may be the blockchain node 104 that Alice's computer 102 is best connected to. When any given blockchain node 104 receives the new transaction 152j, it will process it according to the blockchain node protocol and its corresponding role. This includes first checking whether the newly received transaction 152j meets certain conditions for becoming "valid", specific examples of which will be discussed in detail later. In some transaction protocols, the validity conditions may be configurable on a per-transaction basis through a script included in the transaction 152. Alternatively, the conditions may simply be a built-in function of the node protocol, or defined by a combination of script and node protocol.
[0049] If the newly received transaction 152j passes the validity test (i.e., under the “valid” condition), any blockchain node 104 that receives the transaction 152j will add the new verified valid transaction 152 to the ordered transaction set 154 maintained at the blockchain node 104. Further, any blockchain node 104 that receives the transaction 152j will then propagate the verified valid transaction 152 to one or more other blockchain nodes 104 in the network 106. Since each blockchain node 104 applies the same protocol, it is assumed that the transaction 152j is valid, which means that the transaction will soon be propagated throughout the network 106.
[0050] Once in the ordered pool 154 of pending transactions maintained at a given blockchain node 104, that blockchain node 104 will begin racing to solve the proof-of-work puzzle on the latest version of its respective pool 154 containing the new transaction 152 (keep in mind that other blockchain nodes 104 can attempt to solve the puzzle based on different transaction pools 154. However, whoever solves the puzzle first will define the set of transactions included in the latest block 151. Ultimately, the blockchain node 104 will solve the puzzle for a portion of the ordered pool 154, which includes Alice's transaction 152j). Once the pool 154 including the new transaction 152j completes the proof-of-work, it will immutably become part of one of the blocks 151 in the blockchain 150. Each transaction 152 includes a pointer to an earlier transaction, so the order of transactions is also immutably recorded.
[0051] Different blockchain nodes 104 may initially receive different instances of a given transaction and therefore have conflicting views about which instance is “valid” before one instance is published in a new block 151, at which point all blockchain nodes 104 agree that the published instance is the only valid instance. If a blockchain node 104 accepts one instance as valid and then discovers that a second instance has been recorded in the blockchain 150, the blockchain node 104 must accept this and will discard (i.e., treat as invalid) the instance it originally accepted (i.e., the instance that has not yet been published in block 151).
[0052] Another type of transaction protocol operated by some blockchain networks as part of the account-based transaction model can be called an "account-based" protocol. In the account-based case, each transaction is defined not by reference to the UTXO of a previous transaction in the past sequence of transactions, but by reference to an absolute account balance. The current state of all accounts is stored individually in the blockchain by the nodes of the network and is continuously updated. In such systems, transactions are ordered using an account's running transaction record (also called a "position"). This value is signed by the sender as part of their cryptographic signature and hashed as part of the transaction reference calculation. In addition, optional data fields can also be signed in the transaction. For example, a data field can point to a previous transaction if it contains the ID of the previous transaction.
[0053] 2. UTXO-based model
[0054] Figure 2 An exemplary transaction protocol is shown. This is an example of a UTXO-based protocol. A transaction 152 ("Tx" for short) is the basic data structure of the blockchain 150 (each block 151 includes one or more transactions 152). The following will be described with reference to an output-based or "UTXO"-based protocol. However, this is not limited to all possible embodiments. It should be noted that although the exemplary UTXO-based protocol is described with reference to Bitcoin, it can also be implemented on other exemplary blockchain networks.
[0055] In the UTXO-based model, each transaction ("Tx") 152 includes a data structure that includes one or more inputs 202 and one or more outputs 203. Each output 203 may include an unspent transaction output (UTXO), which can be used as a source of input 202 for another new transaction (if the UTXO has not been redeemed). The UTXO includes a value that specifies the amount of a digital asset. This represents a set of tokens on a distributed ledger. The UTXO may also include a transaction ID of its source transaction and other information. The transaction data structure may also include a header 201, which may include an indicator of the size of the input field 202 and the output field 203. The header 201 may also include an ID for the transaction. In an embodiment, the transaction ID is a hash value of the transaction data (excluding the transaction ID itself) and is stored in the header 201 of the original transaction 152 submitted to the node 104.
[0056] Let's say Alice 103a wishes to create a transaction 152j that transfers the relevant amount of digital assets to Bob 103b. Figure 2 In , Alice's new transaction 152j is labeled "Tx1". This new transaction takes the amount of digital assets locked to Alice in output 203 of the previous transaction 152i in the sequence and transfers at least a portion of such amount to Bob. Figure 2, the previous transaction 152i is labeled "Tx0". Tx0 and Tx1 are just arbitrary labels that do not necessarily mean that Tx0 refers to the first transaction in blockchain 151 and Tx1 refers to a subsequent transaction in pool 154. Tx1 can point to any previous (i.e., preceding) transaction that still has unspent output 203 locked to Alice.
[0057] When Alice creates her new transaction Tx1, or at least when she sends it to the network 106, the previous transaction Tx0 may already be valid and included in block 151 of the blockchain 150. The transaction may have been included in one of the blocks 151 at this time, or it may still be waiting in the ordered set 154, in which case it will be included in the new block 151 soon. Alternatively, Tx0 and Tx1 may be created and sent to the network 106 together; or, if the node protocol allows buffering of "orphan" transactions, Tx0 may even be sent after Tx1. The terms "previous" and "successor" as used herein in the context of transaction sequences refer to the order of transactions in the sequence defined by the transaction pointers specified in the transactions (which transaction points to which other transaction, etc.). They may equally be replaced by "predecessors" and "successors", "predecessors" and "descendants", or "parents" and "children", etc. This does not necessarily refer to the order in which they are created, sent to the network 106, or arrive at any given blockchain node 104. However, subsequent transactions (descendant transactions or "child transactions") pointing to a previous transaction (predecessor transaction or "parent transaction") will not be valid unless the parent transaction is valid. A child transaction that arrives at the blockchain node 104 before the parent transaction is considered an orphan transaction. Depending on the node protocol and / or node behavior, it may be discarded or buffered for a period of time to wait for the parent transaction.
[0058] One of the one or more outputs 203 of the previous transaction Tx0 includes a specific UTXO, labeled UTXO0. Each UTXO includes a value specifying the amount of digital assets represented by the UTXO and a locking script that defines the conditions that the unlocking script in the input 202 of the subsequent transaction must satisfy in order for the subsequent transaction to be valid and thus successfully redeem the UTXO. Typically, the locking script locks the amount to a specific party (the beneficiary of the transaction for that amount). That is, the locking script defines the unlocking condition, which typically includes the following conditions: the unlocking script in the input of the subsequent transaction includes the cryptographic signature of the party to which the previous transaction was locked.
[0059] The locking script (also known as scriptPubKey) is a piece of code written in a domain-specific language recognized by the node protocol. A specific example of such a language is called a "Script" (with a capital S), which can be used by the blockchain network. The locking script specifies the information required to spend the transaction output 203, such as the requirement for Alice's signature. The unlocking script appears in the output of the transaction. The unlocking script (also known as scriptSig) is a piece of code written in a domain-specific language that provides the information required to meet the locking script criteria. For example, it can contain Bob's signature. The unlocking script appears in the input 202 of the transaction.
[0060] Thus in the example shown, UTXO0 in output 203 of Tx0 includes a locking script [Checksig P A ], the locking script requires Alice’s signature Sig P A , in order to redeem UTXO0 (strictly speaking, to make subsequent transactions that attempt to redeem UTXO0 valid). A ] contains Alice's public key P from her public-private key pair A The input 202 of Tx1 includes a pointer to Tx1 (e.g., by its transaction ID (TxID0), which in the embodiment is the hash value of the entire transaction Tx0). The input 202 of Tx1 includes an index identifying UTXO0 in Tx0 to identify it among any other possible outputs of Tx0. The input 202 of Tx1 further includes an unlocking script <Sig P A >, the unlocking script includes Alice's cryptographic signature, which is created by Alice by applying the private key of her key pair to a predetermined portion of data (sometimes called a "message" in cryptography). The data (or "message") that Alice needs to sign to provide a valid signature can be defined by the locking script, the node protocol, or a combination thereof.
[0061] When a new transaction Tx1 arrives at a blockchain node 104, the node applies the node protocol. This includes running the locking script and the unlocking script together to check whether the unlocking script satisfies the conditions defined in the locking script (where the conditions may include one or more criteria). In an embodiment, this involves juxtaposing two scripts:
[0062] <Sig PA> <pa>||[Checksig PA]
[0063] Where "||" means concatenation, "<…>" means putting data on the stack, and "[…]" means a function consisting of locked scripts (in this case, a stack-based language). Similarly, scripts can be run one after another using a common stack instead of concatenating the scripts. In either case, when run together, the scripts use Alice's public key P A (included in the locking script of the output of Tx0) to verify that the unlocking script in the input of Tx1 contains Alice's signature when signing the expected portion of the data. The expected partial data itself (the "message") also needs to be included in order to perform this verification. In an embodiment, the signed data includes the entire Tx1 (so there is no need to include a separate element to plaintext specify the signed partial data, as it is already present).
[0064] Those skilled in the art will be familiar with the details of authentication via public-private cryptography. Basically, if Alice has signed a message using her private key cryptographically, then given Alice's public key and the message in plain text, other entities such as node 104 can authenticate that the message must have been signed by Alice. Signing typically involves hashing the message, signing the hash value, and marking this to the message as a signature, thereby enabling any holder of the public key to authenticate the signature. Therefore, it should be noted that in embodiments, any reference herein to signing a particular data fragment or transaction portion, etc., may mean signing the hash value of that data fragment or transaction portion.
[0065] If the unlocking script in Tx1 satisfies one or more conditions specified in the locking script of Tx0 (so, in the example shown, if Alice's signature is provided and authenticated in Tx1), then the blockchain node 104 considers Tx1 to be valid. This means that the blockchain node 104 will add Tx1 to the pending transaction ordered pool 154. The blockchain node 104 will also forward the transaction Tx1 to one or more other blockchain nodes 104 in the network 106 so that it will propagate throughout the network 106. Once Tx1 is valid and included in the blockchain 150, this will define UTXO0 from Tx0 as spent. It should be noted that Tx1 is only valid if it spends unspent transaction output 203. If it attempts to spend an output that has already been spent by another transaction 152, then Tx1 will be invalid even if all other conditions are met. Therefore, the blockchain node 104 also needs to check whether the UTXO referenced in the previous transaction Tx0 has been spent (that is, whether it has formed a valid input for another valid transaction). This is one of the reasons why it is important for the blockchain 150 to impose a defined order on transactions 152. In practice, a given blockchain node 104 may maintain a separate database marking the UTXO 203 of a transaction 152 as having been spent, but ultimately defining whether a UTXO has been spent depends on whether it has formed a valid input to another valid transaction in the blockchain 150.
[0066] If the total amount specified in all outputs 203 of a given transaction 152 is greater than the total amount pointed to by all its inputs 202, this is another basis for failure in most transaction models. Therefore, such a transaction will not be propagated or included in block 151.
[0067] Note that in the UTXO-based transaction model, a given UTXO needs to be spent as a whole. You cannot "leave behind" a portion of the amount defined in a UTXO as spent while spending another portion. However, the amount of a UTXO can be split between multiple outputs of subsequent transactions. For example, the amount defined in UTXO0 of Tx0 can be split between multiple UTXOs in Tx1. Therefore, if Alice does not want to give all of the amount defined in UTXO0 to Bob, she can use the remaining portion to make change for herself in the second output of Tx1, or to pay another party.
[0068] In practice, Alice will also typically need to include a fee for the Bitcoin node 104 that successfully includes Alice's transaction 104 in block 151. If Alice does not include such a fee, Tx0 may be rejected by the blockchain node 104, and therefore, although technically valid, may not be propagated and included in the blockchain 150 (if the blockchain node 104 does not want to accept transaction 152, the node protocol does not force the blockchain node 104 to accept it). In some protocols, the transaction fee does not require its own separate output 203 (i.e., no separate UTXO is required). Instead, any difference between the total amount pointed to by input 202 and the total amount specified by output 203 of a given transaction 152 will be automatically provided to the blockchain node 104 that issued the transaction. For example, assume that a pointer to UTXO0 is the only input to Tx1, and Tx1 has only one output UTXO1. If the amount of digital assets specified in UTXO0 is greater than the amount specified in UTXO1, the difference may be allocated (or spent) by the node 104 that wins the proof-of-work race to create the block containing UTXO1. Alternatively or additionally, this does not necessarily preclude the possibility of explicitly specifying a transaction fee in one of the UTXOs 203 in its own transaction 152.
[0069] Alice and Bob's digital assets consist of the UTXO locked to them in any transaction 152 anywhere in the blockchain 150. Therefore, in general, the assets of a given party 103 are scattered among the UTXOs of various transactions 152 throughout the blockchain 150. No single number defining the total balance of a given party 103 is stored anywhere in the blockchain 150. The role of the wallet function of the client application 105 is to collate the various UTXO values locked to the respective parties and not yet spent in other subsequent transactions. To achieve this, it can query a copy of the blockchain 150 stored at any one Bitcoin node 104.
[0070] It should be noted that script code is often represented schematically (i.e., using an imprecise language). For example, an opcode (opcode) may be used to represent a particular function. "OP_..." refers to a particular opcode of the scripting language. For example, OP_RETURN is a scripting language opcode that, when preceded by OP_FALSE at the beginning of a locking script, creates an unspendable output of a transaction that can store data within the transaction, thereby immutably recording the data in the blockchain 150. For example, the data may include a file to be stored in the blockchain.
[0071] Typically, the inputs to a transaction contain a digital signature corresponding to the public key PA. In an embodiment, this is based on ECDSA using the elliptic curve secp256k1. The digital signature signs a specific piece of data. In an embodiment, for a given transaction, the signature will sign part of the transaction input and part or all of the transaction output. Signing a specific part of the output depends on the SIGHASH flag. The SIGHASH flag is typically a 4-byte code included at the end of the signature that selects the output to be signed (and is therefore fixed at the time of signing).
[0072] The locking script is sometimes referred to as "scriptPubKey", which means that it usually includes the public key of the party to which the corresponding transaction is locked. The unlocking script is sometimes referred to as "scriptSig", which means that it usually provides the corresponding signature. However, more generally speaking, in all applications of blockchain 150, the conditions for UTXO redemption do not necessarily include verification of the signature. More generally speaking, the scripting language can be used to define any one or more conditions. Therefore, the more general terms "locking script" and "unlocking script" may be preferred.
[0073] 3. Side Channels
[0074] like Figure 1 As shown, the client application on each of Alice and Bob's computer devices 102a, 120b can include additional communication functionality. This additional functionality enables Alice 103a to establish a separate side channel 107 with Bob 103b (at the instigation of any party or third party). The side channel 107 enables data to be exchanged away from the blockchain network. Such communications are sometimes referred to as "off-chain" communications. For example, this can be used to exchange transactions 152 between Alice and Bob without registering the transaction (yet) on the blockchain network 106 or publishing it on the chain 150 until one of the parties chooses to broadcast it to the network 106. Sharing transactions in this way is sometimes referred to as sharing "transaction templates". The transaction template may lack one or more inputs and / or outputs required to form a complete transaction. Alternatively or additionally, the side channel 107 can be used to exchange any other transaction-related data, such as keys, negotiation amounts or terms, data content, etc.
[0075] The side channel 107 may be established via the same packet switching network 101 as the blockchain network 106. Alternatively or additionally, the side channel 301 may be established via a different network such as a mobile cellular network or a local area network such as a wireless local area network, or even via a direct wired or wireless link between Alice's and Bob's devices 102a, 102b. In general, a side channel 107 referred to anywhere in this document may include any one or more links via one or more networking technologies or communication media that are used to exchange data "off-chain", i.e., off-chain. The bundle or collection of off-chain links may be referred to as a side channel 107 as a whole. Therefore, it should be noted that if Alice and Bob are said to exchange certain information or data, etc., via a side channel 107, this does not necessarily mean that all of this data must be sent over exactly the same link or even the same type of network.
[0076] 4. Cryptographic primitives
[0077] 4.1 Elliptic Curves
[0078] In general, embodiments described herein may use any suitable elliptic curve. For example, embodiments may use an elliptic curve (EC) of the form
[0079] y 2 =x 3 +ax+b mod p
[0080] This form is in the prime domain On, where Δ: = -16(4a 3 +27b 2 )≠0modp. An example of such a curve is secp256k1 (used in Bitcoin). The order of this curve is denoted by n.
[0081] Point P on the elliptic curve The multiplication of is represented as a·P, which is defined as:
[0082] a·P=P+P+…P
[0083] where + is elliptic curve addition. It should be noted that from here on the sign mod n is omitted and all arithmetic operations on integers are assumed to be performed modulo n.
[0084] 4.2 Digital Signature
[0085] In a digital signature setting, each party has its own private signing key for signing, and a corresponding public verification key for signature verification. Digital signature schemes include four polynomial time algorithms:
[0086]
[0087] Generates compliance with security parameters The global parameter param.
[0088] KeyGen(param):
[0089] Generate private key sk.
[0090] A verification public key vk is derived from this private key and published to all parties.
[0091] Sign(m,sk;r)
[0092] Sign the message m and use the signature private key sk and randomness r to obtain the signature σ.
[0093] Verify(m,σ,vk)
[0094] If the signature σ is a valid signature on the message m, it outputs 1, which means it was computed using the private key corresponding to the public key vk. Otherwise, it outputs 0.
[0095] An algorithm is called a polynomial time algorithm if its running time is bounded by a polynomial expression in the size of the input to the algorithm: This is often necessary to implement the actual algorithm.
[0096] 4.3 Public Key Infrastructure
[0097] Public key cryptography (PKC) has largely enabled secret sharing in symmetric key settings. However, there is still the problem of how to guarantee that the public key of a party (e.g., Alice 103a) really belongs to Alice. If that public key is inadvertently damaged, or if any malicious party is able to replace Alice's public key with their own, they will be able to decrypt all messages sent to Alice. If the malicious party then encrypts the message using Alice's real public key, she will never notice anything is wrong. The malicious player can be passive and only read the message, or they can change the message completely or partially. This attack is called a man-in-the-middle attack. Any other party cannot easily distinguish between Alice's real key and the malicious player's key. Typically, Alice's public key PKC is a private key that is encrypted with Alice's real key. Alice A random string of at least 256 bits. For 128-bit AES security, the public key size is 256 bits for elliptic curve based schemes, or 3072 bits for RSA schemes (signing or encryption). Other schemes can use keys of different sizes.
[0098] To solve this problem, Public Key Infrastructure (PKI) is often used. A digital certificate consisting of a message containing Alice's public key and Alice's identifier is created by a certification authority (CA). The digital certificate is then hashed and signed by the CA. The certification authority is a trusted third party whose public key is known and fully trusted by all members of the party. Therefore, a member of any party can easily verify that the certificate is indeed signed by the CA. The CA is responsible for ensuring that Alice's public key does belong to Alice. If Alice can prove that her public key is associated with her using a certificate issued by a known CA, she can receive encrypted messages using her public key, as well as issue certificates to other players.
[0099] Browsers come pre-installed with certificates from numerous CAs. All of these certificates act as a root of trust for any https server. If the certificate presented by the server does not have a valid root of trust for the CA, the browser will warn the user that it cannot verify that the certificate belongs to the https server being accessed.
[0100] The known certificate standard is the x.509 standard, which includes the following fields:
[0101] ●Certificate version
[0102] ●Validity period (start date and end date)
[0103] ●Certificate Issuer
[0104] ●Public key type, length and value
[0105] ●Purpose (whether the certificate can be used to sign other certificates)
[0106] ●Hash types and values, etc.
[0107] ●Theme
[0108] Assume that Alice's private key has been leaked during its validity period. The CA needs to remind other users not to use the corresponding public key. One way to do this is to have a certificate revocation list. This is a blacklist of all revoked certificates maintained by the CA.
[0109] In reality, the authentication protocol may involve many authentication entities, namely: Registration Authority, Revocation Authority, Root Certification Authority, Certification Authority. Each entity has a designated role. The complexity of this architecture can lead to many security vulnerabilities. This architecture is best avoided and can be implemented using identity-based encryption.
[0110] 4.4 Identity-based Signatures
[0111] An identity-based signature is a digital signature that requires only the message, the identity, and some public information to verify the validity of the signature. This is in contrast to standard digital signatures, where each signer requires an attached personal verification public key. The original purpose of identity-based setups was to avoid the need for CAs while not being vulnerable to attacks such as man-in-the-middle attacks.
[0112] In identity-based encryption, an identity can be any bit string. The original idea of replacing PKI with identity-based encryption was to identify any user with a unique bit string. A good example of an identity is an email address, a phone number, or a social security number. The latter is not as practical as an everyday identity and tends to reveal private information, but can be used for national identification: for example, it can be used for taxation, social security matters, etc.
[0113] Identity-based encryption is very flexible in the definition of identity, so it has many indirect applications, including: unintentional transmission, blind IBE, IBS from hierarchical IBE, malicious IBS (and IBE), wildcard IBS (and IBE), attribute-based encryption, etc.
[0114] There are multiple ways to implement identity-based signatures. For example, one such scheme is called Hierarchical Identity-Based Encryption (HIBE). The advantage of this technique is that it provides security proofs in the standard model (especially using the BBG structure). The main disadvantage of using HIBE is the use of bilinear maps, which is a powerful computational mechanism and also a computationally intensive mechanism. Most schemes utilize bilinear maps, which are computationally intensive functions. An alternative that can be used in some embodiments is described in the following document, "A Schnorr-Like Lightweight Identity-Based Signature Scheme" by D. Galindo and FD Garcia, published in Africacrypt, Gammarth, 2009. Their structure avoids the use of bilinear maps, is based on double Schnorr signatures, and is secure in the random oracle model.
[0115] 4.5 Key Escrow
[0116] IBS algorithms usually involve a private key calculated based on a master secret key msk by a trusted third party, a private key generator (PKG). The private key, also called the user secret key, is then passed to the user. There is no guarantee that the private key will not be used later by the PKG. In addition, it can be recreated at will. If the msk used to create the party's private key is leaked, a thief can even create a new key for an identity that already has the user secret key. This all-powerful entity is called a key escrow. Even if the PKG is trusted, it is a single point of failure from the attacker's perspective. It is worth noting that key escrow is sometimes seen as a function of government or law enforcement because it provides them with a window into the secrets of criminals.
[0117] However, being able to create encryption or signing algorithms that avoid this key escrow remains an important challenge. There have been several attempts to avoid this key escrow, for example, using multiple separate PKGs or having users participate in key generation. The former is susceptible to PKG collusion, while the latter results in each user identity requiring additional information to be verified (or encrypted in IBE). Therefore, the latter scheme is no longer identity-based: the additional information is actually the public key. As mentioned above, identity-based encryption means that the identity and the public parameters are sufficient to encrypt the message. The additional information added for each identity is not a public parameter and is not part of the identity. Therefore, this scheme is not identity-based.
[0118] However, key escrow can be avoided in a suitable way by using a Hardware Security Module (HSM), which stores the master secret key in a way that outsiders cannot influence the key or any calculations. This HSM then generates user secret keys in an isolated environment.
[0119] 5. Verification of non-native signatures
[0120] Embodiments of the present disclosure relate to the verification of non-native blockchain signatures. A native signature is a signature used to sign a transaction according to a blockchain protocol. For example, in Bitcoin, the native signature scheme is the Elliptic Curve Digital Signature Algorithm (ECDSA). Native signatures ensure the integrity of signed transactions because the blockchain scripting engine, when verifying the signature, constructs a message based on the spent transaction (in some cases, based on the spent transaction) and verifies that the signature is a valid signature for the constructed message. Most blockchain protocols have dedicated functions (e.g., opcodes) for verifying native signatures.
[0121] The non-native signature scheme differs from the native signature scheme in that a valid transaction does require a non-native signature. Similarly, verifying a non-native signature does not cause the script engine to construct a candidate message based on the spending data and verify the non-native signature based on the constructed message.
[0122] Figure 3 An exemplary system 300 for using and verifying non-native signatures is shown. The system 300 includes a first party (Alice 103a), a second party (Bob 103b), and one or more nodes 104 of a blockchain network 106. In some embodiments, the system 300 also includes a key generator 301. It should be noted that the first party and the second party are referred to as Alice 103 and Bob 103b, respectively, which is merely for convenience. More generally, the first party can be configured to perform a reference Figure 1 and Figure 2 Some or all of the actions described above are performed by Alice 103 and / or Bob 103. Similarly, the second party may be configured to perform the actions described above. Figure 1 and Figure 2 Some or all of the actions described are performed by Alice 103 and / or Bob 103.
[0123] Bob 103b is configured to generate a first transaction with an output (and an associated locking script) that requires two signatures to unlock. The first of these signatures must belong to a signature scheme native to the blockchain, such as ECDSA (for Bitcoin). The first signature scheme can use a private key and a public key, where the private key is an integer and the public key is an elliptic curve point. Other blockchains may have different native signature schemes. The native signature ensures the integrity of the signed message, which is based on at least a second transaction that spends (allocates) the output of the first transaction. The locking script includes a first verification script configured to verify the native signature. The script engine (e.g., operated by node 104) is configured to construct a candidate message based on at least the second transaction when executing the first verification script, and verify whether the native signature is valid for the candidate and the public key. The public key corresponds to a private key set to the number one. Therefore, the native signature needs to be generated using a private key set to equal the number one. The public key can be included as part of the first verification script. Alternatively, the public key can be included in the unlocking script of the second transaction. In an example where the native signature is ECDSA, the first verification script is configured to verify the ECDSA signature. For example, the first verification script may include at least one of the following: an OP_CHECKSIG opcode, an OP_CHECKSIGVERIFY opcode, an OP_CHECKMULTISIG opcode, and an OP_CHECKMULTISIGVERIFY opcode.
[0124] The second signature belongs to a different non-native signature scheme. In general, the second signature can belong to any signature that can be verified within the script. The second signature scheme can use an integer as a private key and an elliptic curve point as a public key. Alternatively, the private key and the public key can take different forms. The second verification script is configured to verify the second signature based on the first signature or a message including the first signature. More precisely, the script engine is configured to verify whether the second signature is a valid signature for the message based on the first signature when executing the second verification script.
[0125] Bob 103b is configured to cause the first transaction to be submitted to the blockchain network 106. For example, Bob 103b may submit the first transaction to the blockchain network 106. Bob 103b may also send the first transaction to Alice 103a.
[0126] Turning now to Alice 103a, Alice 103a is configured to obtain (e.g., generate or receive) a second transaction having an input that references an output of the first transaction. Alice 103a generates a native signature based on the second transaction (in some examples, based on the first transaction). The private key used to generate the native signature is set equal to one, so that the generation and verification of the native signature is computationally efficient. The private key is also referred to herein as the "first private key". In some examples, such as when the signature is an ECDSA signature, the temporary key used to generate the native signature is also set equal to one. Alice 103a then generates a second signature, where the signed message is based on the first signature. The first signature and the second signature are included in the unlocking script of the input of the second transaction. Alice 103a then submits the second transaction to the blockchain network 106, or submits it to a different entity (e.g., Bob 103b) to submit to the blockchain network 106.
[0127] In some examples, the second signature scheme is an identity-based signature scheme. Any suitable identity-based signature scheme can be used. In these examples, the second verification script is configured to verify whether the second signature is a valid identity-based signature.
[0128] As part of the identity-based signature scheme, Alice 103a may have an identifier. Alice's identifier may include one or more of the following: her name, address, date of birth, email address, username, passport number, driver's license number, national insurance number, etc. Alice 103a also has a user private key. The user private key is generated based on Alice's identifier. The user private key is also referred to as a "second private key" in this article. In some examples, Alice 103a generates her own user private key. In other examples, Alice's user private key is generated by the key generator 301. For example, Alice's user private key can be generated based on a master private key known only to the key generator 301. Alice 103a can also control the master private key used to generate its user private key. In some examples, Alice 103a also has a user public key. The user public key may include one or more public parameters of the signature scheme, for example, as described in Section 6.1.
[0129] Alice 103a can be configured to generate an identity-based signature based on the first signature, her identifier, and her user private key. In some examples, the identity-based signature is also based on her user public key. The second verification script can be configured to verify the identity-based signature based on Alice's identifier and the first signature. In some examples, the user public key may also be required to verify the identity-based signature. At least one of the identifier and the user public key may be included in the locking script of the first transaction. Similarly, at least one of the identifier and the user public key may be included in the unlocking script of the second transaction. When the identifier is included in the unlocking script of the second transaction, the second verification script can be configured to verify whether the identifier is included in the unlocking script, for example by hashing the identifier and verifying whether the identifier matches the hash of the identifier in the second verification script.
[0130] As described above, the user public key includes one or more public parameters. These parameters may include a prime number (p), an elliptic curve point generator (P) with an order of the prime number, a first hash function (H1), and a second hash function (H2). The user public key may include one or more additional parameters. The user private key can be generated by calculating a first random value (r), and then using the first random value and the generator to calculate a first elliptic curve point, for example, R=r·P. The first elliptic curve point is the first value of the user private key. Then, the second value of the user private key is generated based on the first elliptic curve point, the master secret key (z), and the first hash generated by hashing the first value of the user private key and the first identifier (id) using a first hash function (for example, y=r+z×H1(R||id) mod p). Then, the user private key uses usk id =(y, R). It should be noted that "first", "second", etc. are used only as labels and do not necessarily imply an order. As discussed, the user private key can then be generated by Alice 103a or the key generator 301, depending on who controls the master secret key.
[0131] The identity-based signature may include three values, referred to as signature values. The first signature value may be calculated based on the second random value (a) and the generator, such as A=a·P. The second signature value may be calculated based on the second random value, the first value of the user's private key, and the second hash obtained by hashing the first identifier, the first signature value, and the first signature (m), such as b=a+y×H2(id||A||m). The third signature value is equal to the first value of the user's private key. Then, the identity-based signature takes the form of σ=(A, b, R).
[0132] The second verification script can be configured to verify the identity-based signature in the following manner: calculating a first verification value and a second verification value, each of which is based on the signature of the identity; and determining whether the values are equal. The first verification value is calculated based on the first signature value (σ1), the first hash (c), and the second hash (d). The first hash is calculated by hashing the third signature value (σ3) and the first identifier using a first hash function, for example, c=H1(σ3||id). The second hash is calculated by hashing the first identifier, the first signature value, and the first signature using a second hash function, for example, d=H2(id||σ1||m). The second verification value is calculated based on the second signature value and the generator, for example, σ2·P. Then, the first signature value is calculated as σ1+d·(σ3+c·Z).
[0133] In some examples, the locking script of the first transaction may require the unlocking script of the second transaction to contain multiple identity-based signatures, each identity-based signature generated by a different party based on a different identifier and user private key. This can achieve multi-signature outputs, as discussed in Section 6.4 below. More generally, the locking script of the first transaction may require the unlocking script of the second transaction to contain multiple second signatures, each second signature generated by a different party.
[0134] The second signature may belong to a signature scheme other than an identity-based signature. For example, the second signature may be a Schnorr signature or a Rabin signature. Those skilled in the art will be familiar with how to generate and verify Schnorr signatures and Rabin signatures. Exemplary algorithms for such generation and verification are provided in Section 6.3 below. As another example, the second signature may be a quantum-resistant signature. Any suitable quantum-resistant signature may be used, including one of the examples provided in Section 6.3.1 below.
[0135] 6. Exemplary Implementation
[0136] This section describes how identity-based signatures (IBS) can be used on a blockchain (e.g., the Bitcoin blockchain) to implement several features that are difficult to build without IBS. Namely:
[0137] Identity-based transactions: avoid the need for PKI (in Bitcoin) and enable “payment-to-identity” transactions
[0138] Rights delegation: The right to unlock outputs can be delegated even after the outputs are published
[0139] Dynamic multi-signature: A multi-signature where new signers can be added after the script is created. A multi-signature is a locking script that can be unlocked by providing n signatures corresponding to the public keys listed in the locking script (which can be n out of m).
[0140] The following protocol is based on Galindo-Garcia's Schnorr-like IBS because it avoids the use of bilinear maps and can be verified within the script. In addition, the scheme can utilize ECDSA private keys to implicitly authenticate users.
[0141] In some use cases, a trusted entity called a private key generator (PKG) is required to create private keys for any user. This creates key escrow, which is inherent to identity-based encryption. Key escrow becomes problematic when the primary requirement of the application is to avoid PKI. The problem can be solved by splitting the key escrow entity into multiple entities and creating threshold keys. If these entities do not collude, the technique remains secure. Alternatively, running key generation within an HSM can make this entity autonomous and therefore less susceptible to compromise.
[0142] To protect IBS (without changing the Bitcoin protocol), embodiments utilize so-called "dummy signatures". This approach can be generalized to allow any signature to be securely verified within a script, including Rabin signatures, Schnorr signatures, and quantum-resistant signatures. The latter would result in quantum-resistant transactions.
[0143] IBS is a signature scheme consisting of four algorithms:
[0144] Setup will set the security parameters As input. This returns the master secret key msk and the master public key mpk. msk is a strong secret that the key escrow can hold. mpk is a set of public parameters.
[0145] KeyGen takes mpk, msk and identity id as input. This returns the user secret key usk id .
[0146] Sign the identity id, message m, mpk and user secret key usk id As input, this returns a signature σ over the message m.
[0147] Verify takes as input mpk, m, id, and σ. If the signature is valid (on m, and represented as id), it returns 1. If the signature is invalid, it returns 0.
[0148] Galindo et al. describe a scheme that can be used to instantiate IBS directly into Bitcoin Script. Most other IBS schemes that exist in the literature also work, but cannot achieve the same efficiency when implemented inside a script. This is because the computation of a function called pairing does not exist in Galindo's scheme.
[0149] 6.1 Schnorr-like IBS scheme
[0150] This section describes Galindo's scheme in the context of elliptic curves. We now describe the scheme using addition notation.
[0151] - The security parameters as input.
[0152] Select a group G and a corresponding point generator P of prime order p.
[0153] Choose two different hash functions These hash functions are different in order to achieve unforgeable security in the random oracle model.
[0154] Random Selection And calculate Z=z·P.
[0155] Set msk=z and k=(G, P, p, Z, H1, H2).
[0156] Returns the master secret key and master public key: (msk, mpk).
[0157] -KeyGen(mpk, msk, id): select a random number
[0158] Calculate R=r·P.
[0159] Calculate y=r+z×H1(R||id)mod p.
[0160] Return to usk id =(y, R). It should be noted that R is not a secret and will be present in any signature of that user.
[0161] -Sign(id, m, uskid, mpk): select a random number
[0162] Calculate A=a·P.
[0163] Calculate b=a+y×H2(id||A||m).
[0164] Return σ = (A, b, R).
[0165] -Verify(mpk,m,id,σ): resolve σ to (σ1, σ2, σ3)
[0166] Check whether σ2·P=σ1+d·(σ3+c·Z) where d=H2(id||σ1||m) and c=H1(σ3||id)
[0167] If the equation holds true, it returns 1.
[0168] Otherwise returns 0.
[0169] In identity-based schemes, the public parameters are usually randomly generated, and the user's private key is derived from the public key. In classic public-key schemes, the opposite is true: first the private key is generated, and then the public key is derived from it.
[0170] Compared to other IBS, this scheme is computationally very efficient since no bilinear mapping needs to be computed. In addition, this scheme also enables signature verification to be done efficiently within the script.
[0171] The identity-based signature scheme has been proven to be secure in the random oracle model (ROM) under the discrete logarithm problem (DLP).
[0172] One advantage of choosing this IBS is that it can be efficiently verified within the script compared to pairing-based IBS instantiations. Table 1 shows the cost of verifying the IBS according to the script size.
[0173] Verify Operation Operation Type Script size (approximate) (c·Z) Fixed-point scalar multiplication 700KB <![CDATA[(σ3+c·Z)]]> Point Addition 2.5KB <![CDATA[d·(σ3+c·Z)]]> Scalar multiplication 1.3MB <![CDATA[σ1+d·(σ3+c·Z)]]> Point Addition 2.5KB <![CDATA[σ2·P]]> Fixed-point scalar multiplication 700KB Verify(mpk,m,id,σ) All of the above 2.7MB
[0174] Table 1: Opcode cost for IBS verification
[0175] 6.2 Virtual Signature
[0176] In Bitcoin, digital signatures that are not verified by OP_CHECKSIG cannot directly provide the integrity of transaction data, especially the integrity of outputs. This applies to the above-mentioned IBS. To solve this problem, so-called virtual signatures were introduced to enhance the security of IBS in (Bitcoin) transactions. This technology can be generalized to any other type of digital signature and other blockchains, not just Bitcoin.
[0177] 6.2.1 How to use IBS to sign in script
[0178] The opcode OP_CHECKSIG forces the script verification engine to look at almost the entire transaction. This is the only opcode that gets data from a spend transaction (along with a few other related opcodes, including OP_CHECKSIGVERIFY, OP_CHECKMULTISIG, and OP_CHECKMULTISIGVERIFY). This ensures the integrity of the transaction data, so signatures cannot be replayed in different transactions. For example, a pay-to-public-key-hash (P2PKH) locking script specifies that the next unlocking script needs to include the signature of the transaction. The opcode OP_CHECKSIG in P2PKH uses the public key to verify the signature, which once hashed is the value specified in the locking script. The signed message includes (but is not limited to) the transaction version, inputs, and outputs (for SIGHASH_ALL) of the spend transaction. This ensures that signatures cannot be reused in different spend transactions, so replay attacks are impossible. For example, in a replay attack, if two unlocking scripts need to be signed by the same user, and one of the unlocking scripts has already unlocked, the attacker can take the identity-based signature portion of the unlocking script from the first transaction and put it into the unlocking script of the second transaction. Since IBS does not include any fields of the transaction, the attacker can put anything they want into the second transaction.
[0179] The challenge is to make IBS non-replayable. The next paragraph and Figure 4A and Figure 4B The method for calculating the signature is described in . Under IBS, the same fields of a transaction that are used for the ECDSA signature verified by OP_CHECKSIG must be immutable. This enables the signature to be linked to that specific transaction. Since OP_CHECKSIG takes a spend transaction as input, it must be included in the script.
[0180] The signature that will be verified by OP_CHECKSIG will be a dummy signature. The signature is a dummy signature because it provides integrity of the transaction data but not authenticity. This technique uses a dummy signature (verified by OP_CLARKTIG) to ensure the integrity of the transaction data and uses IBS to ensure the integrity and authenticity of the dummy signature. Therefore, the transaction data will have both authenticity and integrity.
[0181] The actions taken by the signer are as follows:
[0182] 1. Generate a dummy signature: Create an ECDSA signature on the transaction using randomness and a private key equal to 1,
[0183] 2. Use IBS to sign the virtual signature,
[0184] 3. Include the IBS signature (along with Id, mpk (if not reserved) and dummy signature) in the unlock script.
[0185] That is, the signer generates Sign IBS (id, Sign ECDSA (transaction, sk=1, k=1), usk id , mpk).
[0186] Here's how verification works:
[0187] 1. Use OP_CHECKSIG to verify the virtual signature,
[0188] 2. Verify the IBS signature on the virtual signature.
[0189] The locking script will take the following form:
[0190] DumSig Verification: OP_DUP OP_CHECKSIGVERIFY. This script verifies that DumSig is the signature of the transaction computed using a dummy signing key equal to 1. Here P is the generator of the group and does not depend on the identity of the recipient of the transaction.
[0191] IBS Verification: <ida>OP_SWAP <mpk>[Verify] This script verifies that the IBS is a valid IBS generated by the identity IdA on the message DumSig according to the public parameters mpk.
[0192] The unlocking script will take the following form:
[0193] <SigA>:valid IBS generated by IdA on DumSig
[0194] <DumSig>: A valid dummy signature on a transaction
[0195] In these examples, the virtual signature is an ECDSA signature. This signature is fast to compute and can be computed by anyone.
[0196] It should be noted that the message signed by the IBS (virtual signature) can be extended to include arbitrary data. This enables the user to sign a portion of the unlocking script (excluding the IBS itself). This enables conditional payments on authenticated messages. This extension is used in the general context below.
[0197] 6.3 Generalized Virtual Signature
[0198] The dummy signature technique described in the previous section can be applied to any type of signature that can be verified within a script without OP_CHECKSIG. Assume that represents an arbitrary signature scheme ∑. For IBS, the approach is to use a dummy signature as the message to be signed by ∑ or a part of that message. Figure 5A and Figure 5B This is shown in .
[0199] 6.3.1 Quantum-safe Bitcoin
[0200] In the unlikely event that the discrete logarithm problem (DLP) becomes a simple problem, ECDSA will no longer be secure. This would occur if an efficient quantum computer were to become available. However, variations of the virtual signature technique could be used to secure transactions with different signatures ∑ (e.g., quantum-resistant digital signatures) that remain secure.
[0201] In ECDSA, there are two key elements sk and k. In the dummy signature, k and sk are set to 1. Verification of the signature implicitly verifies that sk = 1. In the version provided above, the script does not verify that k = 1. If DLP were easy, this would be a problem. In fact, in ECDSA, s = k -1 ·(H(m)+r·d A ), and r is from g k If k is not fixed and DLP is easy, then the signature ∑ of transaction m′ can be reused to spend a new transaction m using a similar locking script:
[0202] r is set to H(m′)-H(m).
[0203] k is calculated from r using the efficient DLP algorithm (this is because DLP is considered easy here).
[0204] DumSig is usually calculated using the created k and r.
[0205] ∑ Copied from m''s spending transaction to m's spending transaction.
[0206] There are two different ways to prevent this:
[0207] Make node 104 calculate the virtual signature part and extract the virtual signature ∑ from the unlocking script.
[0208] Verify in advance whether the first part r of the virtual signature is calculated correctly, for example r = x mod p, where x is the first coordinate of P.
[0209] By fixing k and sk, the virtual signature is no more than a double SHA256 hash, which can be verified within the script. SHA256 is not affected by quantum algorithms, which means that if ∑ is quantum resistant, the technique is quantum resistant. Quantum resistant signatures themselves are well known and any suitable scheme can be used. See, for example, L Ducas, E. Kiltz, T. Lepoint, V. Lyubashevsky, P. Schwabe, G. Seiler, and D. Sthehlé, "CRYSTALS-Dilithium: A Lattice-Based Digital," in IACR Transactions on Cryptographic Hardware and Embedded Systems, 2017; "Falcon: Fast-Fourier Lattice-based" by T. Prest, P.-A. Fouque, J. Hoffstein, P. Kirchner, V. Lyubashevsky, T. Pornin, T. Ricosset, G. Seiler, W. Whyte, and Z. Zhang; and "Rainbow, a New Multivariable Polynomial" by J. Ding, M.-S. Chen, A. Petzoldt, D. Schmidt, B.-Y. Yang, M. Kannwischer, and J. Patarin.
[0210] 6.3.2 Rabin Signature:
[0211] This section describes the Rabin signature, which can use a virtual signature to provide transaction data integrity. The size of the locking script to verify the Rabin signature is very small, because it only requires a few arithmetic operations (addition, multiplication, and hashing) on large numbers. The script size to verify the Rabin signature is about 5 bytes.
[0212]
[0213] 1. Choose a hash function
[0214] KeyGen(param):
[0215] 1. Select the size Two random prime numbers p and q
[0216] 2. Choose a random number b∈[1;p·q]
[0217] 3. Output sk = (p, q) and pk = (p·q, b)
[0218] Sign(m,sk;r):
[0219] 1. Choose a random padding U of m (m is a virtual signature)
[0220] 2. Solve x(x+b)=H(mU)
[0221] 3. If there is no solution, go to step 14. Output signature σ = (U, x)
[0222] Verify(m,σ,vk):
[0223] 1. Calculate x(x+b) and H(mU)
[0224] 2. If they are equal, then output 1, otherwise output 0
[0225] 6.3.3 Schnorr Signatures
[0226] Another scheme that can be used with virtual signatures is Schnorr signatures. Schnorr signatures have many direct applications, such as group signatures, threshold signatures, blind signatures, and multi-signatures. Schnorr signatures can also be aggregated and verified in batches with a single verification. This last application (multi-signatures) is the motivation for changing the Bitcoin protocol to enable Schnorr signature verification within scripts. The techniques described in this article provide secure use and verification of Schnorr signatures without changing the Bitcoin protocol.
[0227]
[0228] 1. Choose a hash function
[0229] KeyGen(param):
[0230] 2. Random Selection And calculate Z = z·P
[0231] 3. Output sk = z and pk = Z
[0232] Sign(m,sk;r):
[0233] 5. Choose a random number
[0234] 6. Calculate R = r·P, e = H(R||m) and s = r-ze
[0235] 7. Output signature σ = (e, s)
[0236] Verify(m,σ,vk):
[0237] 3. Calculate r′=s·P+e·Z and e′=H(r′||m)
[0238] 4. If e = e', then output 1, otherwise output 0
[0239] The script size for verifying a Schnorr signature is about 1.4MB (2 fixed scalar multiplications and 1 point addition).
[0240] 6.4 Application
[0241] The IBS private key or user secret key is a signing key embedded in immutable information. This information is created to define an entity. However, it can be any bit string. If the signature verification passes, it guarantees to the verifier that the message really came from the entity whose identity is represented by the bit string.
[0242] There are multiple ways to use IBS (in Bitcoin), each of which leads to different applications. The following two methods are described here:
[0243] In one case, a universal system is set up where everyone shares the same master public key. This means that only one master secret key can be held by one entity (leading to key escrow already discussed above). This set up avoids the use of a public key infrastructure, which carries a huge communication and computational burden.
[0244] In another scenario, individuals have their own IBS scheme. In this context, any user can use their ECDSA signing key as the master secret key and use their verification key to construct the master public key. This leads to a variety of applications, including the two described below: certification authority delegation and dynamic multi-signature.
[0245] 6.4.1PPID and P2IDH
[0246] This section describes a transaction template that can be used to avoid using IBS PKI. See Table 2 and Table 3, where the locking script is represented as Pay to ID (P2ID). As with P2PKH, the identity of the transaction recipient may not be included in the locking script. Its hash may be included in the locking script, and the identity may be included in the unlocking script. In this article, this is called Pay to Identity Hash (P2IDH). This is shown in Table 4 and Table 5.
[0247]
[0248] Table 2: Payment-to-identity transactions (mpk,m,idσ) to Alice (IdA)
[0249]
[0250] Table 3: Transactions spent by Alice (IdA) using IBS
[0251]
[0252] Table 4: Payment to Identity Hash Transaction to Alice (IdA)
[0253]
[0254] Table 5: Alice (IdA) spends transactions using identity hashes in IBS
[0255] 6.4.2 Rights delegation
[0256] Any entity can act as a PKG to delegate its signing rights to others. In this use case, key escrow becomes a feature. Even after the locking script is created and a transaction containing the locking script is published, a new private key can be generated and provided to the principal to unlock the output. The next section describes the case of delegation of certification revocation rights. More precisely, in this example, a valid certificate is represented by a UTXO on the blockchain. A certification authority with its own signing key needs to handle a large number of operations. In a normal PKI environment, there are multiple entities that play different roles in the certification protocol: registration authority, certification authority (CA), revocation authority (RA). All of these entities can be replaced by a root certification authority that can hold multiple public key infrastructure instances. Using the IBS technology described in this article, the root CA can create user secret keys for any entity whose identity reflects its role. Figure 6 An example is shown in which the revocation authority RA1 is entrusted with the right to revoke a certificate. The working principle is as follows:
[0257] 1. The certification authority CA creates a (mpk, msk) pair by using its ECDSA signing key as msk (which means that the Z in mpk is equal to the CA’s ECDSA verification key)
[0258] 2. The certification authority CA uses its master secret key msk and identity Id RA1 "CA's revocation authority|RA1" creates a user secret key usk for the revocation authority RA1
[0259] 3. Then pass usk to RA1
[0260] 4. Once a transaction needs to be spent in order to revoke the certificate, RA1 generates a signature (IBS+DumSig) on the transaction and sends the signature and its identity ID RA1 Include in unlock script
[0261] 5. If Id RA1 Start with "CA's Revocation Authority" and the signature is valid, the transaction will be valid and accepted. Therefore, the certificate is revoked.
[0262] The information in the identity enables or disables different types of actions (here, only the entity responsible for certificate revocation can spend the transaction). In addition, the master public key of these delegated entities includes the CA's verification key, which allows directly linking child entities with parent entities.
[0263] Table 6 shows a locking script for a transaction where the spending of a certificate can be delegated to a revocation authority. In this example, a special template is used to identify the identity as a revoked identity. In practice, any format of identity will work as long as it is publicly known. To spend a UTXO, the unlocking script should contain any (Sig, Id, DumSig) such that
[0264] 1.Sig according to Id and Verify as mpk
[0265] 2. The ID starts with "CA revocation authority"
[0266] 3. DumSig is a valid virtual signature for the transaction. This is described in Tables 6 and 7.
[0267]
[0268] Table 6: Locking script for delegation certificate revocation transaction
[0269]
[0270] Table 7: Unlocking script for spending certificates using delegated permissions
[0271] 6.4.3 Dynamic Multi-Signature
[0272] The opcode OP_CHECKMULTISIG allows to allocate a transaction output with n out of m signatures of the PK owner specified in the locking script. However, this opcode is not dynamic, so the public key (and therefore the private key) must be generated when the locking script is created.
[0273] A PKG creates keys for all users in a multi-signature group and creates templates for these identities, providing an efficient way to implement multi-signature. It creates key escrow, but since multi-signature can be used between entities in the same company or between subordinate entities, this is not a problem.
[0274] Here, multi-signature based on IBS is called n-multi-signature under k conditions. The conditions are restrictions on identities. For example, this section describes the case of 1-multi-signature under 2 conditions:
[0275] ■Condition 1: Be part of nChain
[0276] ■Condition 2: Be a researcher.
[0277] To facilitate conditional verification, a template of the form: "Country||Company||Title||Last Name||First Name", so an identity could be "France||nChain||Researcher||Germouty||Paul". Using this example template, a multi-signature could be created for any researcher at nChain by enforcing the identity to have fields 2 and 3 as "nChain" and "research", respectively. This is illustrated by the transaction templates in Tables 8 and 9.
[0278]
[0279] Table 8: Example of a researcher’s locking script to nChain (using dynamic multi-signature)
[0280]
[0281] Table 9: Example of unlocking script from nChain researchers (using dynamic multi-signature)
[0282] In the general environment, there is an n-multi-signature with k conditions. This means that n signatures are required and a regular expression in the script is used to enforce k different conditions on the identity. Therefore, a signature will be accepted if and only if the number of signatures is n and the identity of each signer satisfies k conditions. This is shown in the general template transaction in Tables 10 and 11:
[0283]
[0284] Table 10: Locking script for dynamic n-multisignatures with k allocation conditions
[0285]
[0286] Table 11: Unlocking script for n-multi-signatures with dynamic allocation under k conditions
[0287] The size of the locking script grows linearly with the size of n, not k. In practice, n verifications need to be performed on the IBS. Each signature requires a set of opcodes; therefore, the size of the locking script will grow linearly with the size of n. In contrast, the number of conditions to verify has little effect on the size of the locking script: a string comparison is performed in any case, and the number of conditions only increases the number of equality checks in the bit-to-bit verification.
[0288] In the case where the locking script size is fixed, the possible number of signers is infinite: in the example above, nChain's researcher condition holds for any number of identities the PKG wants, since the PKG can create identities at will.
[0289] It can be thought that an institution in a PKI environment could do the same thing by distributing the same public key to each user in the multi-signature and having each user sign directly with the public key. However, this has two main problems: 1) there is no way to know which user signed; 2) it is not flexible and not scalable; but in the example above, different conditions can be generated for the multi-signature, which can be everyone from nChain, everyone from nChain located in France, etc.
[0290] As mentioned before, the multi-signature scheme described in this paper is dynamic: any user can be added to the set of authorized signatures if the PKG generates a valid user secret key and transmits it to any user. This can be done even after the locking script has been created.
[0291] CA delegation can be considered a special case of dynamic multi-signature. For the above revocation example, it can be considered as 1-multi-signature under 1 condition. The condition is: the first part of the identity is "can be revoked by CA".
[0292] 6.5 Efficiency comparison
[0293] This section compares identity-based signatures (as used in Bitcoin) with other IBS schemes. Efficiency is described using multiplication notation, ignoring the Multiplication and addition in .
[0294] BBG IBS (D. Boneh, X. Boyen, and E. Goh, "Hierarchical Identity Based Encryption with Constant Size Ciphertext", EUROCRYPT, Aahrus, 2005) is based on bilinear maps and is secure in the standard model under the bilinear Diffie-Hellman problem. It is an adaptation of IBS by Hierarchical Identity-Based Encryption (HIBE) (ASCraig Gentry, "Hierarchical ID-based cryptography", ASIACRYPT, Queenstown, 2002).
[0295] The other three schemes are secure in a more flexible model called the random oracle model. This model is reasonable due to the core use of hash functions in these schemes. GS IBS is another adaptation of HIBE to IBS (based on one of the first HIBEs created). It is secure under Constructive Diffie Hellman (CDH). GG IBS (D. Galindo and FD Garcia, "A Schnorr-Like Lightweight Identity-Based Signature Scheme", Africacrypt, Gammarth, 2009) is the scheme used to instantiate IBS in Bitcoin, as described in this paper. It does not use bilinear maps and is secure under the discrete logarithm problem (DLP).
[0296] Table 14 compares ECDSA to a virtual signature scheme. The efficiency is significantly different due to the simplifications made with virtual signatures. The signing time is negligible from a construction perspective. Besides that, in P2PKH the signer’s public key needs to be included in the unlocking script, which is not needed for virtual signatures since it is always equal to the generator P and is therefore implicit.
[0297]
[0298] Table 13: IBS efficiency comparison
[0299]
[0300] Table 14: Comparison of ECDSA and virtual signatures
[0301] In these tables, the following symbols are used:
[0302] ● Represents the two groups required to perform a bilinear map.
[0303] ● is the group for non-bilinear map based scheme operations, which is the group where DLP and CDH must be more difficult to obtain secure signatures.
[0304] ●"exp." indicates exponentiation operation, "inv." indicates inverse operation, and "mult." indicates multiplication operation.
[0305] 7. Further comments
[0306] Other variations or uses of the disclosed technology may become apparent to those skilled in the art once given the disclosure herein.The scope of the present disclosure is not limited by the described embodiments but only by the appended claims.
[0307] For example, some of the embodiments above have been described in terms of the Bitcoin network 106, the Bitcoin blockchain 150, and the Bitcoin node 104. However, it should be understood that the Bitcoin blockchain is a specific example of a blockchain 150, and the above description can generally be applied to any blockchain. That is, the present invention is in no way limited to the Bitcoin blockchain. More generally, any references to the Bitcoin network 106, the Bitcoin blockchain 150, and the Bitcoin node 104 above can be replaced with reference to the blockchain network 106, the blockchain 150, and the blockchain node 104, respectively. Blockchains, blockchain networks, and / or blockchain nodes can share some or all of the characteristics of the Bitcoin blockchain 150, the Bitcoin network 106, and the Bitcoin node 104 described above.
[0308] In a preferred embodiment of the present invention, the blockchain network 106 is a Bitcoin network, and the Bitcoin node 104 performs at least all of the functions described in creating, publishing, propagating and storing blocks 151 of the blockchain 150. It is not excluded that there may be other network entities (or network elements) that perform only one or some of these functions but not all of them. That is, a network entity may perform the functions of propagating and / or storing blocks without creating and publishing blocks (remember that these entities are not considered to be nodes of the preferred Bitcoin network 106).
[0309] In other embodiments of the present invention, the blockchain network 106 may not be a Bitcoin network. In these embodiments, it is not excluded that the node can perform at least one or part of the functions of creating, publishing, propagating and storing blocks 151 of the blockchain 150, but not all of the functions. For example, on these other blockchain networks, "node" may be used to refer to a network entity that is configured to create and publish blocks 151 but does not store and / or propagate these blocks 151 to other nodes.
[0310] Even more generally, any reference above to the term "Bitcoin node" 104 may be replaced with the term "network entity" or "network element," where such entity / element is configured to perform some or all of the roles in creating, publishing, propagating, and storing blocks. The functionality of such a network entity / element may be implemented in hardware in the same manner as described above with reference to blockchain node 104.
[0311] Some embodiments have been described in terms of a blockchain network that implements a proof-of-work consensus mechanism to secure the underlying blockchain. However, proof-of-work is only one type of consensus mechanism, and in general embodiments any type of suitable consensus mechanism may be used, such as proof-of-stake, delegated proof-of-stake, proof-of-capacity, or proof-of-elapsed-time. As a specific example, proof-of-stake uses a randomization process to determine which blockchain node 104 has a chance to produce the next block 151. The selected node is often referred to as a verifier. A blockchain node may lock its token for a period of time in order to have a chance to become a verifier. Typically, the node that has locked the largest stake for the longest time is most likely to become the next verifier.
[0312] It should be understood that the above embodiments are described by way of example only. In more general terms, a method, apparatus or program may be provided according to any one or more of the following statements.
[0313] Statement 1. A computer-implemented method for enabling verification of a non-native blockchain signature within a script, wherein the method is performed by a first party and comprises:
[0314] Obtaining a second blockchain transaction, wherein the second blockchain transaction references the first blockchain transaction;
[0315] generating a first signature based on at least the second blockchain transaction, wherein a first private key used to generate the first signature is set equal to one;
[0316] generating a second signature based on the first signature, wherein the first signature is a native blockchain signature and the second signature is a non-native blockchain signature;
[0317] When the unlocking script of the second blockchain transaction is executed together with the locking script of the first blockchain transaction, including the first signature and the second signature in the unlocking script for verification; and
[0318] Cause the second blockchain transaction to be submitted to the blockchain network.
[0319] The first signature signs a first message, wherein the first message is based on the second transaction. The second signature signs a second message, wherein the second message includes the first signature.
[0320] In other words, the first signature belongs to a first signature scheme and the second signature belongs to a second, different signature scheme. A native blockchain signature is a signature that, when verified by a blockchain scripting engine, forces the scripting engine (during the verification process) to obtain fields of the first blockchain transaction (i.e., the spend transaction). Similarly, a native signature is a signature that can be verified within a script using dedicated functions / opcodes.
[0321] Statement 2. The method of statement 1, wherein the first signature is an ECDSA signature.
[0322] Statement 3. The method of statement 1 or 2, wherein a temporary key used to generate the first signature is set equal to one.
[0323] Statement 4. The method of any one of statements 1 to 3, wherein the second signature is one of:
[0324] -Quantum resistant signatures;
[0325] -Rabin signature;
[0326] -Schnorr signatures.
[0327] Statement 5. A method according to any of the preceding statements, wherein the second signature is an identity-based signature.
[0328] Statement 6. A method according to statement 5, wherein the first party has a first identifier, a second private key, and a second public key, wherein the second private key is based on the first identifier, and wherein the second signature is based on the first signature, the first identifier, and the second private key.
[0329] Statement 7. The method of statement 6, wherein the first identifier comprises at least a portion of one or more of the following: name, address, date of birth, email address, username, passport number, driver's license number, national insurance number.
[0330] Statement 8. The method of statement 5 or 6, wherein the second public key comprises a set of parameters, the set of parameters comprising at least a prime number, an elliptic curve point generator having an order of the prime number, a first hash function, a second hash function, and wherein the second private key is generated by:
[0331] calculating a first elliptic curve point based on a first random value and the elliptic curve generator, wherein the first elliptic curve point is a first value of the second private key;
[0332] A second value of the second private key is calculated based on the first elliptic curve point, a master secret key, and a first hash generated by hashing the first elliptic curve point and the first identifier using the first hash function.
[0333] Statement 9. The method of statement 8, wherein the second private key is generated by a key generator having the master secret key, and wherein the method includes: receiving the second private key from the key generator.
[0334] Statement 10. The method of statement 8 or 9, wherein the second signature is generated by:
[0335] Calculating a first value of the second signature based on a second random value and the elliptic curve generator;
[0336] calculating a second value of the second signature based on the second random value, the first value of the second private key, and a second hash generated by hashing the first identifier, the first value of the second signature, and the first signature; and,
[0337] A third value of the second signature is set to the first value of the second private key.
[0338] Statement 11. A method according to any one of statements 6 to 10, the method comprising: including the first identifier in the unlocking script of the second blockchain transaction.
[0339] Statement 12. A method according to any one of statements 5 to 11, wherein the unlocking script of the second blockchain transaction includes one or more additional identity-based signatures, each additional identity-based signature generated by a different party.
[0340] Statement 13. A method as described in any of the preceding statements, wherein the locking script of the first blockchain transaction represents a certificate, and wherein submitting the second blockchain transaction represents revoking the certificate.
[0341] Statement 14. A computer-implemented method for verifying a non-native blockchain signature within a script, wherein the method is performed by a second party and comprises:
[0342] generating a first blockchain transaction, the first blockchain transaction comprising a locking script, wherein the locking script comprises a first verification script and a second verification script; wherein when the locking script of the first blockchain transaction is executed together with the unlocking script of the second blockchain transaction, the first verification script is configured to verify a first signature based on a first public key, the first public key corresponding to a first private key set equal to one, and the second verification script is configured to verify a second signature; wherein the first signature is a native blockchain signature and the second signature is a non-native blockchain signature; and,
[0343] Causes the first blockchain transaction to be submitted to the blockchain network.
[0344] Statement 15. The method of statement 14, wherein the first verification script is configured to verify an ECDSA signature.
[0345] For example, the first verification script may include at least one of the following: an OP_CHECKSIG opcode, an OP_CHECKSIGVERIFY opcode, an OP_CHECKMULTISIG opcode, and an OP_CHECKMULTISIGVERIFY opcode.
[0346] Statement 16. The method of statement 14 or 15, wherein the second verification script is configured to verify an identity-based signature.
[0347] Statement 17. A method according to statement 16, wherein the first party has a first identifier, a second private key, and a second public key, wherein the second private key is based on the first identifier, and wherein the second signature verification script is configured to verify the second signature based on the first identifier, the second public key and the first signature.
[0348] Statement 18. The method of statement 17, wherein the second public key comprises a set of parameters, the set of parameters comprising at least a prime number, an elliptic curve point generator having an order of the prime number, a first hash function, a second hash function, and a public value corresponding to a master secret key, wherein the second signature comprises a first value, a second value, and a third value, and wherein the second verification script is configured to verify the second signature by:
[0349] calculating a first verification value based on the first value, a first hash generated by hashing the third value and the first identifier using the first hash function, a second hash generated by hashing the first identifier, the first value, and the first signature using the second hash function, and the public value corresponding to the master secret key;
[0350] calculating a second verification value based on the second value and the elliptic curve generator; and,
[0351] Verify whether the first verification value corresponds to the second verification value.
[0352] Statement 19. A method according to statement 17 or 18, wherein the locking script of the first blockchain transaction includes the first identifier, and wherein the second verification script is configured to: verify whether the unlocking script of the first blockchain transaction includes the first identifier.
[0353] Statement 20. A method according to any one of statements 16 to 19, wherein the locking script of the first blockchain transaction includes a hash of the first identifier, and wherein the second verification script is configured to verify whether the unlocking script of the first blockchain transaction includes the first identifier by: hashing the first identifier; and comparing the result with the hash of the first identifier.
[0354] Statement 21. A method according to any one of statements 16 to 19, wherein the locking script includes multiple instances of the second verification script, and wherein when executed, each instance of the second verification script is configured to verify a corresponding identity-based signature included in the unlocking script of the second blockchain transaction.
[0355] Statement 22. A method according to any one of statements 16 to 21, wherein the locking script is configured to verify whether the unlocking script of the second blockchain transaction includes an identifier, the identifier having one or more predetermined fields.
[0356] Statement 23. The method of statement 22, wherein the locking script does not require a specific identifier to be included in the unlocking script of the second blockchain transaction.
[0357] Statement 24. The method of statement 14 or 15, wherein the second signature is one of:
[0358] -Quantum resistant signatures;
[0359] -Rabin signature;
[0360] -Schnorr signatures.
[0361] Statement 25. A computer device, the computer device comprising:
[0362] a memory, the memory comprising one or more memory cells; and,
[0363] A processing device comprising one or more processing units, wherein the memory stores code configured to be executed on the processing device, the code being configured to execute a method according to any one of statements 1 to 24 when executed on the processing device.
[0364] Statement 26. A computer program embodied on a computer readable memory and configured to, when executed on one or more processors, perform the method of any one of statements 1 to 24.
[0365] According to another aspect disclosed herein, a method may be provided, the method comprising actions of the first party and the second party.
[0366] According to another aspect disclosed herein, a system may be provided, the system comprising computer devices of the first party and the second party.< / mpk> < / ida> < / pa>
Claims
1. A computer-implemented method for enabling verification of a non-native blockchain signature within a script, wherein the method is performed by a first party and comprises: Obtaining a second blockchain transaction, wherein the second blockchain transaction references the first blockchain transaction; generating a first signature based on at least the second blockchain transaction, wherein a first private key used to generate the first signature is set equal to one; generating a second signature based on the first signature, wherein the first signature is a native blockchain signature and the second signature is a non-native blockchain signature; When the unlocking script of the second blockchain transaction is executed together with the locking script of the first blockchain transaction, the first signature and the second signature are included in the unlocking script for verification; as well as Cause the second blockchain transaction to be submitted to the blockchain network.
2. The method of claim 1, wherein the first signature is an ECDSA signature.
3. The method of claim 1 or 2, wherein a temporary key used to generate the first signature is set equal to one.
4. The method according to any one of claims 1 to 3, wherein the second signature is one of the following: -Quantum resistant signatures; -Rabin signature; -Schnorr signatures.
5. A method according to any preceding claim, wherein the second signature is an identity-based signature.
6. The method of claim 5, wherein the first party has a first identifier, a second private key, and a second public key, wherein the second private key is based on the first identifier, and wherein the second signature is based on the first signature, the first identifier, and the second private key.
7. The method of claim 6, wherein the first identifier comprises at least a portion of one or more of the following: name, address, date of birth, email address, username, passport number, driver's license number, national insurance number.
8. The method according to claim 5 or 6, wherein the second public key comprises a set of parameters, the set of parameters comprising at least a prime number, an elliptic curve point generator whose order is the prime number, a first hash function, and a second hash function, and wherein the second private key is generated by: calculating a first elliptic curve point based on a first random value and the elliptic curve generator, wherein the first elliptic curve point is a first value of the second private key; A second value of the second private key is calculated based on the first elliptic curve point, a master secret key, and a first hash generated by hashing the first elliptic curve point and the first identifier using the first hash function.
9. The method of claim 8, wherein the second private key is generated by a key generator having the master secret key, and wherein the method comprises: The second private key is received from the key generator.
10. The method according to claim 8 or 9, wherein the second signature is generated by: Calculating a first value of the second signature based on a second random value and the elliptic curve generator; calculating a second value of the second signature based on the second random value, the first value of the second private key, a second hash generated by hashing the first identifier, the first value of the second signature, and the first signature; and A third value of the second signature is set to the first value of the second private key.
11. The method according to any one of claims 6 to 10, comprising: including the first identifier in the unlocking script of the second blockchain transaction.
12. The method of any one of claims 5 to 11, wherein the unlocking script of the second blockchain transaction includes one or more additional identity-based signatures, each additional identity-based signature being generated by a different party.
13. A method according to any preceding claim, wherein the locking script of the first blockchain transaction represents a certificate, and wherein submitting the second blockchain transaction represents revoking the certificate.
14. A computer-implemented method for generating a blockchain transaction to verify a non-native blockchain signature within a script, wherein the method is performed by a second party and comprises: Generate a first blockchain transaction, the first blockchain transaction comprising a locking script, wherein the locking script comprises a first verification script and a second verification script; wherein when the locking script of the first blockchain transaction is executed together with the unlocking script of the second blockchain transaction, the first verification script is configured to verify a first signature based on a first public key, the first public key corresponding to a first private key set equal to one, and the second verification script is configured to verify a second signature; wherein the first signature is a native blockchain signature and the second signature is a non-native blockchain signature; as well as Causes the first blockchain transaction to be submitted to the blockchain network.
15. The method of claim 14, wherein the first verification script is configured to verify an ECDSA signature.
16. The method of claim 14 or 15, wherein the second verification script is configured to verify an identity-based signature.
17. The method of claim 16, wherein the first party has a first identifier, a second private key, and a second public key, wherein the second private key is based on the first identifier, and wherein the second signature verification script is configured to verify the second signature based on the first identifier, the second public key, and the first signature.
18. The method of claim 17, wherein the second public key comprises a set of parameters, the set of parameters comprising at least a prime number, an elliptic curve point generator having an order of the prime number, a first hash function, a second hash function, and a public value corresponding to a master secret key, wherein the second signature comprises a first value, a second value, and a third value, and wherein the second verification script is configured to verify the second signature by: calculating a first verification value based on the first value, a first hash generated by hashing the third value and the first identifier using the first hash function, a second hash generated by hashing the first identifier, the first value, and the first signature using the second hash function, and the public value corresponding to the master secret key; calculating a second verification value based on the second value and the elliptic curve generator; as well as Verify whether the first verification value corresponds to the second verification value.
19. The method of claim 17 or 18, wherein the locking script of the first blockchain transaction includes the first identifier, and wherein the second verification script is configured to verify whether the unlocking script of the first blockchain transaction includes the first identifier.
20. The method of any one of claims 16 to 19, wherein the locking script of the first blockchain transaction includes a hash of the first identifier, and wherein the second verification script is configured to verify whether the unlocking script of the first blockchain transaction includes the first identifier by: hashing the first identifier; and comparing the result with the hash of the first identifier.
21. The method of any one of claims 16 to 19, wherein the locking script comprises multiple instances of the second verification script, and wherein when executed, each instance of the second verification script is configured to verify a corresponding identity-based signature included in the unlocking script of the second blockchain transaction.
22. The method of any one of claims 16 to 21, wherein the locking script is configured to verify whether the unlocking script of the second blockchain transaction includes an identifier having one or more predetermined fields.
23. The method of claim 22, wherein the locking script does not require a specific identifier to be included in the unlocking script of the second blockchain transaction.
24. The method of claim 14 or 15, wherein the second signature is one of: -Quantum resistant signatures; -Rabin signature; -Schnorr signatures.
25. A computer device, comprising: a memory, the memory comprising one or more memory units; as well as A processing device comprising one or more processing units, wherein the memory stores a code arranged to be executed on the processing device, the code being configured to execute the method according to any one of claims 1 to 24 when executed on the processing device.
26. A computer program embodied on a computer readable memory and configured to, when run on one or more processors, perform the method according to any one of claims 1 to 24.
