HTLC for group account ownership trades

Context

IrisHub recently add HTLC feature in v0.16.0(https://github.com/irisnet/irishub/blob/master/docs/features/htlc.md)
Although it is a standard feature in blockchain industry, I want to suggest expanded
version of HTLC to Cosmos-SDK which can also trade the ownership of a group account in a completely decentralized way.

standard HTLC procedure

  1. Bob lock his tokens T1 into a contract C1 in Chain1 which will send the locked tokens to Alice if hash lock created by Bob’s secret is provided by transaction
  2. Bob also create another contract C2 in Chain2. When Bob confirms the contract C2, it will emit Bob’s secret and also send tokens T2 to Bob’s account
  3. Alice send her tokens T2 into the contract C2 in Chain2
  4. Bob confirms that Alice sent good amount of tokens T2 into the contract C2. The secret is emitted and tokens T2 is sent to Bob’s account
  5. Alice create a transaction with emitted secret and broadcast it to Chain1 to get locked tokens T1 in the contract C1

group account ownership trade HTLC procedure

  1. Bob lock his group account G1 by changing the admin key of G1 to a contract C1 in Chain1. The contract C1 will change its admin key to Alice’s key if hash lock created by Bob’s secret is provided by transaction.
  2. Bob also create another contract C2 in Chain2. When Bob confirms the contract C2, it will emit Bob’s secret and also send tokens T2 to Bob’s account
  3. Alice send her tokens T2 into the contract C2 in Chain2
  4. Bob confirms that Alice sent good amount of tokens T2 into the contract C2. The secret is emitted and tokens T2 is sent to Bob’s account
  5. Alice create a transaction with emitted secret and broadcast it to Chain1 to change admin key of Bob’s group account G1 to her key

And of course, trades can be

  • tokens <> tokens
  • tokens <> group account ownership
  • group account ownership <> group account ownership

Also Chain1 can be equal to Chain2 (trade on single chain)

Positive

So, with expanded feature, now Bob can “sell” his group account to Alice against certain amount of tokens in another(or in same) chain. Trading group account itself than trading tokens have much more variety of potential because a group account can possess many assets which is not a token.(a delegation is one of the examples of onchain asset which is not a token)

I imagine such assets include “onchain/offchain membership”, “onchain/offchain rights on certain assets”, “onchain historical record”, and many more. (Working as a “assets/rights containing NFT”)

1 Like

Thank you @bharvest! We can contribute the HTLC module to Cosmos-SDK :grin: