DashSync is a lightweight blockchain client library for iOS/macOS that enables applications to interact with the Dash cryptocurrency network. It supports both Dash Core Network (Layer 1) and Dash Platform (Layer 2).
- Language: Objective-C with C/C++/Rust interop
- Build System: Xcode + CocoaPods
- Deployment: iOS 13.0+, macOS 10.15+
- Pod Name:
DashSyncPod
# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
# Install protobuf and grpc
brew install protobuf grpc cmake# Run example project
cd Example && pod install && open DashSync.xcworkspace
# Run tests
cd Example && xcodebuild test -workspace DashSync.xcworkspace -scheme DashSync-Example -destination 'platform=iOS Simulator,name=iPhone 15'
# Update pods
cd Example && pod updateDashSync/
├── DashSync/shared/ # Main framework source (cross-platform)
│ ├── Models/ # Core domain models (24 subdirectories)
│ ├── Libraries/ # Utility libraries
│ └── DashSync.xcdatamodeld/ # Core Data model (83 entities)
├── DashSync/iOS/ # iOS-specific code
├── DashSync/macOS/ # macOS-specific code
├── Example/ # Reference app and tests
├── Scripts/ # Build utilities
└── ChainResources/ # Blockchain data files
- Layer 1 (Core): Traditional blockchain - transactions, blocks, masternodes
- Layer 2 (Platform): Decentralized apps - identities, documents, contracts
- Models: Data structures (
DSChain,DSWallet,DSTransaction) - Managers: Service coordinators (
DSChainManager,DSPeerManager)
| Manager | Purpose |
|---|---|
DSChainsManager |
Multi-chain coordinator (singleton) |
DSChainManager |
Single chain operations |
DSPeerManager |
P2P network connectivity |
DSTransactionManager |
Transaction pool |
DSMasternodeManager |
Masternode lists & quorums |
DSIdentitiesManager |
Blockchain identities |
DSGovernanceSyncManager |
Governance data sync |
- Core Data with SQLite backend
- 83 entity definitions in
DashSync.xcdatamodeld - Custom transformers in
Models/Persistence/Transformers/
- All classes prefixed with
DS(e.g.,DSChain,DSWallet) - Entities suffixed with
Entity(e.g.,DSChainEntity) - Managers suffixed with
Manager(e.g.,DSPeerManager)
- Public headers in main directory
+Protected.hfiles for subclass-accessible interfaces- Categories in
Categories/subdirectories
Event-driven via NSNotificationCenter:
DSChainBlocksDidFinishSyncingNotificationDSWalletBalanceDidChangeNotificationDSPeerManagerConnectedPeersDidChangeNotification
DSChain(3,562 lines) - Central blockchain state managerDSBlock,DSMerkleBlock- Block representationsDSChainLock- Chain lock mechanism
DSWallet- HD wallet managementDSAccount- Account within walletDSBIP39Mnemonic- Mnemonic seed handlingDSDerivationPath- BIP32/44 key derivation
DSTransaction- Base transaction classDSCoinbaseTransaction- Mining rewardsDSProviderRegistrationTransaction- Masternode registrationDSQuorumCommitmentTransaction- Quorum operationsDSCreditFundingTransaction- Platform funding
DSBlockchainIdentity- Dash Platform identityDSBlockchainInvitation- Contact requestsDPContract- Platform smart contractsDPDocument- Platform documents
DSCoinJoinManager- CoinJoin mixing coordinationDSCoinJoinWrapper- Protocol implementation
| Network | Purpose |
|---|---|
| Mainnet | Production Dash network |
| Testnet | Testing environment |
| Devnet | Development chains |
| Regnet | Local regression testing |
Tests located in Example/Tests/:
DSChainTests.m- Chain operationsDSTransactionTests.m- Transaction handlingDSDeterministicMasternodeListTests.m- Masternode listsDSCoinJoinSessionTest.m- Privacy mixingDSDIP14Tests.m- DIP compliance
build.yml- Main CI pipelinetest.yml- Unit testslint.yml- Code lintingcoverage.yml- Code coveragesyncTestMainnet.yml/syncTestTestnet.yml- Network sync tests
Key CocoaPods:
- DashSharedCore - Rust-based cryptographic primitives
- CocoaLumberjack - Logging framework
- DAPI-GRPC - Decentralized API protocol
- TinyCborObjc - CBOR serialization
Supports 15+ languages: en, de, es, ja, zh-Hans, zh-Hant-TW, uk, bg, el, it, cs, sk, ko, pl, tr, vi
NEVER commit or push changes without explicit user permission.
When the user asks you to make code changes:
- Make the requested changes to the code
- Show what was changed (using
git diffor explanation) - STOP and WAIT for explicit permission to commit/push
- Only commit/push when the user explicitly says to do so
Example phrases that give permission to commit/push:
- "commit these changes"
- "push to github"
- "create a commit and push"
- "commit and push all changes"
Do NOT commit/push just because the user asked for code changes. They may want to test first.
Each set of changes requires its own explicit permission. If the user gave permission to commit earlier in the conversation, that permission applies ONLY to those specific changes - NOT to any subsequent changes.
Example scenario:
- User: "Fix bug X, then commit and push" → Permission granted for bug X fix only
- User: "Now fix bug Y" → Make the fix, show diff, STOP AND WAIT - no permission to commit yet
- User: "Looks good, commit it" → NOW permission is granted for bug Y fix
Common mistake to avoid: After completing a task like "address review comments" or "fix these issues", do NOT automatically commit. The user needs to test the changes first. Always pause after showing the diff and wait for explicit commit instruction.
This is especially important for DashSync because:
- Changes affect downstream projects (dashwallet-ios, other consumers)
- Logging and behavioral changes need runtime verification
- The user must run the code to confirm changes work as expected
Always wait for the user to confirm they have tested and verified the changes before committing.
- DashJ (Android equivalent): https://github.com/dashpay/dashj
- Dash Wallet Android: https://github.com/dashpay/dash-wallet