Skip to content

Commit e99658e

Browse files
authored
Merge pull request #97 from unicitynetwork/issue-96
#96 Use plain hash instead of imprints in certification data
2 parents 81c3061 + 654a2c5 commit e99658e

58 files changed

Lines changed: 1301 additions & 1182 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# State Transition SDK
22

3-
An SDK for managing assets on the Unicity Protocol, supporting off-chain state with on-chain security guarantees.
4-
53
## Overview
64

75
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.
8-
6+
This is a low-level SDK, that supports transferring tokens, making payments, and splitting tokens.
97
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.
108

119
### Key Features
@@ -63,6 +61,35 @@ I --> J[End]
6361

6462
### Token Structure
6563

64+
```
65+
Token {
66+
genesis: CertifiedMintTransaction {
67+
transaction: MintTransaction {
68+
sourceStateHash: MintTransactionState,
69+
lockScript: IPredicate,
70+
recipient: PayToScriptHash,
71+
tokenId: TokenId,
72+
tokenType: TokenType,
73+
data: Uint8Array
74+
},
75+
inclusionProof: InclusionProof
76+
},
77+
transactions: [
78+
CertifiedTransferTransaction {
79+
transaction: TransferTransaction {
80+
sourceStateHash: DataHash,
81+
lockScript: IPredicate,
82+
recipient: PayToScriptHash,
83+
x: Uint8Array,
84+
data: Uint8Array
85+
},
86+
inclusionProof: InclusionProof
87+
},
88+
...
89+
]
90+
}
91+
```
92+
6693
### Privacy Model
6794
- **Commitment-based**: Only cryptographic commitments published on-chain
6895
- **Self-contained**: Tokens include complete transaction history
@@ -129,16 +156,14 @@ npm run lint:fix
129156

130157
## Examples
131158

132-
### Minting Tokens
133-
134-
Note that the examples here are using some utility functions and classes that are defined below in a separate section.
135-
136-
```typescript
137-
```
159+
### Minting Tokens
160+
`tests/examples/mint/ExampleTest.ts`
138161

139162
### Token Transfer
163+
`tests/examples/transfer/ExampleTest.ts`
140164

141-
### Checking Token Status
165+
### Token Splitting
166+
`tests/examples/split/ExampleTest.ts`
142167

143168
## Unicity Signature Standard
144169

0 commit comments

Comments
 (0)