Hello all!
I am interested in creating a distribution "smart contract" based on a binary outcome. Essentially, a user will pay for a service that is to be completed. The people involved with the completion of this service will each be paid individually. Based on the outcome of the service, the user may be entitled to a "refund"... say if the service fails. There is a centralized entity that determines the outcome of the situation. The outcome is either true or false.
People involved:
A -- user
B -- central entity
C -- servicer
D -- servicer
E -- servicer
Current Sequence # = 3.
Here is the proposed setup I have:
TRANSACTION A (Sequence #4)
Weight Required: 2
Operation 1: Pay person B
Operation 2: Pay person C
Operation 3: Pay person D
Operation 4: Pay person E
Signature Person A (weight = 1)
TRANSACTION B (Sequence #4)
Weight Required: 2
Operation 1: Pay person B
Operation 2: Pay person C
Operation 3: Pay person D
Signature Person A (weight = 1)
After the service is complete:
IF SUCCESS: B signs TRANSACTION A
ELSE: B signs TRANSACTION B
My questions are:
- a) Does this make sense?
- b) Say A is paying 10xlm for this service. Can he/she spend these 10xlm even though they are "tied up" in this transaction? Is it possible to double spend?
From what I have read, sequence numbers must be strictly increasing, thus if A creates and publishes a transaction C with sequence #4, both transaction A and transaction B are void.
Thanks in advance!