11
11
12
12
Tokens are typically transferred atomically from source to destination in a
13
13
single instruction. However, there are cases where it may be useful to split
14
- a transfer into two separate transfers. If not done properly, this could violate
15
- the non-custodial nature of the original transfer.
14
+ a transfer into two separate transfers. However, if not done properly, this
15
+ could violate the non-custodial nature of the original transfer.
16
16
17
- To address this, the Splitter token program enables users to split token
17
+ To address this, the Splitter program enables users to split token
18
18
transfers into two instructions while preserving the non-custodial nature of the
19
19
transfer. The program allows anyone to create a treasury account that can be
20
20
used to split transfers. The treasury account is owned by a trusted party who
21
21
can approve the transfer.
22
22
23
- The Splitter token program gets its name from the fact that it splits a single
24
- transfer into two parts however, the amount itself does not change.
23
+ The Splitter program gets its name from the fact that it splits a single
24
+ transfer into two parts, one from the program to the destination, and one from
25
+ the source to the program, where the amount itself does not change.
25
26
26
27
### Example Use Case
27
28
@@ -31,25 +32,26 @@ some cases, it may be beneficial to split the transfer into two parts. For
31
32
instance, if Alice and Bob wish to use a common third party for the exchange
32
33
instead of a direct transfer. In such cases, Alice can transfer 100 tokens to
33
34
the third party, and the third party can then transfer 100 tokens to Bob. This
34
- is a two-step process, and the third party acts as a custodian of the funds.
35
+ is a two-step process, and in this case the third party acts as a custodian of
36
+ the funds.
35
37
36
38
To make the process non-custodial, we need to ensure that the third party does
37
- not have any means of stealing the funds. The Splitter token program can help in
38
- this regard. The third party can create a treasury account that can be used to
39
- split the transfer into two parts without being a custodian of the transfer
40
- amount.
39
+ not have any means of stealing the funds. The Splitter program has been created
40
+ to help in this regard. The third party can create a treasury account that can
41
+ be used to split the transfer into two parts without being a custodian of the
42
+ transfer amount.
41
43
42
44
The high-level process is as follows:
43
45
44
46
1 ) The third party creates a Splitter treasury account and deposits at least 100
45
47
tokens into it.
46
48
47
49
2 ) Alice provides the third party with a signed transfer instruction from Alice
48
- to the Splitter treasury for 100 tokens. This transfer is conditional on a
49
- future proof-of-payment provided by the Splitter program, that the third party
50
- treasury has sent Bob the same amount (100 tokens). The third party puts this
51
- signed transaction aside for later, and it is not yet submitted to the
52
- blockchain.
50
+ to the Splitter treasury for 100 tokens. This transfer is computationally
51
+ conditional on a future proof-of-payment provided by the Splitter program, that
52
+ the third party treasury has sent Bob the same amount (100 tokens). The third
53
+ party puts this signed transfer transaction aside for later, and it is not yet
54
+ submitted to the blockchain.
53
55
54
56
Note: This is done indirectly through a token account that doesn't yet exist
55
57
but its address can be calculated ahead of time. The token account can only
@@ -63,17 +65,17 @@ to write a proof-of-payment into a merkle tree.
63
65
Note: Timelock accounts and durable nonces are useful here to ensure that Alice
64
66
cannot move her tokens before the third party is able to get them.
65
67
66
- 4 ) With the condition now being met, the third party then executes the transfer
67
- from Alice to the Splitter treasury account.
68
+ 4 ) With the condition now being met, the third party then submits the signed
69
+ transfer transaction from Alice to the Splitter treasury account.
68
70
69
71
5 ) The third party can now withdraw the 100 tokens from the treasury account.
70
72
71
- The key innovation of the Splitter token program is that both transfers can be
72
- signed at the same time without waiting for confirmation on-chain. If the
73
- condition of the destination being paid first is not met, then the source will
74
- not be debited. It is in the best interest of the third party to pay the
75
- destination before executing the conditional payment, as failure to do so would
76
- result in a loss of funds.
73
+ The key innovation of the Splitter program is that both transfers can be signed
74
+ at the same time without waiting for confirmation on-chain. If the condition of
75
+ the destination being paid first is not met, then the source cannot not be
76
+ debited. It is in the best interest of the third party to pay the destination
77
+ before executing the conditional payment, as failure to do so would result in a
78
+ loss of funds.
77
79
78
80
It is important to note that the third party managing the treasury account has
79
81
no control over the transfer other than to approve it. This design ensures that
0 commit comments