Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 35 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# State Transition SDK

An SDK for managing assets on the Unicity Protocol, supporting off-chain state with on-chain security guarantees.

## Overview

The State Transition SDK is a TypeScript library that provides an off-chain token transaction framework. Tokens are managed, stored, and transferred off-chain with only cryptographic commitments published on-chain, ensuring privacy while preventing double-spending through single-spend proofs.

This is a low-level SDK, that supports transferring tokens, making payments, and splitting tokens.
In this system, tokens are self-contained entities containing complete transaction history and cryptographic proofs attesting to their current state (ownership, value, etc.). State transitions are verified through consultation with blockchain infrastructure (Unicity) to produce proof of single spend.

### Key Features
Expand Down Expand Up @@ -63,6 +61,35 @@ I --> J[End]

### Token Structure

```
Token {
genesis: CertifiedMintTransaction {
transaction: MintTransaction {
sourceStateHash: MintTransactionState,
lockScript: IPredicate,
recipient: PayToScriptHash,
tokenId: TokenId,
tokenType: TokenType,
data: Uint8Array
},
inclusionProof: InclusionProof
},
transactions: [
CertifiedTransferTransaction {
transaction: TransferTransaction {
sourceStateHash: DataHash,
lockScript: IPredicate,
recipient: PayToScriptHash,
x: Uint8Array,
data: Uint8Array
},
inclusionProof: InclusionProof
},
...
]
}
```

### Privacy Model
- **Commitment-based**: Only cryptographic commitments published on-chain
- **Self-contained**: Tokens include complete transaction history
Expand Down Expand Up @@ -129,16 +156,14 @@ npm run lint:fix

## Examples

### Minting Tokens

Note that the examples here are using some utility functions and classes that are defined below in a separate section.

```typescript
```
### Minting Tokens
`tests/examples/mint/ExampleTest.ts`

### Token Transfer
`tests/examples/transfer/ExampleTest.ts`

### Checking Token Status
### Token Splitting
`tests/examples/split/ExampleTest.ts`

## Unicity Signature Standard

Expand Down
Loading