WO2024179772A1 - Verification of scalar multiplication of elliptic curve points in script - Google Patents

Verification of scalar multiplication of elliptic curve points in script Download PDF

Info

Publication number
WO2024179772A1
WO2024179772A1 PCT/EP2024/052608 EP2024052608W WO2024179772A1 WO 2024179772 A1 WO2024179772 A1 WO 2024179772A1 EP 2024052608 W EP2024052608 W EP 2024052608W WO 2024179772 A1 WO2024179772 A1 WO 2024179772A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
scalar value
verify
corresponds
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/EP2024/052608
Other languages
French (fr)
Inventor
Paul GERMOUTY
Enrique LARRAIA
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nchain Licensing AG
Original Assignee
Nchain Licensing AG
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nchain Licensing AG filed Critical Nchain Licensing AG
Publication of WO2024179772A1 publication Critical patent/WO2024179772A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/724Finite field arithmetic
    • G06F7/725Finite field arithmetic over elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • H04L9/3252Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures using DSA or related signature schemes, e.g. elliptic based signatures, ElGamal or Schnorr schemes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • BACKGROUND Blockchain nodes typically charge fees to users to validate their transaction based on the size of the transaction.
  • minimising the script size reduces the transaction fees.
  • Minimising the script (and therefore) transaction size also reduces the overall size of the blockchain.
  • Security is a hard requirement in many modern use cases, and therefore being able to implement mathematical operations for cryptography in-script (i.e. using a transaction) is an important feature.
  • One such operation is scalar multiplication of points over elliptic curves.
  • the gradient ⁇ of the line that passes through the two summand points is calculated off-chain, and then verified on-chain using the formulas of point addition.
  • This allows to skip calculation of modular inverses in script (which involves a loop of length log ( ⁇ ) where ⁇ is the size of the elliptic curve field.)
  • SUMMARY There is therefore a need for a compact script for performing scalar multiplication over elliptic curves.
  • the script computes the operation using the arithmetic opcodes, or the operation is first computed off-chain and then the script verifies its correctness using the inputs and the result with appropriate opcodes.
  • Embodiments described herein take the second approach, resulting in significantly reduced script sizes compared to previous techniques.
  • a computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications wherein the method is performed by a first party and comprises obtaining a verification script, wherein the verification script is configured to: take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point ( ⁇ ), a fourth EC point ( ⁇ ⁇ ), a fifth EC point ( ⁇ ⁇ ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ⁇ ⁇ ), and a third scalar value ( ⁇ ⁇ ), and a message hash (h); verify an x-coordinate ( ⁇ ⁇ ) of the first EC point corresponds to an x-coordinate ( ⁇ ⁇ ) of an EC point generated based on the
  • a blockchain comprises a first blockchain transaction comprising a verification script, wherein the verification script is configured to take as inputs a first EC point (K), a second EC point, (Q), a third EC point ( ⁇ ), a fourth EC point ( ⁇ ⁇ ), a fifth EC point ( ⁇ ⁇ ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ⁇ ⁇ ), and a third scalar value ( ⁇ ⁇ ), and a message hash (h); verify an x-coordinate ( ⁇ ⁇ ) of the first EC point corresponds to an x- coordinate ( ⁇ ⁇ ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q); verify the third EC point ( ⁇ )
  • a computer-implemented method of processing blockchain transactions wherein the method is performed by a transaction processor and comprises: obtaining a first blockchain transaction comprising a verification script, wherein the verification script is configured to take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point ( ⁇ ), a fourth EC point ( ⁇ ⁇ ), a fifth EC point ( ⁇ ⁇ ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ⁇ ⁇ ), and a third scalar value ( ⁇ ⁇ ), and a message hash (h), verify an x-coordinate ( ⁇ ⁇ ) of the first EC point corresponds to an x-coordinate ( ⁇ ⁇ ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q), verify the third EC point ( ⁇ )
  • Embodiments of the present disclosure provide a compact script to verify correctness of scalar multiplications, e.g. over the curve secp256k1 that is used by Bitcoin.
  • ⁇ ⁇ ⁇ where ⁇ is a scalar and ⁇ is the base point of an elliptic curve (e.g. secp256k1).
  • Figure 1 is a schematic block diagram of a system for implementing a blockchain
  • Figure 2 schematically illustrates some examples of transactions which may be recorded in a blockchain
  • Figure 3 is a schematic block diagram of an example system for implementing the described embodiments
  • Figure 4 schematically illustrates the OP_CHECKSIG process.
  • Figure 3 illustrates an example system 300 for implemented the embodiments described herein.
  • the system 300 comprises a first party (e.g. Alice 103a), a second party (e.g. Bob 103b) and one more nodes 104 of a blockchain network 106.
  • first party e.g. Alice 103a
  • second party e.g. Bob 103b
  • Alice 103a is configured to obtain a verification script.
  • the verification script may be a locking script that locks an output of a transaction.
  • Alice 103a may generate the verification script herself, or she may obtain the verification script from another party, or another resource.
  • the verification script may be provided as a template from a script provider, or downloaded from the internet.
  • Alice 103a generates a first blockchain transaction that contains the verification script, e.g. as a locking script.
  • Alice 103a may submit the first blockchain transaction to the blockchain network 106, as shown in Figure 3.
  • Alice 103a may send the first blockchain transaction to another party, e.g. Bob 103b, who then submits it the blockchain network 106.
  • Bob 103b is configured to generate a second blockchain transaction and submit the second blockchain transaction to the blockchain network, as shown in Figure 3.
  • the second blockchain transaction references the first blockchain transaction.
  • Bob 103b is configured to generate the values required by the verification script, and include the values in the second blockchain transaction, e.g. as part of an unlocking script.
  • a transaction processor e.g. a blockchain node 104, is configured to obtain the first and second blockchain transactions, and execute the verification script from the first blockchain transaction together with the values from the second blockchain transaction, e.g. as part of validating the second blockchain transaction.
  • 1.1 Verify ⁇ ⁇ ⁇ ⁇
  • the verification script is configured to verify that an elliptic curve (EC) point (a “first EC point”) is a multiplication of a scalar value (a “first scalar value”) and a base point of the elliptic curve.
  • EC elliptic curve
  • first scalar value a multiplication of a scalar value
  • base point will be denoted as ⁇ .
  • the verification script uses ⁇ , ⁇ , a second EC point ( ⁇ ) and a message hash (h) to perform the verification.
  • One or more values may be included in the verification script.
  • One or more values may be supplied to the verification script, e.g. from a second blockchain transaction.
  • the message hash (h) may be based on the second blockchain transaction, i.e. a transaction that references the first blockchain transaction, or more specifically an output thereof.
  • the second blockchain transaction may be referred to as the spending transaction.
  • the verification script may be configured to calculate a second scalar value ( ⁇ ) based on , e.g.
  • the third scalar value ( ⁇ ) and/or the third EC point ( ⁇ ) may be included in the verification script of the spending transaction.
  • the verification script also verifies that the second EC point ( ⁇ ) is equal to a point addition of the first scalar value ( ⁇ ) and a third EC point ( ⁇ ), where the third EC point ( ⁇ ) is the result of multiplying the third scalar value ( ⁇ ) and the base point ( ⁇ ).
  • the third scalar value may ( ⁇ ) be hardcoded as 1, meaning the third EC point ( ⁇ ) is equal to the basepoint ( ⁇ ).
  • the verification script also verifies a first signature generated based on the first scalar value ( ⁇ ) and the message hash (h) is a valid signature when validated against the first EC point ( ⁇ ).
  • the signature may be verified with a dedicated opcode, such as OP_CHECKSIG.
  • a second signature is also verified, e.g. using OP_CHECKSIG.
  • the verification script may be configured to generate the first and/or second signatures in-script.
  • the first scalar value ( ⁇ ) is the signing key.
  • the second scalar value ( ⁇ ) is the signing key.
  • the verification script may verify the second EC point ( ⁇ ) is equal to a point addition of the first and third EC points (i.e.
  • ⁇ + ⁇ ) based on a line gradient value ( ⁇ ), which may be included in the verification script or supplied to the verification script.
  • the verification script may perform the technique described in PCT/IB2019/058580.
  • the following describes a specific example of the verification script.
  • the injected spending transaction is treated as auxiliary information needed to execute the PUSHTX script.
  • the part of the script that deals with this is removed (steps 1-4 from the script shown in section 4 below). Note that in the context of batching many scalar multiplication verifications, the first four steps will be performed on the same message each time. For completeness, the steps of the modified PUSHTX script is shown below.
  • VERIFYKEYPAIR It is referred to as VERIFYKEYPAIR to avoid confusion.
  • the script takes as input the scalar ⁇ , interpreted as the signing key, and the point ⁇ interpreted as the public key. Input: publick key ⁇ , signing key ⁇ , and message hash h Steps:
  • the script may be precomputed and hard-coded in the script. It guarantees the correctness of ⁇ .
  • the script (VERIFY_BASEPOINT_MULTIPLICATION) does the following: 1. Compute ⁇ ⁇ ⁇ + ⁇ 2.
  • the verification script is configured to verify that an elliptic curve (EC) point (a “fourth EC point”) is a multiplication of either a positive or negative scalar value (a “fourth scalar value”) and an arbitrary elliptic curve point (a “fifth EC point”).
  • EC elliptic curve
  • the fourth EC point will be denoted as ⁇
  • the fourth scalar value will be denoted as ⁇
  • the fifth EC point will be denoted as ⁇ .
  • the verification script also verifies that a third signature ( ⁇ ⁇ , ⁇ ⁇ ) comprising the x-coordinate of the fourth EC point ( ⁇ ) and the fifth scalar value ( ⁇ ⁇ ) is a valid signature when validated against the sixth EC point ( ⁇ ⁇ ).
  • the signature may be verified with a dedicated opcode, such as OP_CHECKSIG.
  • the verification script also verifies that the result of multiplying the x-coordinate of the fourth EC point ( ⁇ ) and the first scalar value ( ⁇ ) is equal to the message hash (h).
  • the fifth EC point (Q) may be verified using a line gradient value ( ⁇ ), e.g. as described in PCT/IB2019/058580.
  • ⁇ ⁇ ⁇ ⁇ ⁇ it can be concluded that ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ .
  • OP_CHECKSIG enforces equality of the x-coordinate of the calculated point ⁇ ⁇ (using the s- component of the signature in the calculation).
  • We use an additional point provided by the user e.g. Bob 103b: Where h is the sighash of the spending transaction.
  • the user e.g. Bob 103b
  • the verification script uses ⁇ a seventh EC point ( ⁇ ), an eighth EC point ( ⁇ ⁇ ), a ninth EC point ( ⁇ ⁇ ), a tenth EC point ( ⁇ ), a sixth scalar value ( ⁇ ⁇ ), and a seventh scalar value ( ⁇ ⁇ ) to perform the verification.
  • One or more values may be included in the verification script.
  • One or more values may be supplied to the verification script, e.g. from the second blockchain transaction.
  • the verification script is configured to verify that the seventh EC point ( ⁇ ) is equal to a point multiplication of the fourth scalar value ( ⁇ ) and the base point ( ⁇ ).
  • the verification script described in section 1.2 is used to perform this verification. In other examples, a different technique may be used. Similarly, the verification script is configured to verify that the ninth EC point ( ⁇ ⁇ ) is equal to a point multiplication of the fourth scalar value ( ⁇ ⁇ ) and the base point ( ⁇ ). In some examples, the verification script described in section 1.2 is used to perform this verification. In other examples, a different technique may be used. The verification script may be configured to verify that that the point addition of the eighth and ninth EC points (i.e. ⁇ ⁇ + ⁇ ) is equal to a point addition of the fifth EC point and the base point (i.e. ⁇ + ⁇ ).
  • the verification script also verifies that the tenth EC point ( ⁇ ) is equal to the point addition of the fourth and seventh EC points (i.e. ⁇ + ⁇ ), and that an x-coordinate of the tenth EC point is equal to the result of multiplying the fourth scalar value ( ⁇ ) and the sixth scalar value ( ⁇ ⁇ ).
  • the verification script also verifies that a multiplication of the x-coordinate of the tenth EC point ( ⁇ ) and the seventh scalar value ( ⁇ ⁇ ) is equal to the message hash (h).
  • the verification script also verifies a fourth signature comprising the x-coordinate of the tenth EC point ( ⁇ ) and the sixth scalar value ( ⁇ ⁇ ) is a valid signature when validated against the eighth EC point ( ⁇ ⁇ ).
  • the signature may be verified with a dedicated opcode, such as OP_CHECKSIG.
  • OP_CHECKSIG a dedicated opcode
  • each fixed-point scalar multiplication over secp256k1 takes about 700KB.
  • Pedersen commitments PCT/EP2023/050089 proposes to redeem funds, where one provides the message and the Pederson opening. The script recomputes the commitment and check it matches the one hard-coded in the script. To recompute the commitment two fixed-point scalar multiplications need to be done. This gives a size of roughly 1.4MB.
  • a blockchain refers to a form of distributed data structure, wherein a duplicate copy of the blockchain is maintained at each of a plurality of nodes in a distributed peer-to-peer (P2P) network (referred to below as a “blockchain network”) and widely publicised.
  • the blockchain comprises a chain of blocks of data, wherein each block comprises one or more transactions.
  • Each transaction points back to a preceding transaction in a sequence which may span one or more blocks going back to one or more coinbase transactions.
  • Coinbase transactions are discussed further below.
  • Transactions that are submitted to the blockchain network are included in new blocks. New blocks are created by a process often referred to as “mining”, which involves each of a plurality of the nodes competing to perform “proof-of-work”, i.e. solving a cryptographic puzzle based on a representation of a defined set of ordered and validated pending transactions waiting to be included in a new block of the blockchain. It should be noted that the blockchain may be pruned at some nodes, and the publication of blocks can be achieved through the publication of mere block headers.
  • the transactions in the blockchain may be used for one or more of the following purposes: to convey a digital asset (i.e. a number of digital tokens), to order a set of entries in a virtualised ledger or registry, to receive and process timestamp entries, and/or to time- order index pointers.
  • a blockchain can also be exploited in order to layer additional functionality on top of the blockchain.
  • blockchain protocols may allow for storage of additional user data or indexes to data in a transaction. There is no pre-specified limit to the maximum data capacity that can be stored within a single transaction, and therefore increasingly more complex data can be incorporated. For instance this may be used to store an electronic document in the blockchain, or audio or video data.
  • the data structure of a given transaction comprises one or more inputs and one or more outputs.
  • Any spendable output comprises an element specifying an amount of the digital asset that is derivable from the proceeding sequence of transactions.
  • the spendable output is sometimes referred to as a UTXO (“unspent transaction output”).
  • the output may further comprise a locking script specifying a condition for the future redemption of the output.
  • a locking script is a predicate defining the conditions necessary to validate and transfer digital tokens or assets.
  • Each input of a transaction (other than a coinbase transaction) comprises a pointer (i.e.
  • a reference to such an output in a preceding transaction, and may further comprise an unlocking script for unlocking the locking script of the pointed-to output.
  • the first transaction comprises at least one output specifying an amount of the digital asset, and comprising a locking script defining one or more conditions of unlocking the output.
  • the second, target transaction comprises at least one input, comprising a pointer to the output of the first transaction, and an unlocking script for unlocking the output of the first transaction.
  • one of the criteria for validity applied at each node will be that the unlocking script meets all of the one or more conditions defined in the locking script of the first transaction. Another will be that the output of the first transaction has not already been redeemed by another, earlier valid transaction. Any node that finds the target transaction invalid according to any of these conditions will not propagate it (as a valid transaction, but possibly to register an invalid transaction) nor include it in a new block to be recorded in the blockchain.
  • An alternative type of transaction model is an account-based model.
  • FIG. 1 shows an example system 100 for implementing a blockchain 150.
  • the system 100 may comprise a packet-switched network 101, typically a wide-area internetwork such as the Internet.
  • the packet-switched network 101 comprises a plurality of blockchain nodes 104 (often referred to as “miners”) that may be arranged to form a peer-to-peer (P2P) network 106 within the packet-switched network 101.
  • miners peer-to-peer
  • each blockchain node 104 may be arranged as a near-complete graph. Each blockchain node 104 is therefore highly connected to other blockchain nodes 104.
  • Each blockchain node 104 comprises computer equipment of a peer, with different ones of the nodes 104 belonging to different peers.
  • Each blockchain node 104 comprises processing apparatus comprising one or more processors, e.g. one or more central processing units (CPUs), accelerator processors, application specific processors and/or field programmable gate arrays (FPGAs), and other equipment such as application specific integrated circuits (ASICs).
  • Each node also comprises memory, i.e. computer-readable storage in the form of a non-transitory computer-readable medium or media.
  • the memory may comprise one or more memory units employing one or more memory media, e.g. a magnetic medium such as a hard disk; an electronic medium such as a solid-state drive (SSD), flash memory or EEPROM; and/or an optical medium such as an optical disk drive.
  • the blockchain 150 comprises a chain of blocks of data 151, wherein a respective copy of the blockchain 150 is maintained at each of a plurality of blockchain nodes 104 in the distributed or blockchain network 106. As mentioned above, maintaining a copy of the blockchain 150 does not necessarily mean storing the blockchain 150 in full. Instead, the blockchain 150 may be pruned of data so long as each blockchain node 150 stores the block header (discussed below) of each block 151.
  • Each block 151 in the chain comprises one or more transactions 152, wherein a transaction in this context refers to a kind of data structure.
  • the nature of the data structure will depend on the type of transaction protocol used as part of a transaction model or scheme.
  • a given blockchain will use one particular transaction protocol throughout.
  • a blockchain node 104 may be configured to forward transactions 152 to other blockchain nodes 104, and thereby cause transactions 152 to be propagated throughout the network 106.
  • a blockchain node 104 may be configured to create blocks 151 and to store a respective copy of the same blockchain 150 in their respective memory.
  • a blockchain node 104 may also maintain an ordered set (or “pool”) 154 of transactions 152 waiting to be incorporated into blocks 151.
  • the ordered pool 154 is often referred to as a “mempool”.
  • This term herein is not intended to limit to any particular blockchain, protocol or model. It refers to the ordered set of transactions which a node 104 has accepted as valid and for which the node 104 is obliged not to accept any other transactions attempting to spend the same output.
  • the (or each) input comprises a pointer referencing the output of a preceding transaction 152i in the sequence of transactions, specifying that this output is to be redeemed or “spent” in the present transaction 152j.
  • Spending or redeeming does not necessarily imply transfer of a financial asset, though that is certainly one common application. More generally spending could be described as consuming the output, or assigning it to one or more outputs in another, onward transaction.
  • the preceding transaction could be any transaction in the ordered set 154 or any block 151.
  • the preceding transaction 152i need not necessarily exist at the time the present transaction 152j is created or even sent to the network 106, though the preceding transaction 152i will need to exist and be validated in order for the present transaction to be valid.
  • “preceding” herein refers to a predecessor in a logical sequence linked by pointers, not necessarily the time of creation or sending in a temporal sequence, and hence it does not necessarily exclude that the transactions 152i, 152j be created or sent out-of-order (see discussion below on orphan transactions).
  • the preceding transaction 152i could equally be called the antecedent or predecessor transaction.
  • each of the blockchain nodes 104 takes the form of a server comprising one or more physical server units, or even whole a data centre.
  • any given blockchain node 104 could take the form of a user terminal or a group of user terminals networked together.
  • the memory of each blockchain node 104 stores software configured to run on the processing apparatus of the blockchain node 104 in order to perform its respective role or roles and handle transactions 152 in accordance with the blockchain node protocol. It will be understood that any action attributed herein to a blockchain node 104 may be performed by the software run on the processing apparatus of the respective computer equipment.
  • the node software may be implemented in one or more applications at the application layer, or a lower layer such as the operating system layer or a protocol layer, or any combination of these.
  • Any given blockchain node may be configured to perform one or more of the following operations: validating transactions, storing transactions, propagating transactions to other peers, performing consensus (e.g. proof-of-work) / mining operations.
  • each type of operation is performed by a different node 104. That is, nodes may emphasize in particular operation. For example, a nodes 104 may focus on transaction validation and propagation, or on block mining. In some examples, a blockchain node 104 may perform more than one of these operations in parallel.
  • Any reference to a blockchain node 104 may refer to an entity that is configured to perform at least one of these operations.
  • the computer equipment 102 of each of a plurality of parties 103 in the role of consuming users. These users may interact with the blockchain network 106 but do not participate in validating transactions or constructing blocks. Some of these users or agents 103 may act as senders and recipients in transactions. Other users may interact with the blockchain 150 without necessarily acting as senders or recipients. For instance, some parties may act as storage entities that store a copy of the blockchain 150 (e.g. having obtained a copy of the blockchain from a blockchain node 104). Some or all of the parties 103 may be connected as part of a different network, e.g.
  • each party 103 may interact with the blockchain network 106 and thereby utilize the blockchain 150 by connecting to (i.e. communicating with) a blockchain node 106.
  • Two parties 103 and their respective equipment 102 are shown for illustrative purposes: a first party 103a and his/her respective computer equipment 102a, and a second party 103b and his/her respective computer equipment 102b.
  • each party 103 may be an individual or an organization. Purely by way of illustration the first party 103a is referred to herein as Alice and the second party 103b is referred to as Bob, but it will be appreciated that this is not limiting and any reference herein to Alice or Bob may be replaced with “first party” and “second “party” respectively.
  • the computer equipment 102 of each party 103 comprises respective processing apparatus comprising one or more processors, e.g. one or more CPUs, GPUs, other accelerator processors, application specific processors, and/or FPGAs.
  • the computer equipment 102 of each party 103 further comprises memory, i.e.
  • the memory on the computer equipment 102 of each party 103 stores software comprising a respective instance of at least one client application 105 arranged to run on the processing apparatus. It will be understood that any action attributed herein to a given party 103 may be performed using the software run on the processing apparatus of the respective computer equipment 102.
  • the computer equipment 102 of each party 103 comprises at least one user terminal, e.g.
  • the computer equipment 102 of a given party 103 may also comprise one or more other networked resources, such as cloud computing resources accessed via the user terminal.
  • the client application 105 may be initially provided to the computer equipment 102 of any given party 103 on suitable computer-readable storage medium or media, e.g. downloaded from a server, or provided on a removable storage device such as a removable SSD, flash memory key, removable EEPROM, removable magnetic disk drive, magnetic floppy disk or tape, optical disk such as a CD or DVD ROM, or a removable optical drive, etc.
  • the client application 105 comprises at least a “wallet” function. This has two main functionalities.
  • this second functionality comprises collating the amounts defined in the outputs of the various 152 transactions scattered throughout the blockchain 150 that belong to the party in question.
  • client functionality could be implemented at the application layer or a lower layer such as the operating system, or any combination of these.
  • the following will be described in terms of a client application 105 but it will be appreciated that this is not limiting.
  • the instance of the client application or software 105 on each computer equipment 102 is operatively coupled to at least one of the blockchain nodes 104 of the network 106. This enables the wallet function of the client 105 to send transactions 152 to the network 106.
  • the client 105 is also able to contact blockchain nodes 104 in order to query the blockchain 150 for any transactions of which the respective party 103 is the recipient (or indeed inspect other parties’ transactions in the blockchain 150, since in embodiments the blockchain 150 is a public facility which provides trust in transactions in part through its public visibility).
  • the wallet function on each computer equipment 102 is configured to formulate and send transactions 152 according to a transaction protocol.
  • each blockchain node 104 runs software configured to validate transactions 152 according to the blockchain node protocol, and to forward transactions 152 in order to propagate them throughout the blockchain network 106.
  • the transaction protocol and the node protocol correspond to one another, and a given transaction protocol goes with a given node protocol, together implementing a given transaction model.
  • the same transaction protocol is used for all transactions 152 in the blockchain 150.
  • the same node protocol is used by all the nodes 104 in the network 106.
  • An alternative type of transaction protocol operated by some blockchain networks may be referred to as an “account-based” protocol, as part of an account-based transaction model.
  • each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance.
  • the current state of all accounts is stored, by the nodes of that network, separate to the blockchain and is updated constantly. In such a system, transactions are ordered using a running transaction tally of the account (also called the “position” or “nonce”).
  • This value is signed by the sender as part of their cryptographic signature and is hashed as part of the transaction reference calculation.
  • an optional data field may also be signed the transaction. This data field may point back to a previous transaction, for example if the previous transaction ID is included in the data field.
  • an account-based transaction contains a “recipient” field (in which a receiving address of an account is specified) and a “value” field (in which an amount of digital asset may be specified). Together the recipient and value fields are equivalent to the output of an output- based transaction which may be used to assign an amount of digital asset to a blockchain address.
  • an account-based transaction has a “signature” field which includes a signature for the transaction. The signature is generated using the sender's private key and confirms the sender has authorized this transaction. This is equivalent to an input / unlocking script of an output-based transaction which, typically, includes a signature for the transaction.
  • a “smart contact” refers to a transaction that contains a script configured to perform one or more actions (e.g. send or “release” a digital asset to a recipient address) in response to one or more inputs (provided by a transaction) meeting one or more conditions defined by the smart contact’s script.
  • the smart contract exists as a transaction on the blockchain, and can be called (or triggered) by subsequent transactions.
  • a smart contract may be considered equivalent to a locking script of an output-based transaction, which can be triggered by a subsequent transaction, and checks whether one or more conditions defined by the locking script are met by the input of the subsequent transaction.
  • FIG. 2 illustrates an example transaction protocol. This is an example of a UTXO-based protocol.
  • a transaction 152 (abbreviated “Tx”) is the fundamental data structure of the blockchain 150 (each block 151 comprising one or more transactions 152). The following will be described by reference to an output-based or “UTXO” based protocol. However, this is not limiting to all possible embodiments.
  • each transaction (“Tx”) 152 comprises a data structure comprising one or more inputs 202, and one or more outputs 203.
  • Each output 203 may comprise an unspent transaction output (UTXO), which can be used as the source for the input 202 of another new transaction (if the UTXO has not already been redeemed).
  • the UTXO includes a value specifying an amount of a digital asset. This represents a set number of tokens on the distributed ledger.
  • the UTXO may also contain the transaction ID of the transaction from which it came, amongst other information.
  • the transaction data structure may also comprise a header 201, which may comprise an indicator of the size of the input field(s) 202 and output field(s) 203.
  • the header 201 may also include an ID of the transaction.
  • the transaction ID is the hash of the transaction data (excluding the transaction ID itself) and stored in the header 201 of the raw transaction 152 submitted to the nodes 104.
  • Alice 103a wishes to create a transaction 152j transferring an amount of the digital asset in question to Bob 103b.
  • Alice’s new transaction 152j is labelled “Tx1”. It takes an amount of the digital asset that is locked to Alice in the output 203 of a preceding transaction 152i in the sequence, and transfers at least some of this to Bob.
  • Tx0 The preceding transaction 152i is labelled “Tx0” in Figure 2.
  • Tx0 and Tx1 are just arbitrary labels. They do not necessarily mean that Tx0 is the first transaction in the blockchain 151, nor that Tx1 is the immediate next transaction in the pool 154. Tx1 could point back to any preceding (i.e. antecedent) transaction that still has an unspent output 203 locked to Alice.
  • the terms “preceding” and “subsequent” as used herein in the context of the sequence of transactions refer to the order of the transactions in the sequence as defined by the transaction pointers specified in the transactions (which transaction points back to which other transaction, and so forth).
  • One of the one or more outputs 203 of the preceding transaction Tx 0 comprises a particular UTXO, labelled here UTXO 0 .
  • Each UTXO comprises a value specifying an amount of the digital asset represented by the UTXO, and a locking script which defines a condition which must be met by an unlocking script in the input 202 of a subsequent transaction in order for the subsequent transaction to be validated, and therefore for the UTXO to be successfully redeemed.
  • the locking script (aka scriptPubKey) is a piece of code written in the domain specific language recognized by the node protocol. A particular example of such a language is called “Script” (capital S) which is used by the blockchain network.
  • the locking script specifies what information is required to spend a transaction output 203, for example the requirement of Alice’s signature.
  • Locking scripts appear in the outputs of transactions.
  • the unlocking script (aka scriptSig) is a piece of code written the domain specific language that provides the information required to satisfy the locking script criteria. For example, it may contain Bob’s signature.
  • Unlocking scripts appear in the input 202 of transactions. So in the example illustrated, UTXO0 in the output 203 of Tx0 comprises a locking script [Checksig PA] which requires a signature Sig PA of Alice in order for UTXO 0 to be redeemed (strictly, in order for a subsequent transaction attempting to redeem UTXO 0 to be valid). [Checksig PA] contains a representation (i.e.
  • the input 202 of Tx1 comprises a pointer pointing back to Tx1 (e.g. by means of its transaction ID, TxID0, which in embodiments is the hash of the whole transaction Tx 0 ).
  • the input 202 of Tx 1 comprises an index identifying UTXO 0 within Tx 0 , to identify it amongst any other possible outputs of Tx 0 .
  • the input 202 of Tx 1 further comprises an unlocking script ⁇ Sig P A > which comprises a cryptographic signature of Alice, created by Alice applying her private key from the key pair to a predefined portion of data (sometimes called the “message” in cryptography).
  • the data (or “message”) that needs to be signed by Alice to provide a valid signature may be defined by the locking script, or by the node protocol, or by a combination of these.
  • the node applies the node protocol. This comprises running the locking script and unlocking script together to check whether the unlocking script meets the condition defined in the locking script (where this condition may comprise one or more criteria).
  • the script code is often represented schematically (i.e. not using the exact language). For example, one may use operation codes (opcodes) to represent a particular function. “OP_...” refers to a particular opcode of the Script language.
  • OP_RETURN is an opcode of the Script language 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, and thereby record the data immutably in the blockchain 150.
  • the data could comprise a document which it is desired to store in the blockchain.
  • an input of a transaction contains a digital signature corresponding to a public key PA. In embodiments this is based on the ECDSA using the elliptic curve secp256k1.
  • a digital signature signs a particular piece of data. In some embodiments, for a given transaction the signature will sign part of the transaction input, and some or all of the transaction outputs.
  • the particular parts of the outputs it signs depends on the SIGHASH flag.
  • the SIGHASH flag is usually a 4-byte code included at the end of a signature to select which outputs are signed (and thus fixed at the time of signing).
  • the locking script is sometimes called “scriptPubKey” referring to the fact that it typically comprises the public key of the party to whom the respective transaction is locked.
  • the unlocking script is sometimes called “scriptSig” referring to the fact that it typically supplies the corresponding signature.
  • scripting language could be used to define any one or more conditions. Hence the more general terms “locking script” and “unlocking script” may be preferred.
  • ⁇ ⁇ ⁇ ⁇ + ⁇ + ⁇ + ⁇ ( ⁇ times).
  • the ECDSA scheme fixes a base point ⁇ and works over the subgroup ⁇ ⁇ ⁇ ⁇
  • ⁇ ⁇ ⁇ of the elliptic curve. This subgroup is generated by ⁇ , and ⁇ will denote its (prime) size.
  • the chosen curve is secp256k1, where both ⁇ and ⁇ are primes of 256 bits.
  • the messages to sign are mapped to modular integers h ⁇ Z ⁇ via hashing with SHA256.
  • the signing key is also an integer ⁇ ⁇ Z ⁇
  • the public key (to verify signatures) is the point ⁇ ⁇ ⁇ ⁇ ⁇ ⁇ in the elliptic curve (concretely, in the subgroup ⁇ ⁇ ⁇ ).
  • the opcode OP_CHECKSIG implements the verification of an ECDSA signature. It receives two inputs from the stack: the signature ⁇ in DER format, and the public key ⁇ ⁇ . Besides these two inputs, the implementation of OP_CHECKSIG also needs additional inputs drawn from context, which are used to derive the message ⁇ for which the signature ⁇ is verified. One additional input is the spending transaction. This is illustrated in Figure 4. PUSHTX is a technique known in the art to inject the sighash fields of the spending transaction to the Stack.
  • bitcoin network 106 For instance, some embodiments above have been described in terms of a bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104.
  • the bitcoin blockchain is one particular example of a blockchain 150 and the above description may apply generally to any blockchain. That is, the present invention is in by no way limited to the bitcoin blockchain. More generally, any reference above to bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104 may be replaced with reference to a blockchain network 106, blockchain 150 and blockchain node 104 respectively.
  • the blockchain, blockchain network and/or blockchain nodes may share some or all of the described properties of the bitcoin blockchain 150, bitcoin network 106 and bitcoin nodes 104 as described above.
  • the blockchain network 106 is the bitcoin network and bitcoin nodes 104 perform at least all of the described functions of 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 only perform one or some but not all of these functions. That is, a network entity may perform the function of propagating and/or storing blocks without creating and publishing blocks (recall that these entities are not considered nodes of the preferred bitcoin network 106). In other embodiments of the invention, the blockchain network 106 may not be the bitcoin network. In these embodiments, it is not excluded that a node may perform at least one or some but not all of the functions of creating, publishing, propagating and storing blocks 151 of the blockchain 150.
  • node may be used to refer to a network entity that is configured to create and publish blocks 151 but not store and/or propagate those blocks 151 to other nodes.
  • bitcoin node 104 any reference to the term “bitcoin node” 104 above may be replaced with the term “network entity” or “network element”, wherein such an entity/element is configured to perform some or all of the roles of creating, publishing, propagating and storing blocks.
  • the functions of such a network entity/element may be implemented in hardware in the same way described above with reference to a blockchain node 104.
  • proof- of-work is just one type of consensus mechanism and in general embodiments may use any type of suitable consensus mechanism such as, for example, proof-of-stake, delegated proof-of-stake, proof-of-capacity, or proof-of-elapsed time.
  • proof- of-stake uses a randomized process to determine which blockchain node 104 is given the opportunity to produce the next block 151.
  • the chosen node is often referred to as a validator.
  • Blockchain nodes can lock up their tokens for a certain time in order to have the chance of becoming a validator. Generally, the node who locks the biggest stake for the longest period of time has the best chance of becoming the next validator.
  • a computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications wherein the method is performed by a first party and comprises obtaining a verification script of a blockchain transaction, wherein the verification script is configured to: take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point ( ⁇ ), a fourth EC point ( ⁇ ⁇ ), a fifth EC point ( ⁇ ⁇ ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ⁇ ⁇ ), and a third scalar value ( ⁇ ⁇ ), and a message hash (h); verify an x-coordinate ( ⁇ ⁇ ) of the first EC point corresponds to an x-coordinate (
  • Statement 2 The method of statement 1, comprising: submitting a first blockchain transaction to a blockchain network, wherein the first blockchain transaction comprises the verification script.
  • Statement 3 The method of statement 1 or statement 2, wherein said verifying of the third EC point ( ⁇ ) comprises: computing a fourth scalar value ( ⁇ ) based on the first scalar value ( ⁇ ) and a fifth scalar value (e); verifying a seventh EC point ( ⁇ ) corresponds to a point addition of the third EC point ( ⁇ ) and an eighth EC point (E) generated based on the fifth scalar value (e); verifying a second signature generated based on the first scalar value ( ⁇ ) and the message hash (h) is valid for the third EC point ( ⁇ ); and verifying a third signature generated based on the fourth scalar value ( ⁇ ) and the message hash (h) is valid for the seventh EC point ( ⁇ ).
  • Statement 4 The method of statement 3, wherein said verifying of the second signature comprises generating the second signature.
  • Statement 5 The method of statement 4, wherein said generating of the second signature comprises: setting a first component (r) of the second signature as a value based on an x- coordinate ( ⁇ ⁇ ) of the base point (G); and generating a second component (s) of second first signature based on the message hash (h), the first scalar value ( ⁇ ) and the x-coordinate ( ⁇ ⁇ ) of the base point (G).
  • Statement 6 The method of statement 3 or any statement dependent thereon, wherein said verifying of the third signature comprises generating the third signature.
  • said generating of the third signature comprises: setting a first component (r) of the third signature as a value based on an x- coordinate ( ⁇ ⁇ ) of the base point (G); and generating a second component (s) of the third signature based on the message hash (h), the fourth scalar value ( ⁇ ) and the x-coordinate ( ⁇ ⁇ ) of the base point (G).
  • Statement 8. The method of statement 3 or any statement dependent thereon, wherein the fifth scalar value (e) is set as 1 and the eighth EC point (E) is set as the base point (G).
  • verifying of the fifth EC point ( ⁇ ⁇ ) comprises: computing a sixth scalar value ( ⁇ ) based on the third scalar value ( ⁇ ⁇ ) and the fifth scalar value (e); verifying a ninth EC point ( ⁇ ) is a point addition of the fifth EC point ( ⁇ ⁇ ) and the eighth EC point (E) corresponding to the fifth scalar value (e); verifying a fourth signature generated based on the third scalar value ( ⁇ ⁇ ) and the message hash (h) is valid for the fifth EC point ( ⁇ ⁇ ); and verifying a fifth signature generated based on the sixth scalar value ( ⁇ ) and the message hash (h) is valid for the ninth EC point ( ⁇ ).
  • Statement 11 The method of statement 10, wherein the verification script is configured to take as an input a line gradient value ( ⁇ ), and wherein said verifying of the fifth EC point is based on the line gradient value ( ⁇ ).
  • Statement 12 The method of any preceding statement, wherein said obtaining of the verification script comprises generating the verification script.
  • a computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications wherein a blockchain comprises a first blockchain transaction comprising a verification script, wherein the verification script is configured to take as inputs a first EC point (K), a second EC point, (Q), a third EC point ( ⁇ ), a fourth EC point ( ⁇ ⁇ ), a fifth EC point ( ⁇ ⁇ ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ⁇ ⁇ ), and a third scalar value ( ⁇ ⁇ ), and a message hash (h); verify an x-coordinate ( ⁇ ⁇ ) of the first EC point corresponds to an x-coordinate ( ⁇ ⁇ ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q); verify the third EC point ( ⁇ ) corresponds to a point multiplication of the first
  • a computer-implemented method of processing blockchain transactions wherein the method is performed by a transaction processor and comprises: obtaining a first blockchain transaction comprising a verification script, wherein the verification script is configured to take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point ( ⁇ ), a fourth EC point ( ⁇ ⁇ ), a fifth EC point ( ⁇ ⁇ ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ⁇ ⁇ ), and a third scalar value ( ⁇ ⁇ ), and a message hash (h), verify an x-coordinate ( ⁇ ⁇ ) of the first EC point corresponds to an x-coordinate ( ⁇ ⁇ ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q), verify the third EC point ( ⁇ ) corresponds to a point multiplication of the verification script
  • Computer equipment comprising: memory comprising one or more memory units; and processing apparatus comprising one or more processing units, wherein the memory stores code arranged to run on the processing apparatus, the code being configured so as when on the processing apparatus to perform the method of any of statements 1 to 14.
  • Statement 16. A computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of any of statements 1 to 14.
  • a method comprising the actions of some or all of the first party, the second party and the transaction processor.
  • a system comprising the computer equipment of some or all of the first party, the second party and the transaction processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Mathematics (AREA)
  • Algebra (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Storage Device Security (AREA)

Abstract

A computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications, comprising obtaining a verification script configured to verify: an x- coordinate of a first EC point corresponds to an x-coordinate of an EC point generated based on a first scalar value and a second EC point; a third EC point corresponds to a point multiplication of the first scalar value and a base point; a point addition of the fourth EC point and a fifth EC point corresponds to a point addition of the second EC point and the base point; a sixth EC point corresponds to a point addition of the first EC point and the third EC point; an x-coordinate of the sixth EC point corresponds to the first scalar value multiped by the second scalar value; a first signature comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point; a multiplication of the x-coordinate of the sixth EC point and the third scalar value corresponds to the message hash; and the fifth EC point corresponds to a point multiplication of the third scalar value and the base point.

Description

VERIFICATION OF SCALAR MULTIPLICATION OF ELLIPTIC CURVE POINTS IN SCRIPT TECHNICAL FIELD The present disclosure relates to methods for verifying scalar multiplication using blockchain transactions. BACKGROUND Blockchain nodes typically charge fees to users to validate their transaction based on the size of the transaction. When designing locking scripts for complex tasks, minimising the script size reduces the transaction fees. Minimising the script (and therefore) transaction size also reduces the overall size of the blockchain. Security is a hard requirement in many modern use cases, and therefore being able to implement mathematical operations for cryptography in-script (i.e. using a transaction) is an important feature. One such operation is scalar multiplication of points over elliptic curves. A straightforward implementation using the arithmetic opcodes currently available in-script involves several input-dependent loops and branching, which yields a large script. As of now, the only method to verify the scalar multiplication of an arbitrary point in-script is to first perform the computation and then check the equality between the result and the submitted element. One technique to do the computation is described in PCT/EP2023/050089 which implements elliptic curve arithmetic. The implementation follows the first design approach mentioned above, i.e. utilising several input-dependent loops and branching. Consequently, it results in very large scripts. PCT/IB2019/058580 also describes a technique for performing computations in-script but focusing on verifying point addition. In detail, the gradient ^^ of the line that passes through the two summand points is calculated off-chain, and then verified on-chain using the formulas of point addition. This allows to skip calculation of modular inverses in script (which involves a loop of length log ( ^^) where ^^ is the size of the elliptic curve field.) SUMMARY There is therefore a need for a compact script for performing scalar multiplication over elliptic curves. In general there are two paths when designing a script for a mathematical operation: the script computes the operation using the arithmetic opcodes, or the operation is first computed off-chain and then the script verifies its correctness using the inputs and the result with appropriate opcodes. Embodiments described herein take the second approach, resulting in significantly reduced script sizes compared to previous techniques. According to one aspect disclosed herein, there is provided a computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications, wherein the method is performed by a first party and comprises obtaining a verification script, wherein the verification script is configured to: take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h); verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point generated based on the first scalar value (b) and the second EC point (Q); verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G); verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G); verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ); verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^); verify a first signature ( ^^, ^^) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π); verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h); and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G). According to another aspect disclosed herein, there is provided a computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications, wherein a blockchain comprises a first blockchain transaction comprising a verification script, wherein the verification script is configured to take as inputs a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h); verify an x-coordinate ( ^^^) of the first EC point corresponds to an x- coordinate ( ^^^ொ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q); verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G); verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G); verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ); verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^); verify a first signature ( ^^, ^^) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π); verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h); and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G), ), and wherein the method is performed by a second party and comprises: submitting a second blockchain transaction to a blockchain network, wherein the second blockchain transaction comprises, as inputs, the first EC point (K), the second EC point, (Q), the third EC point (Δ), the fourth EC point (Π), the fifth EC point (Δ), the sixth EC point (T), the first scalar value (b), the second scalar value ( ^^), and the third scalar value ( ^^), and a message hash (h). According to another aspect disclosed herein, there is provided a computer-implemented method of processing blockchain transactions, wherein the method is performed by a transaction processor and comprises: obtaining a first blockchain transaction comprising a verification script, wherein the verification script is configured to take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h), verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q), verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G), verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G), verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ), verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^), verify a first signature ( ^^, ^^) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π), verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h), and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G); obtaining a second blockchain transaction comprising the first EC point (K), the second EC point, (Q), the third EC point (Δ), the fourth EC point (Π), the fifth EC point (Δ), the sixth EC point (T), the first scalar value (b), the second scalar value ( ^^), and the third scalar value ( ^^), and a message hash (h); and executing the verification script together with the inputs from the second blockchain transaction. Embodiments of the present disclosure provide a compact script to verify correctness of scalar multiplications, e.g. over the curve secp256k1 that is used by Bitcoin. Mathematically, some embodiments verify that ^^ = ^^ ⋅ ^^ where ^^ is a scalar and ^^ is the base point of an elliptic curve (e.g. secp256k1). Some embodiments verify that ^^ = ± ^^ ⋅ ^^ where ^^ ≠ ^^. Some embodiments verify that ^^ = ^^ ⋅ ^^ where ^^ ≠ ^^. BRIEF DESCRIPTION OF THE DRAWINGS To assist understanding of embodiments of the present disclosure and to show how such embodiments may be put into effect, reference is made, by way of example only, to the accompanying drawings in which: Figure 1 is a schematic block diagram of a system for implementing a blockchain, Figure 2 schematically illustrates some examples of transactions which may be recorded in a blockchain, Figure 3 is a schematic block diagram of an example system for implementing the described embodiments, and Figure 4 schematically illustrates the OP_CHECKSIG process. DETAILED DESCRIPTION OF EMBODIMENTS 1. FAST VERIFICATION OF SCALAR MULTIPLICATION OF ELLIPTIC CURVE POINTS Figure 3 illustrates an example system 300 for implemented the embodiments described herein. The system 300 comprises a first party (e.g. Alice 103a), a second party (e.g. Bob 103b) and one more nodes 104 of a blockchain network 106. Whilst the first party may be referred to herein as Alice 103a and the second party may be referred to herein as Bob 103b, in general the first party and the second party may be configured to perform any or all of the actions described below as being performed by Alice 103a and/or Bob 103b. Alice 103a is configured to obtain a verification script. Depending on the type of blockchain 150, the verification script may be a locking script that locks an output of a transaction. Alice 103a may generate the verification script herself, or she may obtain the verification script from another party, or another resource. E.g. the verification script may be provided as a template from a script provider, or downloaded from the internet. In some examples, Alice 103a generates a first blockchain transaction that contains the verification script, e.g. as a locking script. Alice 103a may submit the first blockchain transaction to the blockchain network 106, as shown in Figure 3. Alternatively, Alice 103a may send the first blockchain transaction to another party, e.g. Bob 103b, who then submits it the blockchain network 106. Bob 103b is configured to generate a second blockchain transaction and submit the second blockchain transaction to the blockchain network, as shown in Figure 3. The second blockchain transaction references the first blockchain transaction. Bob 103b is configured to generate the values required by the verification script, and include the values in the second blockchain transaction, e.g. as part of an unlocking script. A transaction processor, e.g. a blockchain node 104, is configured to obtain the first and second blockchain transactions, and execute the verification script from the first blockchain transaction together with the values from the second blockchain transaction, e.g. as part of validating the second blockchain transaction. 1.1 Verify ^^ = ^^ ⋅ ^^ In some embodiments, the verification script is configured to verify that an elliptic curve (EC) point (a “first EC point”) is a multiplication of a scalar value (a “first scalar value”) and a base point of the elliptic curve. For convenience, the first EC point will be denoted as ^^, the first scalar value will be denoted as ^^, and the base point will be denoted as ^^. Put another way, the verification script may be configured to verify that ^^ = ^^ ⋅ ^^. In these embodiments, the verification script uses ^^, ^^, a second EC point (Γ) and a message hash (ℎ) to perform the verification. One or more values may be included in the verification script. One or more values may be supplied to the verification script, e.g. from a second blockchain transaction. The message hash (ℎ) may be based on the second blockchain transaction, i.e. a transaction that references the first blockchain transaction, or more specifically an output thereof. The second blockchain transaction may be referred to as the spending transaction. The verification script may be configured to calculate a second scalar value ( ^^) based on , e.g. as an addition of, the first scalar value ( ^^) and a third scalar value ( ^^). The third scalar value ( ^^) and/or the third EC point ( ^^) may be included in the verification script of the spending transaction. The verification script also verifies that the second EC point (Γ) is equal to a point addition of the first scalar value ( ^^) and a third EC point ( ^^), where the third EC point ( ^^) is the result of multiplying the third scalar value ( ^^) and the base point ( ^^). For efficiency, the third scalar value may ( ^^) be hardcoded as 1, meaning the third EC point ( ^^) is equal to the basepoint ( ^^). The verification script also verifies a first signature generated based on the first scalar value ( ^^) and the message hash (ℎ) is a valid signature when validated against the first EC point ( ^^). The signature may be verified with a dedicated opcode, such as OP_CHECKSIG. A second signature is also verified, e.g. using OP_CHECKSIG. The second signature is generated based on the second scalar value ( ^^) and the message hash (ℎ), and validated against the second EC point (Γ). If the verifications pass, the implication is that ^^ = ^^ ⋅ ^^. In some examples, the verification script may be configured to generate the first and/or second signatures in-script. For example, the verification script may generate the first signature ( ^^, ^^), where ^^ is based on the x-coordinate of the base point, e.g. ^^ ≔ ^^ ^^ ^^ ^^ ^^, and ^^ is generated based on the first scalar value ( ^^), ^^ , and the message hash (ℎ), e.g. ^^ = (ℎ + ^^ ^^)/ ^^ ^^ ^^ ^^ ^^. Here, the first scalar value ( ^^) is the signing key. In some examples, the ephemeral key ^^ is set to one, i.e. ^^ = 1. Similarly, the verification script may generate the second signature ( ^^, ^^), where ^^ is based on the x-coordinate of the base point, e.g. ^^ ≔ ^^ ^^ ^^ ^^ ^^, and ^^ is generated based on the second scalar value ( ^^), ^^ , and the message hash (ℎ), e.g. ^^ = ℎ + ^^ ^^ ^^ ^^ ^^ ^^. Here, the second scalar value ( ^^) is the signing key. In some examples, the verification script may verify the second EC point (Γ) is equal to a point addition of the first and third EC points (i.e. Γ = ^^ + ^^) based on a line gradient value ( ^^), which may be included in the verification script or supplied to the verification script. For example, the verification script may perform the technique described in PCT/IB2019/058580. The following describes a specific example of the verification script. Here, the injected spending transaction is treated as auxiliary information needed to execute the PUSHTX script. However, it is not necessary to authenticate the injected copy. Thus, the part of the script that deals with this is removed (steps 1-4 from the script shown in section 4 below). Note that in the context of batching many scalar multiplication verifications, the first four steps will be performed on the same message each time. For completeness, the steps of the modified PUSHTX script is shown below. It is referred to as VERIFYKEYPAIR to avoid confusion. Note that the script takes as input the scalar ^^, interpreted as the signing key, and the point ^^ interpreted as the public key. Input: publick key ^^, signing key ^^, and message hash ℎ Steps: The script (VERIFYKEYPAIR)does the following: 1. move ^^ to the altstack 2. compute ^^ = ℎ + ^^ ^^ ^^ ^^ ^^ ^^ 3. convert ^^ to ^^ − ^^ if ^^ > ^^/2, 4. obtain length of ^^, 5. reverse endianness of ^^ (32 bytes), 6. reverse one more byte if the length of ^^ is greater than 32, 7. compute the total length of a DER signature (0x24 + ^^ ^^ ^^ ^^ ^^ℎ ^^ ^^ ^^), 8. add DER prefix0x30, 9. concatenate ^^ ≔ ^^ , 10. concatenate ^^, 11. concatenate sighash flag “ALL”, 12. bring ^^ from the altstack and call OP_CHECKSIG. We first show that PUSHTX (and hence VERIFYKEYPAIR) limits the scalar of ^^ to just two possible values. Lemma 1. Let ℎ be the sighash of the spending transaction. If in PUSHTX we set the ephemeral key to ^^ ≔ 1, the signing key to ^^ ^^ ≔ ^^, and the public key to ^^ ^^ ≔ ^^, then
Figure imgf000009_0001
Proof. Let us write ^^ = ( ^^ + ^^^) ⋅ ^^. We can always do this for suitable ^^^. We need to show that ^^^ can only take the two values specified in the statement of the lemma. Since PUSTHX (with ephemeral key set to one) is successful, step 3 of the ECDSA algorithm holds (see Error! Reference source not found.). Namely, the x-coordinate of: equals ^^ . In other words, ^^ = ^^ ≔ ( ^^, ^^) or ^^ = − ^^ ≔ ( ^^, − ^^). Thus, from equation (1) we conclude ^ା௫ಸ(^ାఢೌ) ^ା^௫ಸ = ±1. Solving these two equations for ^^^ gives the desired values. With Lemma 1 we have a mechanism to restrict the possible values of the scalar of ^^ to just two scalars. We now describe our mechanism VERIFY_BASEPOINT_MULTIPLICATION to enforce that
Figure imgf000010_0001
this, we use a different point ^^ ∶= ^^ ⋅ ^^. This point ^^ and its exponent ^^ ≠ 0 aid verification. They may be precomputed and hard-coded in the script. It guarantees the correctness of ^^. The script receives ^^, ^^ as input, it also receives an extra point Γ ≔ ^^ + ^^ = ( ^^ + ^^ ) ⋅ ^^. To optimize the size of the script, given that ^^ is already present we may set ^^ ≔ 1 and ^^ = ^^. Input: Points ^^, Γ, scalar ^^, line gradient ^^^, and message hash ℎ Steps: The script (VERIFY_BASEPOINT_MULTIPLICATION) does the following: 1. Compute ^^ ≔ ^^ + ^^ 2. Verify Γ = ^^ + ^^ // Using line gradient ^^ as explained in PCT/IB2019/058580 3. RunVERIFYKEYPAIR with ^^ ^^ ≔ ^^, ^^ ^^ ≔ ^^ . 4. RunVERIFYKEYPAIR with ^^ ^^ ≔ ^^ ^^ ^^ ≔ Γ We now show that the script is secure. Lemma 2. If all the tests (steps 2,3,4) of the script VERIFY_BASEPOINT_MULTIPLICATION are successful, then ^^ = ^^ ⋅ ^^. Proof. Tests 3 and 4 allows to write (using Lemma 1): ^^ = ( ^^ + ^^^) ⋅ ^^, Γ = ൫ ^^ + ^^൯ ⋅ ^^ Now, if ^^^ = 0, we are done. So, suppose that ^^^ ≠ 0. Test 2 allows us to write: ൫ ^^ + ^^ఊ൯ ⋅ ^^ = Γ = ^^ + ^^ = ( ^^ + ^^^ + ^^ ) G. Since ^^ ≔ ^^ + ^^ (computed in step 1), equating the scalars ^^ + ^^, and ^^ + ^^^ + ^^ in the above equation we conclude that:
Figure imgf000011_0001
which means that ^^ ≠ 0 (we are assuming ^^^ ≠ 0). Now, using again Lemma 1 we know their exact non-zero values, and substituting those values in (2) we obtain:
Figure imgf000011_0002
However, this is not possible because the precomputed point ^^ is not the identity element. In other words, ^^ ≠ 0. This is a contradiction, so we must have ^^^ = 0, and hence ^^ = ^^ ⋅ ^^. 1.2 ^^ = ± ^^ ⋅ ^^ In some embodiments, the verification script is configured to verify that an elliptic curve (EC) point (a “fourth EC point”) is a multiplication of either a positive or negative scalar value (a “fourth scalar value”) and an arbitrary elliptic curve point (a “fifth EC point”). For convenience, the fourth EC point will be denoted as ^^, the fourth scalar value will be denoted as ^^, and the fifth EC point will be denoted as ^^. Put another way, the verification script may be configured to verify that ^^ = ± ^^ ⋅ ^^. The verification script may be configured to verify ^^ = ± ^^ ⋅ ^^ and to verify ^^ = ^^ ⋅ ^^, or the verification script may be configured to verify ^^ = ± ^^ ⋅ ^^ as a standalone verification. In some examples, the verification script may be configured to verify ^^ = ^^ ⋅ ^^ as part of verifying ^^ = ± ^^ ⋅ ^^. In these embodiments, the verification script uses ^^, ^^, ^^, a sixth EC point ( ^^^) and a fifth scalar value ( ^^^) to perform the verification. One or more values may be included in the verification script. One or more values may be supplied to the verification script, e.g. from the second blockchain transaction. The verification script may be configured to verify an x-coordinate of the fourth EC point ( ^^) is equal to the fourth scalar value ( ^^) multiplied by fifth scalar value ( ^^^), or more generally the verification script may be configured to verify that
Figure imgf000012_0001
= ^^^/ ^^. Any other suitable technique may be used, e.g. given ^^ and , ^^^ as inputs, compute its inverse ^^′ = 1/ ^^ on- chain, and verify
Figure imgf000012_0002
= ^^^/ ^^′. The verification script also verifies that a third signature ( ^^^, ^^^) comprising the x-coordinate of the fourth EC point ( ^^) and the fifth scalar value ( ^^^) is a valid signature when validated against the sixth EC point ( ^^^). The signature may be verified with a dedicated opcode, such as OP_CHECKSIG. In examples where the verification script is configured to verify ^^ = ^^ ⋅ ^^ as part of verifying ^^ = ± ^^ ⋅ ^^, the verification script is configured to verify that the fifth EC point ( ^^) is equal to a point addition of the first EC point ( ^^) and the sixth EC point ( ^^^), or more generally the verification script may be configured to verify that ^^^ = ^^ − ^^ ⋅ ^^. The verification script may verify that ^^ = ^^^ + ^^ and that ^^ = ^^ ⋅ ^^, or use any suitable technique to verify that ^^^ = ^^ − ^^ ⋅ ^^. In these examples, the verification script also verifies that the result of multiplying the x-coordinate of the fourth EC point ( ^^) and the first scalar value ( ^^) is equal to the message hash (ℎ). The fifth EC point (Q) may be verified using a line gradient value ( ^^), e.g. as described in PCT/IB2019/058580. The following describes a specific example of the verification script for verifying the multiplication of a scalar and a group element, namely verifying the equation: ^^ = ± ^^ ⋅ ^^ in script. In particular, this section focuses on the verification of the equation on the x part, namely verifying the equation: ^^^ = ^^^⋅ொ. There are applications where verifying ^^^ = ^^^⋅ொ (i.e. verifying ^^ = ± ^^ ^^) is enough, e.g. when the script wants to verify if ^^ ≠ ^^ ⋅ ^^. In this context, if ^^^ ≠ ^^^⋅ொ then it can be concluded that ^^ ≠ ^^ ⋅ ^^. Let ^^ ⋅ ^^ ≔ ( ^^^ொ, ^^^ொ) be the correct result of the scalar multiplication and let ^^ ≔ ( ^^^, ^^^) be the claimed result point. To avoid degenerated cases, the verification script may reject the proof if ^^ = 0 or ^^ does not belong to the correct curve, e.g. secp256k1. OP_CHECKSIG enforces equality of the x-coordinate of the calculated point ^^ (using the s- component of the signature in the calculation). We use an additional point provided by the user (e.g. Bob 103b):
Figure imgf000013_0001
Where ℎ is the sighash of the spending transaction. The user (e.g. Bob 103b) provides points ^^, ^^, Π^ and scalars ^^, ℎ, ^^^. The steps to check correct computation of ^^^ = ^^^ொ are as follows. 1. Check that ^^^ = ^^^ ^^ 2. Call OP_CHECKSIG on inputs:
Figure imgf000013_0002
^^. So far, it is assumed that the user-provided input is ^ ⋅ ^^. We can verify that this
Figure imgf000013_0003
is indeed the case in script by asking the user to provide further information. Namely, the user provides point Δ^, line gradient ^^, and scalar
Figure imgf000013_0004
and the script proceeds as follows: 3. Check Δ^ +
Figure imgf000013_0005
= ^^ // Using line gradient ^^. This ensures
Figure imgf000013_0006
= ^^ − Δ^ 4. Check that the ^^^ ^^^ = ℎ // This ensures that ^
Figure imgf000013_0007
= ^^^ ℎ 5. Check that
Figure imgf000013_0008
script VERIFY_BASEPOINT_MULTIPLICATION on input ( ^^^, Δ^).
Input: Points ^^ ≔ ( ^^^, ^^^), ^^ = ( ^^, ^^), Π^, Δ, Δ^, scalars ^^, ^^^, ^^^, line gradients ^^, ^^^, and message hash ℎ Steps: The script (VERIFY_POINT_MULTIPLICATION first coordinate only) does the following: 1. // Verify ^^ and ^^ are in secp256k1 using the curve equation: a. Check ^^^ = ^^^ + 7 ^^ ^^ ^^ ^^ b. Check ^^ = ^^ + 7 ^^ ^^ ^^ ^^ 2. // Verify correctness of base-point scalars and s-component of signatures: a. Check ^^^ ^^^ = ℎ ^^ ^^ ^^ ^^ b. Check ^^^ = ^^^ ^^ ^^ ^^ ^^ ^^ 3. // Verify base-point multiplications: (For example, using VERIFY_BASEPOINT_MULTIPLICATION) a. Check Δ = ^^ ⋅ ^^ b. Check Δ^ = ^^^ ⋅ ^^ 4. // Verify point additions: a. Check ^^ = ^^ + Δ // Using ^^ b. Check Δ^ + Π^ = ^^ // Using ^^^ 5. // Verify x-coordinates: a. Call OP_CHECKSIG on inputs: ^^ ^^ ^^ ≔ ( ^^^, ^^^) = ( ^^^, ^^^), ^^ ^^ ≔ Π^ If the tests 1-5 above pass, then ^^ = ± ^^ ⋅ ^^. 1.3 ^^ = ^^ ⋅ ^^ In some embodiments, the verification script is configured to verify that the fourth EC point ( ^^) is a multiplication of the fourth scalar value ( ^^) and the fifth EC point ( ^^). Put another way, the verification script may be configured to verify that ^^ = ^^ ⋅ ^^. The verification script may be configured to verify ^^ = ^^ ⋅ ^^ and to verify ^^ = ^^ ⋅ ^^, or the verification script may be configured to verify ^^ = ^^ ⋅ ^^ as a standalone verification. In some examples, the verification script may be configured to verify ^^ = ^^ ⋅ ^^ as part of verifying ^^ = ^^ ⋅ ^^. Similarly, the verification script may first verify that ^^ = ± ^^ ⋅ ^^ using the script described in section 1.2 and then verify that ^^ = ^^ ⋅ ^^, or a different technique may be used to verify that ^^ = ± ^^ ⋅ ^^, after which the verification script verifies ^^ = ^^ ⋅ ^^. In embodiments where the verification script first verifies ^^ = ± ^^ ⋅ ^^, the verification script uses ^^ a seventh EC point ( ^^), an eighth EC point ( ^^), a ninth EC point ( ^^), a tenth EC point ( ^^), a sixth scalar value ( ^^), and a seventh scalar value ( ^^) to perform the verification. One or more values may be included in the verification script. One or more values may be supplied to the verification script, e.g. from the second blockchain transaction. The verification script is configured to verify that the seventh EC point ( ^^) is equal to a point multiplication of the fourth scalar value ( ^^) and the base point ( ^^). In some examples, the verification script described in section 1.2 is used to perform this verification. In other examples, a different technique may be used. Similarly, the verification script is configured to verify that the ninth EC point ( ^^) is equal to a point multiplication of the fourth scalar value ( ^^) and the base point ( ^^). In some examples, the verification script described in section 1.2 is used to perform this verification. In other examples, a different technique may be used. The verification script may be configured to verify that that the point addition of the eighth and ninth EC points (i.e. Δ + Π) is equal to a point addition of the fifth EC point and the base point (i.e. ^^ + ^^). More generally, the verification script may be configured to verify that Π = ( ^^ + ^^) − Δ. Any suitable technique may be used. The verification script also verifies that the tenth EC point ( ^^) is equal to the point addition of the fourth and seventh EC points (i.e. ^^ + Δ), and that an x-coordinate of the tenth EC point is equal to the result of multiplying the fourth scalar value ( ^^) and the sixth scalar value ( ^^). The verification script also verifies that a multiplication of the x-coordinate of the tenth EC point ( ^^) and the seventh scalar value ( ^^) is equal to the message hash (ℎ). The verification script also verifies a fourth signature comprising the x-coordinate of the tenth EC point ( ^^) and the sixth scalar value ( ^^) is a valid signature when validated against the eighth EC point (Π). The signature may be verified with a dedicated opcode, such as OP_CHECKSIG. The following describes a specific example of the verification script for verifying the multiplication of a scalar and a group element, namely verifying the equation: ^^ = ^^ ⋅ ^^ in script. If ^^^ = ^^^ொ and ^^ ≔ ( ^^^, ^^^) belongs to the curve, then either ^^ = ^^ ⋅ ^^ = ( ^^^, ^^^ொ) or ^^ = − ^^ ⋅ ^^ = ( ^^^, − ^^^ொ). In other words, to verify correct scalar multiplication, it is not enough to verify that ^^ has the same x-coordinate than ^^ ⋅ ^^. It is also necessary to verify the equality of the y-coordinates ^^^ = ^^^ொ. Unfortunately, opcode OP_CHECKSIG does not directly verify the y-coordinate of the signature. This is overcome using the verification mechanism of the x-coordinate from Section 1.2 on point ^^ ≔ ( ^^, ^^) = ^^ + ^^ ⋅ ^^. This allows for verification of: ^^ = ^^^^^^ௗ( ^^ ⋅ ^^ + ^^ ⋅ ^^ ) Continuing with the method described above: 6. Get Δ as input and verify that Δ = ^^ ⋅ ^^ // e.g. with script VERIFY_BASEPOINT_MULTIPLICATION. 7. Get Π and Δ as input and verify Δ + Π = ^^ + ^^ // e.g. using the technique described in PCT/IB2019/058580iteratively (two verifications) 8. Check ^^ = ^^ + Δ // e.g. using the technique described in PCT/IB2019/058580. 9. Check ^^ ^^ = ^^ 10. Call OP_CHECKSIG on inputs ^^ ^^ ^^ = ( ^^், ^^ଶ ) , and ^^ ^^ = Πଶ. 11. Check that ^^ ^^ = ℎ. 12. Check that Δ = ^^ ⋅ ^^ // With script VERIFY_BASEPOINT_MULTIPLICATION on input ( ^^, Δ). If tests 6-12 pass, then ^^ + ^^ ⋅ ^^ = ± ^^( ^^ + ^^), or more generally ^^ = ±( ^^ + ^^) − Δ . For completeness we put together all the tests described thus far. We call the resulting script VERIFY_POINT_MULTIPLICATION. It is shown below. Input: Points ^^ ≔ ( ^^^, ^^^), ^^ = ( ^^, ^^), Π^, Π, Δ, Δ^, Δ, scalars ^^, ^^^, ^^, ^^^, ^^, line gradients ^^, ^^^, ^^ଶ,^, ^^ଶ,ଶ, and message hash ℎ Steps: The script (VERIFY_POINT_MULTIPLICATION) does the following: 1. // Verify ^^ and ^^ are in secp256k1 using the curve equation: a. Check ^^^ = ^^^ + 7 ^^ ^^ ^^ ^^ b. Check ^^ = ^^ + 7 ^^ ^^ ^^ ^^ 2. // Verify correctness of base-point scalars and s-component of signatures: a. Check ^^^ ^^^ = ℎ ^^ ^^ ^^ ^^ b. Check ^^ ^^ = ℎ ^^ ^^ ^^ ^^ c. Check ^^^ = ^^^ ^^ ^^ ^^ ^^ ^^ d. Check ^^ = ^^ ^^ ^^ ^^ ^^ ^^ 3. // Verify base-point multiplications: (For example as described in section 1.1) a. Check Δ = ^^ ⋅ ^^ b. Check Δ^ = ^^^ ⋅ ^^ c. Check Δ = ^^ ⋅ ^^ 4. // Verify point additions: a. Check ^^ = ^^ + Δ // Using ^^ b. Check Δ^ + Π^ = ^^ // Using ^^^ c. Check Δ + Π = ^^ + ^^ // Using ^^ଶ,^, ^^ଶ,ଶ 5. // Verify x-coordinates: a. CallOP_CHECKSIG on inputs: ^^ ^^ ^^ ≔ ( ^^^, ^^^) = ( ^^^, ^^^), ^^ ^^ ≔ Π^ b. CallOP_CHECKSIG on inputs ^^ ^^ ^^ = ( ^^, ^^), and ^^ ^^ = Π The verification script may verify the point ^^ is on the correct curve using the curve equation. It is not necessary to verify ^^ is on the curve as it is implied by the equality ^^ = ^^ + Δ . Note again that each of the verification script described in sections 1.1, 1.2 and 1.3 are independent. In particular, verification script described in section 1.3 is independent of how base point multiplications are verified. Any script that verifies correctness of the Δ values will work, but in practice VERIFY_BASEPOINT_MULTIPLICATION may be used to reduce script size. Each script is also independent of how point addition is verified. In the technique described in PCT/IB2019/058580may be used. The following shows that script VERIFY_POINT_MULTIPLICATION successfully terminates, then ^^ = ^^ ⋅ ^^. Lemma 3: Let ℎ be the sighash message of the transaction. Suppose ^^, ^^ are in the Bitcoin curve. Then if OP_CHECKSIG pass on inputs ( ^^, ^^ ) ≔ ( ^^ ^,
Figure imgf000018_0001
^ ), ^^ ^^ ≔ ^^ − ⋅ ^^ we have ^^ = ± ^^ ⋅ ^^. Proof: OP_CHECKSIG verifies the following equation:
Figure imgf000018_0002
which follows from the ECDSA verification that is part of the OP_CHECKSIG logic. Substituting gives:
Figure imgf000018_0003
Figure imgf000018_0004
= ^^^^^^ௗ( ^^ ⋅ ^^) The above chain of equalities shows that ^^ and ^^ ⋅ ^^ have the same x-coordinate. By assumption, ^^ and ^^ are in the curve, so is ^^ ⋅ ^^. By the group law of elliptic curves, we have ^^ = ± ^^ ⋅ ^^. Proposition 1: Assume ^^, ^^ are in the curve, and that test 5 is done with script VERIFY_BASEPOINT_MULTIPLICATION. Then if tests 1-5 pass, we have ^^ = ± ^^. Proof: Test 1 ensures that
Figure imgf000018_0006
and tests 3-5 ensure that Π^ = ^^ −
Figure imgf000018_0005
⋅ ^^ (using lemma
Figure imgf000018_0007
2). Thus OP_CHECKSIG in test 2 is called on inputs ( ^^, ^^) ≔ ( ^^ ௫^ ^, ^ ), ^^ ^^ ≔ Π^. Using lemma 3 we conclude ^^ = ± ^^. ^^ Proposition 2: Assume ^^, ^^ are in the curve, and that tests 6, 12 are done with script VERIFY_BASEPOINT_MULTIPLICATION. Then if tests 6-12 pass, we have that ^^ + ^^ ⋅ ^^ = ± ^^ ⋅ ( ^^ + ^^). Proof: Tests 6, 8 ensure that ^^ = ^^ + ^^ ⋅ ^^. Test 9 ensures that ^^
Figure imgf000019_0001
ଶ ≔ , and tests 7, 11, 12,
Figure imgf000019_0002
ensure that Π = ^^ + ^^ −௫^ ⋅ ^^ (using lemma 2). Thus the OP_CHECKSIG of test 10 is called on inputs ( ^^, ^^ )
Figure imgf000019_0003
^^ ^^ ≔ Π. Using lemma 3 we conclude ^^ + ^^ ⋅ ^^ = ^^ = ± ^^( ^^ + ^^). Theorem 1: Let two points ^^, ^^ and scalar ^^. If script VERIFY_POINT_MULTIPLICATION from Error! Reference source not found. is successful, then ^^ = ^^ ⋅ ^^. Proof: The tests 2-5 described in the script are exactly tests 1-12 (relabelled) from Section Error! Reference source not found. and Section 1.3. Thus, if ^^, ^^ are in the curve, propositions 1 and 2 guarantee that ^^ = ± − ^^ ⋅ ^^ and ^^ + ^^ ⋅ ^^ = ± ^^ ⋅ ( ^^ + ^^). (Note the script enforces ^^, ^^ are in the curve in test 1a, 1b). Let’s assume that ^^ = − ^^ ⋅ ^^. We either we have:
Figure imgf000019_0004
Or
Figure imgf000019_0005
From the first system of equations, we have ^^ = 0 which is not possible because the script enforces that ^^ is on the (affine) curve. The second system of equations says that 2 ^^ ⋅ ^^ = 0 which is false by construction of the base point and because 2 ^^ cannot be the order of ^^. We have contradicted our first assumption, so we conclude that ^^ = ^^ ^^. 1.4 Example Applications Scalar multiplication in script enables a variety of smart contract applications. However, it renders scripts of large sizes. We can replace scalar multiplication with the verifications described above. This will reduce the size of the locking script (and therefore the smart contract) drastically. 1.4.1 Inner Product (Verifying ^^ = ^^ ^^, where ^^ ≠ ^^) Inner Product operation is from ( ^^^, … , ^^^) ∈
Figure imgf000020_0001
computing ^^ = ^^^ ⋅ ^^^ + ⋯ + ^^^ ⋅ ^^^ To verify the computation of an inner product we can verify each scalar multiplication individually with the methods described above. The prover will give ^^^, … , ^^^ along the elements needed to prove that ^^^ = ^^^ ⋅ ^^^. The script will verify that ^^^ = ^^^ ⋅ ^^^ for all 1 ≤ ^^ ≤ ^^. Then the script verifies that ^^ = ∑^ ^ୀ^ ^^^ . Since Inner product verification is the computation needed to verify a Bulletproof zk-SNARK, the described embodiments enable zk-SNARK in script. We stress that Bulletproof verification is linear in the size of the circuit but since our implementation is very light compared to computing a pairing in script, if the circuit is not too complex, our solution will give smaller script size than any pairing based SNARK. 1.4.2 Efficient Σ-protocol verifiers (Verifying ^^ = ^^ ^^ and ^^ = ± ^^ ^^) UK patent application GB2206040.4 describes how to implement Σ-protocols on-chain leveraging scripts for elliptic-curve arithmetic. These are used to construct privacy- preserving threshold multi signatures, where no one except the subset redeeming the funds know who spends the outputs. In the multi signature Σ-protocol, one needs to verify ^^ = ^^ ^^ − ^^ ^^,where ^^ is the basepoint and ^^ is the public key. To spend an ^^-out- ^^ private threshold multi signature, the locking script needs to perform 2 ^^൫^ ^ ൯ fixed-point scalar multiplications. Each fixed-point scalar multiplication over secp256k1 takes about 700KB. For example, setting ^^ = 2 ^^ = 4, we would need 24 fixed- point scalar multiplications, giving a script of size roughly 16MB. 1.4.3 Pedersen commitments PCT/EP2023/050089 proposes to redeem funds, where one provides the message and the Pederson opening. The script recomputes the commitment and check it matches the one hard-coded in the script. To recompute the commitment two fixed-point scalar multiplications need to be done. This gives a size of roughly 1.4MB. 1.4.4 ElGamal decryption Funds can be spent by providing the decryption key and the plaintext. This time one single fixed-point scalar multiplication is needed, which gives a script of size roughly 700KB. 2. EXAMPLE SYSTEM OVERVIEW A blockchain refers to a form of distributed data structure, wherein a duplicate copy of the blockchain is maintained at each of a plurality of nodes in a distributed peer-to-peer (P2P) network (referred to below as a “blockchain network”) and widely publicised. The blockchain comprises a chain of blocks of data, wherein each block comprises one or more transactions. Each transaction, other than so-called “coinbase transactions”, points back to a preceding transaction in a sequence which may span one or more blocks going back to one or more coinbase transactions. Coinbase transactions are discussed further below. Transactions that are submitted to the blockchain network are included in new blocks. New blocks are created by a process often referred to as “mining”, which involves each of a plurality of the nodes competing to perform “proof-of-work”, i.e. solving a cryptographic puzzle based on a representation of a defined set of ordered and validated pending transactions waiting to be included in a new block of the blockchain. It should be noted that the blockchain may be pruned at some nodes, and the publication of blocks can be achieved through the publication of mere block headers. The transactions in the blockchain may be used for one or more of the following purposes: to convey a digital asset (i.e. a number of digital tokens), to order a set of entries in a virtualised ledger or registry, to receive and process timestamp entries, and/or to time- order index pointers. A blockchain can also be exploited in order to layer additional functionality on top of the blockchain. For example, blockchain protocols may allow for storage of additional user data or indexes to data in a transaction. There is no pre-specified limit to the maximum data capacity that can be stored within a single transaction, and therefore increasingly more complex data can be incorporated. For instance this may be used to store an electronic document in the blockchain, or audio or video data. In an “output-based” model (sometimes referred to as a UTXO-based model), the data structure of a given transaction comprises one or more inputs and one or more outputs. Any spendable output comprises an element specifying an amount of the digital asset that is derivable from the proceeding sequence of transactions. The spendable output is sometimes referred to as a UTXO (“unspent transaction output”). The output may further comprise a locking script specifying a condition for the future redemption of the output. A locking script is a predicate defining the conditions necessary to validate and transfer digital tokens or assets. Each input of a transaction (other than a coinbase transaction) comprises a pointer (i.e. a reference) to such an output in a preceding transaction, and may further comprise an unlocking script for unlocking the locking script of the pointed-to output. So consider a pair of transactions, call them a first and a second transaction (or “target” transaction). The first transaction comprises at least one output specifying an amount of the digital asset, and comprising a locking script defining one or more conditions of unlocking the output. The second, target transaction comprises at least one input, comprising a pointer to the output of the first transaction, and an unlocking script for unlocking the output of the first transaction. 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 criteria for validity applied at each node will be that the unlocking script meets all of the one or more conditions defined in the locking script of the first transaction. Another will be that the output of the first transaction has not already been redeemed by another, earlier valid transaction. Any node that finds the target transaction invalid according to any of these conditions will not propagate it (as a valid transaction, but possibly to register an invalid transaction) nor include it in a new block to be recorded in the blockchain. An alternative type of transaction model is an account-based model. In this case each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance. The current state of all accounts is stored by the nodes separate to the blockchain and is updated constantly. Figure 1 shows an example system 100 for implementing a blockchain 150. The system 100 may comprise a packet-switched network 101, typically a wide-area internetwork such as the Internet. The packet-switched network 101 comprises a plurality of blockchain nodes 104 (often referred to as “miners”) that may be arranged to form a peer-to-peer (P2P) network 106 within the packet-switched network 101. Whilst not illustrated, the blockchain nodes 104 may be arranged as a near-complete graph. Each blockchain node 104 is therefore highly connected to other blockchain nodes 104. Each blockchain node 104 comprises computer equipment of a peer, with different ones of the nodes 104 belonging to different peers. Each blockchain node 104 comprises processing apparatus comprising one or more processors, e.g. one or more central processing units (CPUs), accelerator processors, application specific processors and/or field programmable gate arrays (FPGAs), and other equipment such as application specific integrated circuits (ASICs). Each node also comprises memory, i.e. computer-readable storage in the form of a non-transitory computer-readable medium or media. The memory may comprise one or more memory units employing one or more memory media, e.g. a magnetic medium such as a hard disk; an electronic medium such as a solid-state drive (SSD), flash memory or EEPROM; and/or an optical medium such as an optical disk drive. The blockchain 150 comprises a chain of blocks of data 151, wherein a respective copy of the blockchain 150 is maintained at each of a plurality of blockchain nodes 104 in the distributed or blockchain network 106. As mentioned above, maintaining a copy of the blockchain 150 does not necessarily mean storing the blockchain 150 in full. Instead, the blockchain 150 may be pruned of data so long as each blockchain node 150 stores the block header (discussed below) of each block 151. Each block 151 in the chain comprises one or more transactions 152, wherein a transaction in this context refers to a kind of data structure. The nature of the data structure will depend on the type of transaction protocol used as part of a transaction model or scheme. A given blockchain will use one particular transaction protocol throughout. A blockchain node 104 may be configured to forward transactions 152 to other blockchain nodes 104, and thereby cause transactions 152 to be propagated throughout the network 106. A blockchain node 104 may be configured to create blocks 151 and to store a respective copy of the same blockchain 150 in their respective memory. A blockchain node 104 may also maintain an ordered set (or “pool”) 154 of transactions 152 waiting to be incorporated into blocks 151. The ordered pool 154 is often referred to as a “mempool”. This term herein is not intended to limit to any particular blockchain, protocol or model. It refers to the ordered set of transactions which a node 104 has accepted as valid and for which the node 104 is obliged not to accept any other transactions attempting to spend the same output. In a given present transaction 152j, the (or each) input comprises a pointer referencing the output of a preceding transaction 152i in the sequence of transactions, specifying that this output is to be redeemed or “spent” in the present transaction 152j. Spending or redeeming does not necessarily imply transfer of a financial asset, though that is certainly one common application. More generally spending could be described as consuming the output, or assigning it to one or more outputs in another, onward transaction. In general, the preceding transaction could be any transaction in the ordered set 154 or any block 151. The preceding transaction 152i need not necessarily exist at the time the present transaction 152j is created or even sent to the network 106, though the preceding transaction 152i will need to exist and be validated in order for the present transaction to be valid. Hence “preceding” herein refers to a predecessor in a logical sequence linked by pointers, not necessarily the time of creation or sending in a temporal sequence, and hence it does not necessarily exclude that the transactions 152i, 152j be created or sent out-of-order (see discussion below on orphan transactions). The preceding transaction 152i could equally be called the antecedent or predecessor transaction. Due to the resources involved in transaction validation and publication, typically at least each of the blockchain nodes 104 takes the form of a server comprising one or more physical server units, or even whole a data centre. However in principle any given blockchain node 104 could take the form of a user terminal or a group of user terminals networked together. The memory of each blockchain node 104 stores software configured to run on the processing apparatus of the blockchain node 104 in order to perform its respective role or roles and handle transactions 152 in accordance with the blockchain node protocol. It will be understood that any action attributed herein to a blockchain node 104 may be performed by the software run on the processing apparatus of the respective computer equipment. The node software may be implemented in one or more applications at the application layer, or a lower layer such as the operating system layer or a protocol layer, or any combination of these. Any given blockchain node may be configured to perform one or more of the following operations: validating transactions, storing transactions, propagating transactions to other peers, performing consensus (e.g. proof-of-work) / mining operations. In some examples, each type of operation is performed by a different node 104. That is, nodes may specialise in particular operation. For example, a nodes 104 may focus on transaction validation and propagation, or on block mining. In some examples, a blockchain node 104 may perform more than one of these operations in parallel. Any reference to a blockchain node 104 may refer to an entity that is configured to perform at least one of these operations. Also connected to the network 101 is the computer equipment 102 of each of a plurality of parties 103 in the role of consuming users. These users may interact with the blockchain network 106 but do not participate in validating transactions or constructing blocks. Some of these users or agents 103 may act as senders and recipients in transactions. Other users may interact with the blockchain 150 without necessarily acting as senders or recipients. For instance, some parties may act as storage entities that store a copy of the blockchain 150 (e.g. having obtained a copy of the blockchain from a blockchain node 104). Some or all of the parties 103 may be connected as part of a different network, e.g. a network overlaid on top of the blockchain network 106. Users of the blockchain network (often referred to as “clients”) may be said to be part of a system that includes the blockchain network 106; however, these users are not blockchain nodes 104 as they do not perform the roles required of the blockchain nodes. Instead, each party 103 may interact with the blockchain network 106 and thereby utilize the blockchain 150 by connecting to (i.e. communicating with) a blockchain node 106. Two parties 103 and their respective equipment 102 are shown for illustrative purposes: a first party 103a and his/her respective computer equipment 102a, and a second party 103b and his/her respective computer equipment 102b. It will be understood that many more such parties 103 and their respective computer equipment 102 may be present and participating in the system 100, but for convenience they are not illustrated. Each party 103 may be an individual or an organization. Purely by way of illustration the first party 103a is referred to herein as Alice and the second party 103b is referred to as Bob, but it will be appreciated that this is not limiting and any reference herein to Alice or Bob may be replaced with “first party” and “second “party” respectively. The computer equipment 102 of each party 103 comprises respective processing apparatus comprising one or more processors, e.g. one or more CPUs, GPUs, other accelerator processors, application specific processors, and/or FPGAs. The computer equipment 102 of each party 103 further comprises memory, i.e. computer-readable storage in the form of a non-transitory computer-readable medium or media. This memory may comprise one or more memory units employing one or more memory media, e.g. a magnetic medium such as hard disk; an electronic medium such as an SSD, flash memory or EEPROM; and/or an optical medium such as an optical disc drive. The memory on the computer equipment 102 of each party 103 stores software comprising a respective instance of at least one client application 105 arranged to run on the processing apparatus. It will be understood that any action attributed herein to a given party 103 may be performed using the software run on the processing apparatus of the respective computer equipment 102. The computer equipment 102 of each party 103 comprises at least one user terminal, e.g. a desktop or laptop computer, a tablet, a smartphone, or a wearable device such as a smartwatch. The computer equipment 102 of a given party 103 may also comprise one or more other networked resources, such as cloud computing resources accessed via the user terminal. The client application 105 may be initially provided to the computer equipment 102 of any given party 103 on suitable computer-readable storage medium or media, e.g. downloaded from a server, or provided on a removable storage device such as a removable SSD, flash memory key, removable EEPROM, removable magnetic disk drive, magnetic floppy disk or tape, optical disk such as a CD or DVD ROM, or a removable optical drive, etc. The client application 105 comprises at least a “wallet” function. This has two main functionalities. One of these is to enable the respective party 103 to create, authorise (for example sign) and send transactions 152 to one or more bitcoin nodes 104 to then be propagated throughout the network of blockchain nodes 104 and thereby included in the blockchain 150. The other is to report back to the respective party the amount of the digital asset that he or she currently owns. In an output-based system, this second functionality comprises collating the amounts defined in the outputs of the various 152 transactions scattered throughout the blockchain 150 that belong to the party in question. Note: whilst the various client functionality may be described as being integrated into a given client application 105, this is not necessarily limiting and instead any client functionality described herein may instead be implemented in a suite of two or more distinct applications, e.g. interfacing via an API, or one being a plug-in to the other. More generally the client functionality could be implemented at the application layer or a lower layer such as the operating system, or any combination of these. The following will be described in terms of a client application 105 but it will be appreciated that this is not limiting. The instance of the client application or software 105 on each computer equipment 102 is operatively coupled to at least one of the blockchain nodes 104 of the network 106. This enables the wallet function of the client 105 to send transactions 152 to the network 106. The client 105 is also able to contact blockchain nodes 104 in order to query the blockchain 150 for any transactions of which the respective party 103 is the recipient (or indeed inspect other parties’ transactions in the blockchain 150, since in embodiments the blockchain 150 is a public facility which provides trust in transactions in part through its public visibility). The wallet function on each computer equipment 102 is configured to formulate and send transactions 152 according to a transaction protocol. As set out above, each blockchain node 104 runs software configured to validate transactions 152 according to the blockchain node protocol, and to forward transactions 152 in order to propagate them throughout the blockchain network 106. The transaction protocol and the node protocol correspond to one another, and a given transaction protocol goes with a given node protocol, together implementing a given transaction model. The same transaction protocol is used for all transactions 152 in the blockchain 150. The same node protocol is used by all the nodes 104 in the network 106. An alternative type of transaction protocol operated by some blockchain networks may be referred to as an “account-based” protocol, as part of an account-based transaction model. In the account-based case, each transaction does not define the amount to be transferred by referring back to the UTXO of a preceding transaction in a sequence of past transactions, but rather by reference to an absolute account balance. The current state of all accounts is stored, by the nodes of that network, separate to the blockchain and is updated constantly. In such a system, transactions are ordered using a running transaction tally of the account (also called the “position” or “nonce”). This value is signed by the sender as part of their cryptographic signature and is hashed as part of the transaction reference calculation. In addition, an optional data field may also be signed the transaction. This data field may point back to a previous transaction, for example if the previous transaction ID is included in the data field. Some account-based transaction models share several similarities with the output-based transaction model described herein. For example, as mentioned above, the data field of an account-based transaction may point back to a previous transaction, which is equivalent to the input of an output-based transaction which references an outpoint a previous transaction. Thus both models enable linking between transactions. As another example, an account-based transaction contains a “recipient” field (in which a receiving address of an account is specified) and a “value” field (in which an amount of digital asset may be specified). Together the recipient and value fields are equivalent to the output of an output- based transaction which may be used to assign an amount of digital asset to a blockchain address. Similarly, an account-based transaction has a “signature” field which includes a signature for the transaction. The signature is generated using the sender's private key and confirms the sender has authorized this transaction. This is equivalent to an input / unlocking script of an output-based transaction which, typically, includes a signature for the transaction. When both types of transaction are submitted to their respective blockchain networks, the signatures are checked to determine whether the transaction is valid and can be recorded on the blockchain. On an account-based blockchain, a “smart contact” refers to a transaction that contains a script configured to perform one or more actions (e.g. send or “release” a digital asset to a recipient address) in response to one or more inputs (provided by a transaction) meeting one or more conditions defined by the smart contact’s script. The smart contract exists as a transaction on the blockchain, and can be called (or triggered) by subsequent transactions. Thus, in some examples, a smart contract may be considered equivalent to a locking script of an output-based transaction, which can be triggered by a subsequent transaction, and checks whether one or more conditions defined by the locking script are met by the input of the subsequent transaction. 3. UTXO-BASED MODEL Figure 2 illustrates an example transaction protocol. This is an example of a UTXO-based protocol. A transaction 152 (abbreviated “Tx”) is the fundamental data structure of the blockchain 150 (each block 151 comprising one or more transactions 152). The following will be described by reference to an output-based or “UTXO” based protocol. However, this is not limiting to all possible embodiments. Note that while the example UTXO-based protocol is described with reference to bitcoin, it may equally be implemented on other example blockchain networks. In a UTXO-based model, each transaction (“Tx”) 152 comprises a data structure comprising one or more inputs 202, and one or more outputs 203. Each output 203 may comprise an unspent transaction output (UTXO), which can be used as the source for the input 202 of another new transaction (if the UTXO has not already been redeemed). The UTXO includes a value specifying an amount of a digital asset. This represents a set number of tokens on the distributed ledger. The UTXO may also contain the transaction ID of the transaction from which it came, amongst other information. The transaction data structure may also comprise a header 201, which may comprise an indicator of the size of the input field(s) 202 and output field(s) 203. The header 201 may also include an ID of the transaction. In embodiments the transaction ID is the hash of the transaction data (excluding the transaction ID itself) and stored in the header 201 of the raw transaction 152 submitted to the nodes 104. Say Alice 103a wishes to create a transaction 152j transferring an amount of the digital asset in question to Bob 103b. In Figure 2 Alice’s new transaction 152j is labelled “Tx1”. It takes an amount of the digital asset that is locked to Alice in the output 203 of a preceding transaction 152i in the sequence, and transfers at least some of this to Bob. The preceding transaction 152i is labelled “Tx0” in Figure 2. Tx0 and Tx1 are just arbitrary labels. They do not necessarily mean that Tx0 is the first transaction in the blockchain 151, nor that Tx1 is the immediate next transaction in the pool 154. Tx1 could point back to any preceding (i.e. antecedent) transaction that still has an unspent output 203 locked to Alice. The terms “preceding” and “subsequent” as used herein in the context of the sequence of transactions refer to the order of the transactions in the sequence as defined by the transaction pointers specified in the transactions (which transaction points back to which other transaction, and so forth). They could equally be replaced with “predecessor” and “successor”, or “antecedent” and “descendant”, “parent” and “child”, or such like. It does not necessarily imply an order in which they are created, sent to the network 106, or arrive at any given blockchain node 104. Nevertheless, a subsequent transaction (the descendent transaction or “child”) which points to a preceding transaction (the antecedent transaction or “parent”) will not be validated until and unless the parent transaction is validated. A child that arrives at a blockchain node 104 before its parent is considered an orphan. It may be discarded or buffered for a certain time to wait for the parent, depending on the node protocol and/or node behaviour. One of the one or more outputs 203 of the preceding transaction Tx0 comprises a particular UTXO, labelled here UTXO0. Each UTXO comprises a value specifying an amount of the digital asset represented by the UTXO, and a locking script which defines a condition which must be met by an unlocking script in the input 202 of a subsequent transaction in order for the subsequent transaction to be validated, and therefore for the UTXO to be successfully redeemed. The locking script (aka scriptPubKey) is a piece of code written in the domain specific language recognized by the node protocol. A particular example of such a language is called “Script” (capital S) which is used by the blockchain network. The locking script specifies what information is required to spend a transaction output 203, for example the requirement of Alice’s signature. Locking scripts appear in the outputs of transactions. The unlocking script (aka scriptSig) is a piece of code written the domain specific language that provides the information required to satisfy the locking script criteria. For example, it may contain Bob’s signature. Unlocking scripts appear in the input 202 of transactions. So in the example illustrated, UTXO0 in the output 203 of Tx0 comprises a locking script [Checksig PA] which requires a signature Sig PA of Alice in order for UTXO0 to be redeemed (strictly, in order for a subsequent transaction attempting to redeem UTXO0 to be valid). [Checksig PA] contains a representation (i.e. a hash) of the public key PA from a public- private key pair of Alice. The input 202 of Tx1 comprises a pointer pointing back to Tx1 (e.g. by means of its transaction ID, TxID0, which in embodiments is the hash of the whole transaction Tx0). The input 202 of Tx1 comprises an index identifying UTXO0 within Tx0, to identify it amongst any other possible outputs of Tx0. The input 202 of Tx1 further comprises an unlocking script <Sig PA> which comprises a cryptographic signature of Alice, created by Alice applying her private key from the key pair to a predefined portion of data (sometimes called the “message” in cryptography). The data (or “message”) that needs to be signed by Alice to provide a valid signature may be defined by the locking script, or by the node protocol, or by a combination of these. When the new transaction Tx1 arrives at a blockchain node 104, the node applies the node protocol. This comprises running the locking script and unlocking script together to check whether the unlocking script meets the condition defined in the locking script (where this condition may comprise one or more criteria). Note that the script code is often represented schematically (i.e. not using the exact language). For example, one may use operation codes (opcodes) to represent a particular function. “OP_...” refers to a particular opcode of the Script language. As an example, OP_RETURN is an opcode of the Script language 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, and thereby record the data immutably in the blockchain 150. E.g. the data could comprise a document which it is desired to store in the blockchain. Typically an input of a transaction contains a digital signature corresponding to a public key PA. In embodiments this is based on the ECDSA using the elliptic curve secp256k1. A digital signature signs a particular piece of data. In some embodiments, for a given transaction the signature will sign part of the transaction input, and some or all of the transaction outputs. The particular parts of the outputs it signs depends on the SIGHASH flag. The SIGHASH flag is usually a 4-byte code included at the end of a signature to select which outputs are signed (and thus fixed at the time of signing). The locking script is sometimes called “scriptPubKey” referring to the fact that it typically comprises the public key of the party to whom the respective transaction is locked. The unlocking script is sometimes called “scriptSig” referring to the fact that it typically supplies the corresponding signature. However, more generally it is not essential in all applications of a blockchain 150 that the condition for a UTXO to be redeemed comprises authenticating a signature. More generally the scripting language could be used to define any one or more conditions. Hence the more general terms “locking script” and “unlocking script” may be preferred. 4. CRYPTOGRAPHIC TECHNIQUES An elliptic curve is the set points ^^ ≔ ( ^^, ^^) over a finite field ^^^, which are solution to the equation: ^^ = ^^ + ^^ ^^ + ^^ mod ^^, along with an extra ‘infinity’ point. An example is the curve secp256k1, with ^^ = 0, ^^ = 7 and ^^ = 2ଶହ^ − 2ଷଶ − 2 − 2 − 2^ − 2^ − 2 – 1. Elliptic curves form a group under the tangent and chord rule. Herein, the group operation is denoted with the symbol
Figure imgf000033_0001
The point at infinity is denoted with 0. Scalar multiplication of an elliptic curve point ^^ by a scalar ^^ is written as ^^ ⋅ ^^, which is defined as: ^^ ⋅ ^^ = ^^ + ^^ + ⋯ + ^^ ( ^^ times). The ECDSA scheme fixes a base point ^^ and works over the subgroup ^^ ≔ { ^^ | ^^ = ^^ ⋅ ^^} of the elliptic curve. This subgroup is generated by ^^, and ^^ will denote its (prime) size. In Bitcoin, the chosen curve is secp256k1, where both ^^ and ^^ are primes of 256 bits. The messages to sign are mapped to modular integers ℎ ∈ ℤ^ via hashing with SHA256. The signing key is also an integer ^^ ∈ ℤ^, and the public key (to verify signatures) is the point ^^ ^^ ≔ ^^ ⋅ ^^ in the elliptic curve (concretely, in the subgroup ^^). The signing and verification algorithm are as follows. Sign( ^^, ^^): Verify( ^^, ^^, ^^ ^^): 1. Sample random ephemeral key ^^ ∈ ℤ^ 1. Compute ^^ ^ ^^ ^ ≔ ^ = ^ ^^ ^^ ^^ ^^ 2. Compute ^^ ≔ ^^ ⋅ ^^ = ( ^^ , ^^ ା^^ ோ ோ) 3. Set ^^ ≔ ^^ ^^ ^^ ^^ ^^ 2. Compute ^^^ ^ = ^^ ^ା^^ ^^ ^^ ^^ ^^ 4. Compute ^^ ≔ ^ା^^ 3. Compute ^^ ≔ ^^^ ⋅ ^^ + ^^ ⋅ ^^ ^^ = ( ^^ , ^^ ) ^ ^^ ^^ ^^ ^^ 4. If ^^ = ^^ᇲ ^^ ^^ ^^ ^^ accept. Else reject. 5. Output ^^ ≔ ( ^^, ^^) ^^^ Note that ^^^ + ^^ ^^ = ^^ ^ା^^ + ^ା^^ = ^^, and since ^^ ^^ = ^^ ⋅ ^^, the verification (step 3) of a correctly generated signature ^^ computes the same point ^^ = ^^ than in signing (step 2). The security of the ECDSA scheme is based on the hardness of computing discrete logarithms (DLP). In this disclosure, the verification calculates two scalar multiplications. Namely ^^^ ⋅ ^^ and ^^ ⋅ ^^ ^^. Herein, the ^^ ^^ ^^ ^^ notation is omitted and it is assumed that all arithmetic operations over integers are always done modulo ^^. The opcode OP_CHECKSIG implements the verification of an ECDSA signature. It receives two inputs from the stack: the signature ^^ in DER format, and the public key ^^ ^^. Besides these two inputs, the implementation of OP_CHECKSIG also needs additional inputs drawn from context, which are used to derive the message ^^ for which the signature ^^ is verified. One additional input is the spending transaction. This is illustrated in Figure 4. PUSHTX is a technique known in the art to inject the sighash fields of the spending transaction to the Stack. Its main application is to allow nodes 104 to enforce logic on the injected fields. The idea is to push a copy of the transaction and sign it in script; its signature is then verified with OP_CHECKSIG, which recall uses the real spending transaction as the message to verify. This ensures consistency of the spending transaction and Stack data. The number of opcodes involved in message signing can be greatly diminished using dummy keying material. The bulk of the script is devoted to generation of the signature in the DER format OP_CHECKSIG expects. [PUSHTX] ≔ [sign] [toDER] < ^^ ^^> OP_CHEKSIGVERIFY. The script below details the steps performed by PUSHTX when the ephemeral key and the signing key of the ECDSA signature are set to ^^ ≔ 1, ^^ ^^ ≔ Input: serialised transaction message ^^ Steps: The locking script does the following 1. double SHA256 on ^^ to obtain the sighash message ℎ, 2. reverse endianness of ℎ, 3. add 0x00 to ensure ℎ is not interpreted as a negative number, 4. callOP_BIN2NUM to have minimal encoding on ℎ (would take care the case when step 3 introduces redundancy), 5. compute ^^ = ℎ + ^^ ^^ ^^ ^^ ^^, 6. convert ^^ to ^^ − ^^ if ^^ > ^^/2, 7. obtain length of ^^, 8. reverse endianness of ^^ (32 bytes), 9. reverse one more byte if the length of ^^ is greater than 32, 10. compute the total length of a DER signature (0x24 + ^^ ^^ ^^ ^^ ^^ℎ ^^ ^^ ^^), 11. add DER prefix0x30, 12. concatenate ^^ = ^^, 13. concatenate ^^, 14. concatenate sighash flag “ALL”, 15. push compressed public key ^^ and callOP_CHECKSIG. 5. FURTHER REMARKS Other variants or use cases of the disclosed techniques may become apparent to the person skilled in the art once given the disclosure herein. The scope of the disclosure is not limited by the described embodiments but only by the accompanying claims. For instance, some embodiments above have been described in terms of a bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104. However it will be appreciated that the bitcoin blockchain is one particular example of a blockchain 150 and the above description may apply generally to any blockchain. That is, the present invention is in by no way limited to the bitcoin blockchain. More generally, any reference above to bitcoin network 106, bitcoin blockchain 150 and bitcoin nodes 104 may be replaced with reference to a blockchain network 106, blockchain 150 and blockchain node 104 respectively. The blockchain, blockchain network and/or blockchain nodes may share some or all of the described properties of the bitcoin blockchain 150, bitcoin network 106 and bitcoin nodes 104 as described above. In preferred embodiments of the invention, the blockchain network 106 is the bitcoin network and bitcoin nodes 104 perform at least all of the described functions of 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 only perform one or some but not all of these functions. That is, a network entity may perform the function of propagating and/or storing blocks without creating and publishing blocks (recall that these entities are not considered nodes of the preferred bitcoin network 106). In other embodiments of the invention, the blockchain network 106 may not be the bitcoin network. In these embodiments, it is not excluded that a node may perform at least one or some but not all of the functions of creating, publishing, propagating and storing blocks 151 of the blockchain 150. For instance, on those other blockchain networks a “node” may be used to refer to a network entity that is configured to create and publish blocks 151 but not store and/or propagate those blocks 151 to other nodes. Even more generally, any reference to the term “bitcoin node” 104 above may be replaced with the term “network entity” or “network element”, wherein such an entity/element is configured to perform some or all of the roles of creating, publishing, propagating and storing blocks. The functions of such a network entity/element may be implemented in hardware in the same way described above with reference to a blockchain node 104. Some embodiments have been described in terms of the blockchain network implementing a proof-of-work consensus mechanism to secure the underlying blockchain. However proof- of-work is just one type of consensus mechanism and in general embodiments may use any type of suitable consensus mechanism such as, for example, proof-of-stake, delegated proof-of-stake, proof-of-capacity, or proof-of-elapsed time. As a particular example, proof- of-stake uses a randomized process to determine which blockchain node 104 is given the opportunity to produce the next block 151. The chosen node is often referred to as a validator. Blockchain nodes can lock up their tokens for a certain time in order to have the chance of becoming a validator. Generally, the node who locks the biggest stake for the longest period of time has the best chance of becoming the next validator. It will be appreciated that the above embodiments have been described by way of example only. More generally there may be provided a method, apparatus or program in accordance with any one or more of the following Statements. Statement 1. A computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications, wherein the method is performed by a first party and comprises obtaining a verification script of a blockchain transaction, wherein the verification script is configured to: take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h); verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point generated based on the first scalar value (b) and the second EC point (Q); verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G); verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G); verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ); verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^); verify a first signature ( ^^, ^^ ) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π); verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h); and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G). Statement 2. The method of statement 1, comprising: submitting a first blockchain transaction to a blockchain network, wherein the first blockchain transaction comprises the verification script. Statement 3. The method of statement 1 or statement 2, wherein said verifying of the third EC point (Δ) comprises: computing a fourth scalar value ( ^^) based on the first scalar value ( ^^) and a fifth scalar value (e); verifying a seventh EC point (Γ) corresponds to a point addition of the third EC point (Δ) and an eighth EC point (E) generated based on the fifth scalar value (e); verifying a second signature generated based on the first scalar value ( ^^) and the message hash (h) is valid for the third EC point (Δ); and verifying a third signature generated based on the fourth scalar value ( ^^) and the message hash (h) is valid for the seventh EC point (Γ). Statement 4. The method of statement 3, wherein said verifying of the second signature comprises generating the second signature. Statement 5. The method of statement 4, wherein said generating of the second signature comprises: setting a first component (r) of the second signature as a value based on an x- coordinate ( ^^) of the base point (G); and generating a second component (s) of second first signature based on the message hash (h), the first scalar value ( ^^) and the x-coordinate ( ^^) of the base point (G). Statement 6. The method of statement 3 or any statement dependent thereon, wherein said verifying of the third signature comprises generating the third signature. Statement 7. The method of statement 6, wherein said generating of the third signature comprises: setting a first component (r) of the third signature as a value based on an x- coordinate ( ^^) of the base point (G); and generating a second component (s) of the third signature based on the message hash (h), the fourth scalar value ( ^^) and the x-coordinate ( ^^) of the base point (G). Statement 8. The method of statement 3 or any statement dependent thereon, wherein the fifth scalar value (e) is set as 1 and the eighth EC point (E) is set as the base point (G). Statement 9. The method of any preceding statement, wherein said verifying of the fifth EC point (Δ) comprises: computing a sixth scalar value ( ^^) based on the third scalar value ( ^^) and the fifth scalar value (e); verifying a ninth EC point (Γ) is a point addition of the fifth EC point (Δ) and the eighth EC point (E) corresponding to the fifth scalar value (e); verifying a fourth signature generated based on the third scalar value ( ^^) and the message hash (h) is valid for the fifth EC point (Δ); and verifying a fifth signature generated based on the sixth scalar value ( ^^) and the message hash (h) is valid for the ninth EC point (Γ). Statement 10. The method of any preceding statement, wherein said verifying of the x- coordinate ( ^^^) of the first EC point (K) comprises: taking as inputs a tenth EC point (Π^), an eleventh EC point (Δ^) a seventh scalar value ( ^^^), and an eighth scalar value ( ^^^); verifying an x-coordinate ( ^^^) of the first EC point (K) corresponds to the first scalar value (b) multiped by the seventh scalar value ( ^^^); verifying a sixth signature ( ^^^, ^^^ ) comprising the x-coordinate of the fourth EC point and the seventh scalar value is valid for the tenth EC point (Π^); verifying the second EC point ( ^^) corresponds to a point addition of the eleventh EC point (Δ^) and the tenth EC point (Π^); and verifying a multiplication of the x-coordinate ( ^^^) of the first EC point (K) and the eighth scalar value ( ^^^) corresponds to the message hash (h). Statement 11. The method of statement 10, wherein the verification script is configured to take as an input a line gradient value ( ^^), and wherein said verifying of the fifth EC point is based on the line gradient value ( ^^). Statement 12. The method of any preceding statement, wherein said obtaining of the verification script comprises generating the verification script. Statement 13. A computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications, wherein a blockchain comprises a first blockchain transaction comprising a verification script, wherein the verification script is configured to take as inputs a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h); verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q); verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G); verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G); verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ); verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^); verify a first signature ( ^^, ^^ ) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π); verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h); and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G), ), and wherein the method is performed by a second party and comprises: submitting a second blockchain transaction to a blockchain network, wherein the second blockchain transaction comprises, as inputs, the first EC point (K), the second EC point, (Q), the third EC point (Δ), the fourth EC point (Π), the fifth EC point (Δ), the sixth EC point (T), the first scalar value (b), the second scalar value ( ^^), and the third scalar value ( ^^), and a message hash (h). Statement 14. A computer-implemented method of processing blockchain transactions, wherein the method is performed by a transaction processor and comprises: obtaining a first blockchain transaction comprising a verification script, wherein the verification script is configured to take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h), verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q), verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G), verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G), verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ), verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^), verify a first signature ( ^^, ^^) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π), verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h), and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G); obtaining a second blockchain transaction comprising the first EC point (K), the second EC point, (Q), the third EC point (Δ), the fourth EC point (Π), the fifth EC point (Δ), the sixth EC point (T), the first scalar value (b), the second scalar value ( ^^), and the third scalar value ( ^^), and a message hash (h); and executing the verification script together with the inputs from the second blockchain transaction. Statement 15. Computer equipment comprising: memory comprising one or more memory units; and processing apparatus comprising one or more processing units, wherein the memory stores code arranged to run on the processing apparatus, the code being configured so as when on the processing apparatus to perform the method of any of statements 1 to 14. Statement 16. A computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of any of statements 1 to 14. According to another aspect disclosed herein, there may be provided a method comprising the actions of some or all of the first party, the second party and the transaction processor. According to another aspect disclosed herein, there may be provided a system comprising the computer equipment of some or all of the first party, the second party and the transaction processor.

Claims

CLAIMS 1. A computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications, wherein the method is performed by a first party and comprises obtaining a verification script of a blockchain transaction, wherein the verification script is configured to: take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h); verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point generated based on the first scalar value (b) and the second EC point (Q); verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G); verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G); verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ); verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^); verify a first signature ( ^^, ^^ ) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π); verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h); and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and a base point (G). 2. The method of claim 1, comprising: submitting a first blockchain transaction to a blockchain network, wherein the first blockchain transaction comprises the verification script. 3. The method of claim 1 or claim 2, wherein said verifying of the third EC point (Δ) comprises: computing a fourth scalar value ( ^^) based on the first scalar value ( ^^) and a fifth scalar value (e); verifying a seventh EC point (Γ) corresponds to a point addition of the third EC point (Δ) and an eighth EC point (E) generated based on the fifth scalar value (e); verifying a second signature generated based on the first scalar value ( ^^) and the message hash (h) is valid for the third EC point (Δ); and verifying a third signature generated based on the fourth scalar value ( ^^) and the message hash (h) is valid for the seventh EC point (Γ). 4. The method of claim 3, wherein said verifying of the second signature comprises generating the second signature. 5. The method of claim 4, wherein said generating of the second signature comprises: setting a first component (r) of the second signature as a value based on an x- coordinate ( ^^) of the base point (G); and generating a second component (s) of second first signature based on the message hash (h), the first scalar value ( ^^) and the x-coordinate ( ^^) of the base point (G). 6. The method of claim 3 or any claim dependent thereon, wherein said verifying of the third signature comprises generating the third signature. 7. The method of claim 6, wherein said generating of the third signature comprises: setting a first component (r) of the third signature as a value based on an x- coordinate ( ^^) of the base point (G); and generating a second component (s) of the third signature based on the message hash (h), the fourth scalar value ( ^^) and the x-coordinate ( ^^) of the base point (G). 8. The method of claim 3 or any claim dependent thereon, wherein the fifth scalar value (e) is set as 1 and the eighth EC point (E) is set as the base point (G). 9. The method of any preceding claim, wherein said verifying of the fifth EC point (Δ) comprises: computing a sixth scalar value ( ^^) based on the third scalar value ( ^^) and the fifth scalar value (e); verifying a ninth EC point (Γ) is a point addition of the fifth EC point (Δ) and the eighth EC point (E) corresponding to the fifth scalar value (e); verifying a fourth signature generated based on the third scalar value ( ^^) and the message hash (h) is valid for the fifth EC point (Δ); and verifying a fifth signature generated based on the sixth scalar value ( ^^) and the message hash (h) is valid for the ninth EC point (Γ). 10. The method of any preceding claim, wherein said verifying of the x-coordinate ( ^^^) of the first EC point (K) comprises: taking as inputs a tenth EC point (Π^), an eleventh EC point (Δ^) a seventh scalar value ( ^^^), and an eighth scalar value ( ^^^); verifying an x-coordinate ( ^^^) of the first EC point (K) corresponds to the first scalar value (b) multiped by the seventh scalar value ( ^^^); verifying a sixth signature ( ^^^, ^^^ ) comprising the x-coordinate of the fourth EC point and the seventh scalar value is valid for the tenth EC point (Π^); verifying the second EC point ( ^^) corresponds to a point addition of the eleventh EC point (Δ^) and the tenth EC point (Π^); and verifying a multiplication of the x-coordinate ( ^^^) of the first EC point (K) and the eighth scalar value ( ^^^) corresponds to the message hash (h). 11. The method of claim 10, wherein the verification script is configured to take as an input a line gradient value ( ^^), and wherein said verifying of the fifth EC point is based on the line gradient value ( ^^). 12. The method of any preceding claim, wherein said obtaining of the verification script comprises generating the verification script. 13. A computer-implemented method of using blockchain transactions to verify elliptic curve (EC) multiplications, wherein a blockchain comprises a first blockchain transaction comprising a verification script, wherein the verification script is configured to take as inputs a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h); verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q); verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G); verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G); verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ); verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^); verify a first signature ( ^^, ^^) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π); verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h); and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G), ), and wherein the method is performed by a second party and comprises: submitting a second blockchain transaction to a blockchain network, wherein the second blockchain transaction comprises, as inputs, the first EC point (K), the second EC point, (Q), the third EC point (Δ), the fourth EC point (Π), the fifth EC point (Δ), the sixth EC point (T), the first scalar value (b), the second scalar value ( ^^), and the third scalar value ( ^^), and a message hash (h). 14. A computer-implemented method of processing blockchain transactions, wherein the method is performed by a transaction processor and comprises: obtaining a first blockchain transaction comprising a verification script, wherein the verification script is configured to take, as inputs, a first EC point (K), a second EC point, (Q), a third EC point (Δ), a fourth EC point (Π), a fifth EC point (Δ), a sixth EC point (T), a first scalar value (b), a second scalar value ( ^^), and a third scalar value ( ^^), and a message hash (h), verify an x-coordinate ( ^^^) of the first EC point corresponds to an x-coordinate ( ^^^ொ) of an EC point resulting from a multiplication of the first scalar value (b) and the second EC point (Q), verify the third EC point (Δ) corresponds to a point multiplication of the first scalar value (b) and a base point (G), verify a point addition of the fourth EC point (Π) and the fifth EC point (Δ) corresponds to a point addition of the second EC point (Q) and the base point (G), verify the sixth EC point (T) corresponds to a point addition of the first EC point (K) and the third EC point (Δ), verify an x-coordinate ( ^^) of the sixth EC point (T) corresponds to the first scalar value (b) multiped by the second scalar value ( ^^), verify a first signature ( ^^, ^^ ) comprising the x-coordinate of the sixth EC point and the second scalar value is valid for the fourth EC point (Π), verify a multiplication of the x-coordinate ( ^^) of the sixth EC point (T) and the third scalar value ( ^^) corresponds to the message hash (h), and verify the fifth EC point (Δ) corresponds to a point multiplication of the third scalar value ( ^^) and the base point (G); obtaining a second blockchain transaction comprising the first EC point (K), the second EC point, (Q), the third EC point (Δ), the fourth EC point (Π), the fifth EC point (Δ), the sixth EC point (T), the first scalar value (b), the second scalar value ( ^^), and the third scalar value ( ^^), and a message hash (h); and executing the verification script together with the inputs from the second blockchain transaction. 15. Computer equipment comprising: memory comprising one or more memory units; and processing apparatus comprising one or more processing units, wherein the memory stores code arranged to run on the processing apparatus, the code being configured so as when on the processing apparatus to perform the method of any of claims 1 to 14. 16. A computer program embodied on computer-readable storage and configured so as, when run on one or more processors, to perform the method of any of claims 1 to 14.
PCT/EP2024/052608 2023-02-28 2024-02-02 Verification of scalar multiplication of elliptic curve points in script Ceased WO2024179772A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
GB2302922.6 2023-02-28
GB2302922.6A GB2627758A (en) 2023-02-28 2023-02-28 Verification of scalar multiplication of elliptic curve points in script

