Computer-implemented system and method
In a first aspect, the present disclosure proposes methods, devices and systems for implementing a payment service for enabling transactions associated with a client to be written into, or stored in a distributed ledger, i.e. a blockchain. The payment service is implemented as an API to which one or more clients have access to processing digital asset payments pertaining to a respective client. In a first aspect includes obtaining mining fee quotes from a plurality of miners for a client and processing a request for submitting a transaction to the blockchain based on a selected fee quote. In a second aspect, the present disclosure proposes methods, devices and systems for requesting a transaction associated with a digital asset payment to be mined in a blockchain, based on a digital asset payment between a client (payer) and a customer (payee) of the client. The request being associated by a selected fee quote and/or service level associated with the selected fee quote among the received fee quotes in the above aspect. In a third aspect the method includes creating, processing and mining a blockchain transaction associated with a client by a miner, based on the miner satisfying the selected fee quote from the client, as mentioned in the above aspect.
1 . A computer implemented method of providing a payment service for one or more clients for transactions associated with a blockchain, the method comprising the steps of:
receiving, by a payment processor, a first request from a client associated with mining a transaction in the blockchain, wherein optionally the transaction associated with the first request includes a batch of multiple transactions;
sending, by the payment processor, a request for a fee quote to each miner among a plurality of miners communicatively coupled to the payment processor;
obtaining, by the payment processor, a fee quote from each miner for mining the transaction;
providing, by the payment processor, the obtained fee quotes from the plurality of miners to the client, wherein a selected fee quote for mining the transaction is determined based on the obtained fee quotes or determining a selected fee quote for mining the transaction for the client based on the obtained fee quotes;
validating, by the payment processor, a respective fee quote obtained from a given miner among the plurality of miners based on a miner signature, said miner signature serving as a commitment from the given miner to mine the transaction for the respective fee quote, and to reject any conflicting transaction(s); and
verifying, by the payment processor, an identity of the given miner among the plurality of miners, wherein the verification is based on an identifier pertaining to the given miner, said identifier being associated with a reputation indicator for the given miner;
the method further comprising the steps of:
including, by the given miner, the transaction in a block for mining:
receiving, by the given miner, one or more conflicting transactions:
excluding, by the given miner, the one or more conflicting transactions from the block for mining; and
mining, by the given miner, the block.
2 . The method of claim 1 , further comprising the steps of:
responsive to a second request from the client to submit a given transaction pertaining to the selected fee quote among the obtained fee quotes, sending a request to one or more miners among the plurality of miners for generating a blockchain transaction corresponding to the given transaction, wherein optionally the given transaction includes a batch of multiple transactions;
receiving an output script associated with the corresponding blockchain transaction from at least one miner among the plurality of miners that satisfies the selected fee quote; and
sending a result to the client, the result including a transaction identifier for the blockchain transaction corresponding to the given transaction.
3 . The method as claimed in claim 1 , wherein the step of providing the obtained fee quotes further comprises determining a recommended fee quote based on an average value of the obtained fee quotes or a maximum value among the obtained fee quotes, wherein optionally the method further comprises:
providing the recommended fee quote or providing all the obtained fee quotes including the recommended fee quote, wherein the recommended fee quote includes an identifier and/or optionally wherein the selected fee quote is the same as the recommended fee quote or different from the recommended fee quote, wherein the different fee quote is either predetermined or arbitrarily selected.
4 . The method of claim 3 , wherein the step of determining a selected fee quote comprises assigning a service level among a plurality of service levels to each of the obtained fee quotes, each service level being associated with a respective selected fee quote for mining the transaction; and optionally:
wherein the service level is assigned based on the obtained fee quote and a minimum relay fee associated with the miner pertaining to the respective fee quote, and/or
wherein the assigned service level is indicative of a priority for mining the transaction and/or a level of protection against double spends associated with a transaction for the recommended fee quote; and/or
wherein the service level for the transaction to be mined is assigned based on one or more service requirements obtained from the client.
5 . The method of claim 2 , wherein:
the fee quote obtained from each miner is provided in a datatype, said datatype being in a JavaScript Object Notation (JSON) object format; and/or
the received output script is an Unspent Transaction Output (UTXO) associated with a mempool for at least one miner, the UTXO including a transaction identifier (TxID) for the blockchain transaction.
6 . The method of claim 1 , further comprising the steps of:
responsive to a status query associated with a transaction identifier from the client, sending a request to the plurality of miners for obtaining a blockchain transaction corresponding to the transaction identifier;
obtaining the corresponding blockchain transaction from at least one miner among the plurality of miners; and
sending a status result pertaining to the obtained corresponding blockchain transaction to the client.
7 . The method of claim 1 , wherein the payment processor is implemented as a Representational State Transfer (REST) endpoint for the one or more clients, and wherein the method further comprises the step of providing an application programming interface (API) converter associated with the payment processor for performing the steps of:
receiving the first request and/or a second request and/or a status query pertaining to the transaction from the client using a Hypertext Transfer Protocol Secure (HTTPS) transmission protocol format;
converting the respective request to a Remote procedure Call (RPC) format, and sending the RPC to one or more of the plurality of miners;
receiving responses associated with a corresponding blockchain transaction from one or more miners among the plurality of miners in an RPC format; and
converting the respective responses such that they may be sent to the client using the HTTPS transmission protocol.
8 . A system comprising a computing device and a given miner among a plurality of miners, the computing device comprising a processor and memory, the memory including executable instructions that, as a result of execution by the processor, cause the computing device to perform a computer implemented method of providing a payment service for one or more clients for transactions associated with a blockchain, the method implemented by a payment processor and comprising the steps of:
receiving a first request from a client associated with mining a transaction in a blockchain;
wherein optionally the transaction associated with the first request includes a batch of multiple transactions;
sending a request for a fee quote to each miner among the plurality of miners communicatively coupled to the payment processor;
obtaining a fee quote from each miner for mining the transaction;
providing the obtained fee quotes from the plurality of miners to the client, wherein a selected fee quote for mining the transaction is determined based on the obtained fee quotes or determining the selected fee quote for mining the transaction for the client based on the obtained fee quotes;
validating a respective fee quote obtained from the given miner among the plurality of miners based on a miner signature, said miner signature serving as a commitment from the given miner to mine the transaction for the respective fee quote, and to reject any conflicting transaction(s); and
verifying an identity of the given miner among the plurality of miners, wherein the verification is based on an identifier pertaining to the given miner, said identifier being associated with a reputation indicator for the given miner;
the given miner of the plurality of miners comprising a processor and memory, the memory including executable instructions that, as a result of execution by the processor, cause the given miner to perform the following steps: including the transaction in a block for mining;
receiving one or more conflicting transactions;
excluding the one or more conflicting transactions from the block for mining; and
mining the block.