8
4
Use Case
My use case is around a scenario where both customer and merchant possess offline wallets with a balance that has had confirmation on the blockchain.
- To begin with, let us say that, the merchant and the buyer's wallets show balances of 20 BTC and 10 BTC respectively. These balances are the one that are confirmed on the block-chain.
- Then, let there be multiple transactions between the merchant and buyer such that the balance is always updated locally in the wallets only.
- All of the transactions, in 2 above, happen in an offline mode; i.e. no access to network. The period of no access can run into days.
- Sometime, in the future, when either/both of the wallets are online, all the offline transactions are published to blockchain and are confirmed.
Blockchain Sync
There are two things that can happen at this point.
First, the wallets are so secure that, all updates (credits and debits) happen locally without ever having to 'sync' up with the blockchain. The only time the wallets may sync with blockchain is to post the transactions and their sequence; and, also to update their wallet with the credits that happened since the last time the wallet went online. Or, regulatory pressure requires posting transaction data every set frequency.
Second, all credit updates are made to the wallets via the blockchain. This requirement is enough motivation to seek network connectivity; even if it is once in a week or fewer.
Question
In either case, we are looking at a scenario, where a value, confirmed by blockchain, is used in transactions offline to be confirmed online later. How do we implement this?
Analogy
Bus conductors may issue tickets with an offline machine to passengers who board the bus at various points throughout the journey. When the bus reaches its destination, the machine is used at the depot to arrive at a list of tickets sold and the amount collected thereof. Thus, this is an example of an offline transaction where transactions are 'settled' when 'connectivity' is eventually available.
Spawned off of: https://bitcoin.stackexchange.com/a/41356/6975
This sounds a lot like the way the lighning network is implemented. https://lightning.network/
– Ian Purton – 2017-01-11T15:19:58.967Can you please elaborate? I did read their pdf here - https://lightning.network/lightning-network-summary.pdf My key point is, two wallets, who have balances that can be corroborated by the ledger, can execute transactions without having to connect to network again. Once connected, they retroactively get/post their transactions to the ledger and update their wallets as well. I think, Lightning Network is sort of a escrow.
– cogitoergosum – 2017-01-11T18:32:30.643So, what is needed is a method of exporting/importing signed transactions into the mempool directly, bypassing the broadcast mechanisms. A fine idea. You should consider discussing this on [bitcoin-dev] or else post it under the feature heading on GitHub.
– Willtech – 2018-04-29T09:44:44.400Further, even if one part decides to never go online or to abandon the transactions before they are broadcast, the other party's node must be capable of retaining and broadcasting the transaction(s) without having previously dropped them. – Willtech – 2018-04-29T09:53:12.087
@willtech exactly my point (About a party never going online.)! How do you mean
mempooland bypass broadcast? – cogitoergosum – 2018-04-29T12:37:12.0201I can create a transaction even while offline with Bitcoin Core. That transaction is in the mempool. Ordinarily, when a node is online it broadcasts transactions to other nodes, they are received into those nodes mempool also. All that is required is a transaction export which will provide plain text of the signed transaction on the one end and, an import feature for the other end. Each party can exchange transactions offline and when either party goes online all transactions need to be broadcast. – Willtech – 2018-04-30T03:10:20.793
This means that imported transactions will have to received into the mempool with special rules so that they are never dropped. Ordinarily, a transaction is dropped from the mempool after a time period but, it is usually expected that the transaction would be confirmed prior to this. – Willtech – 2018-04-30T03:11:00.123