Skip to content

Commit 2dc5d54

Browse files
author
CodeWallet Engineering
committed
copy updates
1 parent 9e29803 commit 2dc5d54

File tree

2 files changed

+29
-27
lines changed

2 files changed

+29
-27
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Solana Sealevel runtime. These programs include clients to interact with the
44
on-chain programs. The programs are deployed to the Mainnet-Beta cluster. We
55
will graciously accept patches to ensure the programs here are secure and
66
reliable but ask that you submit any security concerns privately by emailing
7-
secury@getcode.com.
7+
security@getcode.com.
88

99
## Audits
1010

@@ -17,7 +17,7 @@ [email protected].
1717

1818
The programs in this repository are built using the
1919
[Anchor](https://www.anchor-lang.com/) framework. Anchor is a framework for
20-
building on-chain programs for the Solana blockchain. It provides a convenient
20+
building on-chain programs for the Solana blockchain. It provides convenient
2121
Rust macros for declaring program instructions and a client library for
2222
interacting with the on-chain programs.
2323

@@ -35,7 +35,7 @@ The clients are available in the following languages:
3535
* A `Go` client derived from the TypeScript client
3636
* The `IDL` for use with Anchor's client library or other clients
3737

38-
The `TypeScript` client is generated from the IDL using solita. You are able to do
38+
The `TypeScript` client is generated from the IDL using [solita](https://github.com/metaplex-foundation/solita). You are able to do
3939
this as well by running `npm run build` in the client directory.
4040

4141
The `Go` client is derived from this by hand. There are tools to automate this
@@ -88,7 +88,7 @@ $ npm run build
8888
#### Testing
8989

9090
We use more extensive tests internally. This repository only contains limited
91-
tests that and can be found in the `tests` directory. You're welcome to run
91+
tests that can be found in the `tests` directory. You're welcome to run
9292
these tests, but they are not exhaustive. We will be adding more tests in the
9393
future. Pull requests are welcome.
9494

splitter-token/README.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@
1111

1212
Tokens are typically transferred atomically from source to destination in a
1313
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.
1616

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
1818
transfers into two instructions while preserving the non-custodial nature of the
1919
transfer. The program allows anyone to create a treasury account that can be
2020
used to split transfers. The treasury account is owned by a trusted party who
2121
can approve the transfer.
2222

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.
2526

2627
### Example Use Case
2728

@@ -31,25 +32,26 @@ some cases, it may be beneficial to split the transfer into two parts. For
3132
instance, if Alice and Bob wish to use a common third party for the exchange
3233
instead of a direct transfer. In such cases, Alice can transfer 100 tokens to
3334
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.
3537

3638
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.
4143

4244
The high-level process is as follows:
4345

4446
1) The third party creates a Splitter treasury account and deposits at least 100
4547
tokens into it.
4648

4749
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.
5355

5456
Note: This is done indirectly through a token account that doesn't yet exist
5557
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.
6365
Note: Timelock accounts and durable nonces are useful here to ensure that Alice
6466
cannot move her tokens before the third party is able to get them.
6567

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.
6870

6971
5) The third party can now withdraw the 100 tokens from the treasury account.
7072

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.
7779

7880
It is important to note that the third party managing the treasury account has
7981
no control over the transfer other than to approve it. This design ensures that

0 commit comments

Comments
 (0)