Publications (1)

Publication Number Publication Date
WO2024179772A1 true WO2024179772A1 (en) 2024-09-06

Family

ID=85794212

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2024/052608 Ceased WO2024179772A1 (en) 2023-02-28 2024-02-02 Verification of scalar multiplication of elliptic curve points in script

Country Status (2)

Country Link
GB (1) GB2627758A (en)
WO (1) WO2024179772A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020079534A1 (en) * 2018-10-17 2020-04-23 nChain Holdings Limited Computer-implemented system and method including public key combination verification
CN111466100A (en) * 2017-12-13 2020-07-28 区块链控股有限公司 System and method for multi-party generation of blockchain-based smart contracts
WO2023143882A1 (en) * 2022-01-26 2023-08-03 Nchain Licensing Ag Elliptic curve arithmetic in script

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201705749D0 (en) * 2017-04-10 2017-05-24 Nchain Holdings Ltd Computer-implemented system and method
US11411740B2 (en) * 2017-05-22 2022-08-09 Nchain Licensing Ag Duplicating smart contracts with termination condition
WO2019092543A1 (en) * 2017-11-09 2019-05-16 nChain Holdings Limited System for securing verification key from alteration and verifying validity of a proof of correctness

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111466100A (en) * 2017-12-13 2020-07-28 区块链控股有限公司 System and method for multi-party generation of blockchain-based smart contracts
WO2020079534A1 (en) * 2018-10-17 2020-04-23 nChain Holdings Limited Computer-implemented system and method including public key combination verification
WO2023143882A1 (en) * 2022-01-26 2023-08-03 Nchain Licensing Ag Elliptic curve arithmetic in script

