Although reversible transactions in blockchain applications would be desirable, such reversible transactions should not compromise the integrity of data to be stored on a blockchain. To this end, the disclosed embodiments provide techniques which allow for reversing transactions that will be recorded on a blockchain. Moreover, the disclosed embodiments do not require tampering with the blockchain and, therefore, do not interfere with the inherently secure nature of blockchain transactions. Furthermore, the disclosed embodiments do not require additional transactions to “reverse” the original transaction, returning the transferred assets. The various disclosed embodiments include techniques for creating reversible blockchain transactions. In an embodiment, a request to initiate a transaction is received from a first party to a transaction, via a first user device of the first party. The transaction includes a transfer of a digital asset such as, but not limited to, funds, keys or other data granting permission to use or control one or more systems, one or more data objects, one or more other digital items which represent ownership of real-world objects, and the like. The request includes data for the transaction signed by the first user device. Transaction data is created based on the signed data, and a hidden address is designated for the transaction. The hidden address is an address on the blockchain which is internal to the first device but hidden to an application which participates in transactions to be recorded on blockchain, i.e., an address which is not known to that application and therefore cannot be accessed by that application.
- In an embodiment, the address is a hidden address with an address including one or more nonstandard parameters such that a blockchain-utilizing application installed on the transferring user device does not recognize the hidden address.
- In a further embodiment, the address includes a change parameter. The change parameter is a value indicating the relative visibility of the digital asset to the first user device. Some existing solutions utilize a value in the address indicating whether the address is visible or not to a program that utilizes a blockchain to record transactions. Such a program may be, for example, a cryptocurrency wallet. Thus, the address including this hidden change value is a hidden address that points to a location which is inaccessible to the blockchain-utilizing program but can be accessed by the first user device upon reversal of the transaction.
- By utilizing an address which is not known to the relevant application installed on the first user device, that application will not recognize possession of the transferred asset. Consequently, the first party cannot use or otherwise access the asset. However, the transferred asset may still be accessed upon request for reversal of the first party using the hidden address. Thus, if a transaction is reversed, use or ownership of the transferred assets may be returned to the first party without requiring altering the blockchain on which the transfer was recorded. As a result, the transaction can be reversed without disrupting the integrity of the data stored on the blockchain or requiring additional transactions to return the transferred assets.
- In an embodiment, a key used for decrypting the encrypted signed transaction data is received from a second user device operated by a second party. The key is sent by the first user device to the second user device. The received key is used to decode the signed data received from the first user device. When the signed data has been decoded, it is re-encrypted and uploaded to a blockchain.
- By using a key sent from the first user device to the second user device, the transaction is secured. More specifically, even if the signed transaction data is sent to the wrong system, the receiving system will not be able to decrypt the signed transaction data and, therefore, will not be able to send the decrypted data for recording on the blockchain.
- The disclosed embodiments allow for reversing transactions without introducing potential issues related to the double spending problem, i.e., a problem which occurs when a digital asset is “transferred” twice. More specifically, the blockchain-utilizing program does not “see” the digital asset stored at the hidden address. For example, when the program is a wallet program, the wallet program will recognize that a certain sum of cryptocurrency has been transferred and will therefore reduce the amount of cryptocurrency available to the user of the wallet program. However, because the transaction data is still stored on the same user device, the cryptocurrency can be refunded without risking spending that sum twice. According to various disclosed embodiments, transactions may be reversed until the transaction data is successfully uploaded to the blockchain.
- Additionally, the disclosed embodiments do not require use of a particular application installed on the user device. In other words, the disclosed embodiments do not require installing a reversible transaction agent on the user devices. More specifically, by utilizing a nonstandard address as described herein, the reversibility of the transaction may be achieved without reconfiguring the user device. This provides additional convenience and security. More specifically, applications installed on the transferring user device are not required to attempt to tamper with the blockchain or to modify the data on the transferring user device, thereby ensuring the integrity of the data.