- Btransaction
- blockchain transaction (a "normal" transaction)
- Ctransaction
- combined transaction (also a valid Btransaction)
- Dtransaction
- debt transaction (NOT a valid Btransaction)
- Ltransaction
- logical transaction (concept of transferring money from A to B)
Ctransactions are Btransactions with version=2
Ctransactions without all their signatures in place can be broadcast on a p2p connection using the new "ctx" message (which is otherwise the same as the "tx" message)
When Ctx-capable client wants to send:
- Take the most recent (at your choice) Ctx seen on the network (and not mined)
- Add your inputs/outputs (possibly rearranging the order of any inputs/outputs)
- Update the locktime to the latest block
- Add your signatures
- Broadcast Ctx via new message (can also broadcast a new Ctx via old message)
When Ctx-capable client sees a new Ctx with your inputs unsigned:
- Verify all the outputs you cares about are still there, and the fee is within an allowable amount
- Sign your inputs (optionally add in signatures from compatible Ctx seen)
- Broadcast Ctx via an old message if it now has all signatures, or a new message if not
In order to handle Ctransactions, miners should allow transaction replacement provided all outputs of the new Btransaction are a superset of the old Btransaction.
Debt transactions require unique user ids, which can be used to express trust. User ids are HD wallet chains, in some base58 encoding. Users should be able to add people they trust and set an amount of total debt they will accept from others before requiring settlement. Every signed message should use a unique child number; this is variable-length, and longer than 4 bytes should be taken as a child chain. Communication can (should?) be encrypted to a key signed by the other party
Each party needs to know:
- Ltx scriptPubKey
- Dtx scriptPubKey
- amount
- who they are trusting
- Dtx scriptSig
To send a transaction:
- Generate a unique Ltransaction keypair
- Identify a trust route from you to destination
- Create a Dtransaction between each set of peers
YOU -> PeerA (trusts you)
PeerA -> PeerB
...
PeerY -> PeerZ
PeerZ -> Destination - Each peer signs the Dtransaction FROM them
During this process, peers may opt to request settlement Btransactions - YOU sign every Dtransaction
- with both signatures, each Dtransaction is now a valid debt; balances should be adjusted immediately as confirmed
To redeem a Dtransaction:
- Debtor contacts creditor:
Settlement Btx scriptPubKey
Fully signed Dtx
Dtx scriptSig - Creditor sends back a transaction to be broadcast
(Optional: Creditor may choose to use a Ctransaction and maintain it on his own end)
Thank you @luke-jr and @oleganza - keep on keepin on