Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 1b8dd49

Browse files
committed
Age of client-side-validation has begun
1 parent d1a90f0 commit 1b8dd49

31 files changed

+145
-16
lines changed

Docs/Assets/accept01.png

218 KB
Loading

Docs/Assets/accept02.png

198 KB
Loading

Docs/Assets/internals01.png

122 KB
Loading

Docs/Assets/internals02.png

147 KB
Loading

Docs/Assets/internals03.png

193 KB
Loading

Docs/Assets/internals04.png

212 KB
Loading

Docs/Assets/internals05.png

48.4 KB
Loading

Docs/Assets/internals06.png

132 KB
Loading

Docs/Assets/internals07.png

119 KB
Loading

Docs/Assets/invoice01.png

284 KB
Loading

Docs/Assets/invoice02.png

274 KB
Loading

Docs/Assets/invoice03.png

262 KB
Loading

Docs/Assets/ipad01.png

284 KB
Loading

Docs/Assets/ipad02.png

286 KB
Loading

Docs/Assets/ipad03.png

723 KB
Loading

Docs/Assets/ipad04.png

454 KB
Loading

Docs/Assets/ipad05.png

376 KB
Loading

Docs/Assets/ipad06.png

527 KB
Loading

Docs/Assets/payment01.png

467 KB
Loading

Docs/Assets/payment02.png

371 KB
Loading

Docs/Assets/payment03.png

699 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<VariablesViewState
3+
version = "1.0">
4+
<ContextStates>
5+
<ContextState
6+
contextName = "PaymentView.pay():PaymentView.swift">
7+
</ContextState>
8+
<ContextState
9+
contextName = "TransactionView.operations.getter:TransactionView.swift">
10+
</ContextState>
11+
<ContextState
12+
contextName = "PaymentView.hasAmount.getter:PaymentView.swift">
13+
</ContextState>
14+
<ContextState
15+
contextName = "Import.importData():Import.swift">
16+
</ContextState>
17+
<ContextState
18+
contextName = "CitadelVault.pay(from:invoice:fee:giveaway:):CAPI.swift">
19+
</ContextState>
20+
<ContextState
21+
contextName = "TransferDirection.init(from:):Wallet.swift">
22+
</ContextState>
23+
</ContextStates>
24+
</VariablesViewState>

