Is this challenging use case possible on Algorand?

Sorry for the ambiguous question, I’ll try to make it as simple as possible:

Use Case:
Party A wants to buy something from Party B, who isn’t registered on the platform yet. Party A starts by making a temporary request (lasting 7 days) on the platform to Party B by having a smart contract lock her funds for 7 days (let’s call those 7 days ‘Lock-up period 1’).

Within ‘lock-up period 1’, Party B can verify his identity on the platform to then either accept or reject the request made by Party A. If Party B accepts the request, then ‘lock-up period 1’ transmits immediately into a new lock-up period of 5 days (let’s call those 5 days ‘lock-up period 2’). During ‘lock-up period 2’ Party B will fulfill the request. If necessary, Party B can ask Party A for a time extension of ‘lock-up period 2’.

Once Party B has fulfilled the request the lock-up transmits into ‘lock-up period 3’ which lasts 10 days. ‘lock-up period 3’ is in place to give Party A enough time to review the submission from Party B and to potentially open a dispute before the funds are released to Party B. If Party A opens a dispute, then the locked-up funds transmit into ‘lock-up period 4’ which lasts 10 days. Both parties should try to reach a consensus during this time. If no consensus was reached, then the funds will transmit into ‘lock-up period 5’, which has no predefined time limit. The platform/admin will then make a decision on how to proceed.

Summary

Question1 : These would probably be a lot of smart contracts put together. Which parts of this use case could be automated and which parts would the admin have to manually approve something?

Question2 : Is it possible to charge each party a penalty fee in the event of ‘lock-up period 5’ coming into effect?

Question3 : Can a smart contract exist without both parties’ wallet addresses already being provided? I ask because Party A’s funds will be locked-up in a smart contract before Party B has entered into an agreement. Is it then possible for Party B to specify the destination wallet address by the time he accepts the request?

@lior_yrc You just need atomic swaps for the most part: See Atomic transfers - Algorand Developer Portal]

1 Like

Thanks for your message @Celestino_127 l’ll have to read a bit more about Atomic transfers to fully understand it but do you think my use case is attainable on a first assessment?

I’m not completely sure atomic transfers would help you too much as the parties do not transfer funds at the same time. But they can be part of the solution at some point.
I highly recommend to go over the documentation, in particular What is a dApp? - Algorand Developer Portal

Question 1: You most likely can use a single smart contract that coordinates everything. Smart contracts can now keep funds in escrow and remember using local storage what lock-up period it is, and the amounts of the funds. Note that one issue with local storage is that the account holding local storage can always erase it. One solution is to create a fresh new account with 1 Algo for the deal. This account would be controlled by a smart signature or be rekeyed to the zero address so it cannot erase its local storage.

Question 2: The smart contract would have full control over the escrowed funds, so it can apply penalties very easily.

Question 3: There are two parts:

  • Yes a smart contract is just an application / a piece of software on the blockchain. As such it can exist independently of A and B.
  • On the other hand, since B needs to perform actions, like approving or rejecting A, B needs to have an address to do that. The only way you can call a smart contract and therefore indicate approval/rejection is by having your own address. (You could also have a trusted party do it, but you lose many advantages of blockchain if you do that.)
1 Like

Hi @fabrice thank you for your response!

I will definitely read through the dApp documentation to get further knowledge about the possibilities.

what do you mean by it? the smart contract or the wallet itself? Would it not also erase its own funds?

If I create the new account - does that not interfere with money transmitter regulations? because I am not allowed to hold any client funds at any time.

Could party B then enter his address to the existing smart contract to then perform an action on the smart contract?

Do you mean by this statement that me as the platform/admin would manually add party B’s wallet address?

Last question regarding :

[quote=“fabrice, post:4, topic:4939”]
One solution is to create a fresh new account with 1 Algo
[/quote] Is it possible to use this solution to also mask party B’s wallet? I am asking because it would be unfortunate for the Party Bs to have their addresses exposed on the internet associated to their identity.

Thank you a lot for your help!

it is the data stored in local storage (e.g., lockup period, amount locked, party B address, …)
It depends how the smart contract works. I guess that in most cases it may, and the above may not be an issue.

I don’t know what regulations require and you would need to consult with a lawyer. Note that the amounts needed to transact are very small (less than one Algo). I don’t know if regulations still apply in this case.

It depends on how the smart contract works.

Yes

If you want to hide identities, you can indeed create fresh new accounts for all the parties.
Note however that all transactions on the blockchain are public. Even if accounts are not directly associated to identities, they are not anonymous and there may be ways to de-anonymize accounts.

Thanks a lot for your help @fabrice ! I will have to do some more research to understand the rekeying process.

Would it be possible for me to get strategic help from Algorand‘s development team on how to set up the smart contract to best fit my application? Furthermore, can my smart contract developers get in touch with you guys for technical support on this matter?

My web app is basically finished. All I need at this point is to figure out how I can run it on Algorand with the smart contracts.

BR,

For any public questions that may be of use to everybody, Discord and forum are by far the best place.

If you have questions that are not to be seen by the public, you can DM me and we can see how to move forward from there.

1 Like

How can I DM you on here?