Also Published As

Publication number Publication date
GB202302922D0 (en) 2023-04-12
GB2627758A (en) 2024-09-04

Similar Documents

Publication Publication Date Title
CN113875186A (en) proof of knowledge
CN113875190B (en) Hash-based verification method and device
JP7551658B2 (en) Proof of Knowledge
JP2022533752A (en) proof of knowledge
JP2024518079A (en) Multi-party blockchain addressing method
JP2024533084A (en) Signature Verification
WO2023110551A1 (en) Zero knowledge proof based child key authenticity
US20250103298A1 (en) Elliptic curve arithmetic in script
WO2024179770A1 (en) Verification of scalar multiplication of elliptic curve points in script
EP4736361A1 (en) Bilinear pairings
WO2024179768A1 (en) Verification of scalar multiplication of elliptic curve points in script
WO2024041866A1 (en) Blockchain transaction
CN117941317A (en) Generating blockchain transactions
CN119072899A (en) Statement proof and verification
GB2627758A (en) Verification of scalar multiplication of elliptic curve points in script
US20250123808A1 (en) Elliptic curve arithmetic in script
US20250103299A1 (en) Elliptic curve arithmetic in script
WO2025068019A1 (en) Modifiable blockchain transaction
EP4736362A1 (en) Bilinear pairings
GB2632259A (en) Shared secrets using blockchain
EP4736363A1 (en) Bilinear pairings
JP2026507106A (en) Blockchain-based commitment method
WO2025073446A1 (en) Data commitments
GB2636144A (en) Explicit value transactions
CN121532768A (en) Prove that the data belongs to the set

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 24705375

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 24705375

Country of ref document: EP

Kind code of ref document: A1