My Citadel.xcodeproj/xcuserdata/orlovsky.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint">
99
<BreakpointContent
1010
uuid = "16C5B9A5-CC52-424F-908B-3CEFA70F37C9"
11-
shouldBeEnabled = "Yes"
11+
shouldBeEnabled = "No"
1212
ignoreCount = "0"
1313
continueAfterRunningActions = "No">
1414
</BreakpointContent>
@@ -17,7 +17,7 @@
1717
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
1818
<BreakpointContent
1919
uuid = "B80B1286-9CCB-419B-820D-7075AC0646A8"
20-
shouldBeEnabled = "Yes"
20+
shouldBeEnabled = "No"
2121
ignoreCount = "0"
2222
continueAfterRunningActions = "No"
2323
breakpointStackSelectionBehavior = "1"
@@ -29,7 +29,7 @@
2929
BreakpointExtensionID = "Xcode.Breakpoint.RuntimeIssueBreakpoint">
3030
<BreakpointContent
3131
uuid = "7F6C4764-45A3-43AE-AECE-D70810FBF0E0"
32-
shouldBeEnabled = "Yes"
32+
shouldBeEnabled = "No"
3333
ignoreCount = "0"
3434
continueAfterRunningActions = "No"
3535
breakpointStackSelectionBehavior = "1"

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# MyCitadel Wallet
2+
3+
Mobile & desktop wallet for Apple Darwin platforms (iOS, iPadOS, macOS) supporting:
4+
- Bitcoin descriptor-based wallets with private keys stored in Apple hardware secure enclave
5+
- [RGB](https://rgbfaq.com): bitcoin & lightning client-validated smart contracts
6+
- Multisignature & miniscript-based spending policies (WIP)
7+
- Taproot & Schnorr signatures (WIP)
8+
- Lightning network, including RGB-over-lightning payments (WIP)
9+
10+
The wallet is using [MyCitadel Node](https://github.com/mycitadel/mycitadel-node) backend, either as an embedded
11+
library & runtime, or as an externally hosted service (personal or enterprise server).
12+
13+
MyCitadel is a consumer-facing apps & products based on [LNP/BP Association](https://github.com/LNP-BP) open-source
14+
libraries for:
15+
- [client-side-validation](https://github.com/LNP-BP/rust-lnpbp), RGB(https://github.com/rgb-org),
16+
- LNP ([lightning network protocol](https://github.com/LNP-BP/lnp-core) and [rust node](https://github.com/LNP-BP/lnp-node)),
17+
- [descriptor wallets](https://github.com/LNP-BP/descriptor-wallet)
18+
- [Internet2](https://github.com/internet2-org/rust-internet2) focusing on end-to-end-encrypted peer-to-peer
19+
microservice architectures
20+
21+
It is also heavily uses [rust-bitcoin](https://github.com/rust-bitcoin/) community libraries:
22+
- [rust-bitcoin](https://github.com/rust-bitcoin/rust-bitcoin)
23+
- [rust-miniscript](https://github.com/rust-bitcoin/rust-miniscript)
24+
25+
## Screenshots
26+
27+
### General
28+
29+
![](Docs/Assets/ipad01.png)
30+
![](Docs/Assets/ipad02.png)
31+
![](Docs/Assets/ipad03.png)
32+
![](Docs/Assets/ipad04.png)
33+
![](Docs/Assets/ipad05.png)
34+
![](Docs/Assets/ipad06.png)
35+
36+
### Invoicing
37+
38+
![](Docs/Assets/invoice01.png)
39+
![](Docs/Assets/invoice02.png)
40+
![](Docs/Assets/invoice03.png)
41+
42+
### Payments
43+
44+
![](Docs/Assets/payment01.png)
45+
![](Docs/Assets/payment02.png)
46+
![](Docs/Assets/payment03.png)
47+
48+
### Payment acceptance
49+
50+
![](Docs/Assets/accept01.png)
51+
![](Docs/Assets/accept02.png)
52+
53+
### Tool for bitcoin hackers
54+
55+
![](Docs/Assets/internals01.png)
56+
![](Docs/Assets/internals02.png)
57+
![](Docs/Assets/internals03.png)
58+
![](Docs/Assets/internals04.png)
59+
![](Docs/Assets/internals05.png)
60+
![](Docs/Assets/internals06.png)
61+
![](Docs/Assets/internals07.png)

Shared/Import/Import.swift

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ struct Import: View {
178178
case .unknown:
179179
recognizedAs = "incorrect data"
180180
recognitionErrors = [info.parseReport]
181+
case .rgb20Asset(let asset):
182+
recognitionDetails = [asset.id]
183+
recognitionMessages = [
184+
("Ticker", asset.ticker),
185+
("Name", asset.name),
186+
("Known supply", String(asset.knownIssued ?? 0))
187+
]
188+
canImport = category == .genesis || category == .all
181189
case .address(let address):
182190
if address.isBIP21 {
183191
recognitionDetails = ["BIP21 bitcoin invoice"]
@@ -200,14 +208,6 @@ struct Import: View {
200208
("Network", address.network.localizedName),
201209
])
202210
canImport = category == .invoice || category == .all
203-
case .rgb20Asset(let asset):
204-
recognitionDetails = [asset.id]
205-
recognitionMessages = [
206-
("Ticker", asset.ticker),
207-
("Name", asset.name),
208-
("Known supply", String(asset.knownIssued ?? 0))
209-
]
210-
canImport = category == .genesis || category == .all
211211
case .lnbpInvoice(let invoice):
212212
recognitionMessages = [
213213
("Pay to", invoice.beneficiary),
@@ -221,6 +221,16 @@ struct Import: View {
221221
recognitionMessages.append(("Description", message))
222222
}
223223
canImport = category == .invoice || category == .all
224+
case .rgbConsignment(let info):
225+
recognitionDetails = ["allows accepting RGB payments & state transfers"]
226+
recognitionMessages = [
227+
("Asset Id", info.asset.id),
228+
("Asset name", info.asset.name),
229+
("Known circulation", "\(info.asset.knownCirculating) \(info.asset.ticker)"),
230+
("Schema Id", info.schemaId),
231+
("Stats", "\(info.transactionsCount) txes, \(info.transitionsCount) transitions, \(info.extensionsCount) endpoints")
232+
]
233+
canImport = category == .consignment || category == .all
224234
default: break
225235
}
226236

Shared/Invoice/InvoiceCreate.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ final class InvoiceConfig: ObservableObject {
135135
return try wallet.invoice(
136136
usingFormat: wallet.hasUtxo ? .addressUtxo : .descriptor,
137137
nominatedIn: asset,
138-
amount: Double(amount) ?? 0
138+
amount: Double(amount) ?? 0,
139+
from: useMerchant ? merchant : nil,
140+
purpose: usePurpose ? purpose : nil,
141+
useLegacySegWit: legacyFormat
139142
)
140143
}
141144
let address = try wallet.nextAddress(legacySegWit: legacyFormat).address

Shared/Wallet/AddressView.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ struct AddressView: View {
5858
private let listStyle = GroupedListStyle()
5959
#endif
6060

61+
private var toolbarPlacement: ToolbarItemPlacement {
62+
#if os(iOS)
63+
return .navigationBarTrailing
64+
#else
65+
return .primaryAction
66+
#endif
67+
}
68+
6169
var body: some View {
6270
List {
6371
Section {
@@ -145,7 +153,7 @@ struct AddressView: View {
145153
.listStyle(listStyle)
146154
.navigationTitle("Address details")
147155
.toolbar {
148-
ToolbarItemGroup(placement: .primaryAction) {
156+
ToolbarItemGroup(placement: toolbarPlacement) {
149157
Button(action: movePrev) {
150158
Image(systemName: "chevron.backward")
151159
}.disabled(prev == nil)

Shared/Wallet/BalanceList.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ struct BalanceList: View {
1515

1616
var wallet: WalletContract
1717

18+
private var toolbarPlacement: ToolbarItemPlacement {
19+
#if os(iOS)
20+
return .navigationBarTrailing
21+
#else
22+
return .primaryAction
23+
#endif
24+
}
25+
1826
var body: some View {
1927
List {
2028
ForEach(wallet.availableAssets, id: \.id) { asset in
@@ -30,7 +38,7 @@ struct BalanceList: View {
3038
}
3139
.navigationTitle(wallet.name)
3240
.toolbar {
33-
ToolbarItemGroup(placement: .primaryAction) {
41+
ToolbarItemGroup(placement: toolbarPlacement) {
3442
Button(action: { presentedSheet = .walletDetails(wallet) }) {
3543
Image(systemName: "info.circle")
3644
}

Shared/Wallet/UtxoView.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ struct UtxoView: View {
5353
#else
5454
private let listStyle = GroupedListStyle()
5555
#endif
56+
private var toolbarPlacement: ToolbarItemPlacement {
57+
#if os(iOS)
58+
return .navigationBarTrailing
59+
#else
60+
return .primaryAction
61+
#endif
62+
}
5663

5764
var body: some View {
5865
List {
@@ -125,7 +132,7 @@ struct UtxoView: View {
125132
.listStyle(listStyle)
126133
.navigationTitle("UTXO details")
127134
.toolbar {
128-
ToolbarItemGroup(placement: .primaryAction) {
135+
ToolbarItemGroup(placement: toolbarPlacement) {
129136
Button(action: movePrev) {
130137
Image(systemName: "chevron.backward")
131138
}.disabled(prev == nil)

Shared/Wallet/WalletView.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ struct WalletView: View {
6969
@State private var status: String? = nil
7070
@State private var statusPresented: Bool = false
7171

72+
private var toolbarPlacement: ToolbarItemPlacement {
73+
#if os(iOS)
74+
return .navigationBarTrailing
75+
#else
76+
return .primaryAction
77+
#endif
78+
}
79+
7280
var body: some View {
7381
List {
7482
BalancePager(wallet: wallet, assetId: $assetId)
@@ -84,7 +92,7 @@ struct WalletView: View {
8492
}
8593
.navigationTitle(wallet.name)
8694
.toolbar {
87-
ToolbarItemGroup(placement: .primaryAction) {
95+
ToolbarItemGroup(placement: toolbarPlacement) {
8896
Button(action: { presentedSheet = .walletDetails(wallet) }) {
8997
Image(systemName: "info.circle")
9098
}

0 commit comments

Comments
 (0)