shogun-core 3.2.3 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/browser/shogun-core.js +108102 -43579
- package/dist/browser/shogun-core.js.map +1 -1
- package/dist/ship/examples/messenger-cli.js +171 -55
- package/dist/ship/examples/wallet-cli.js +767 -0
- package/dist/ship/implementation/SHIP_00.js +478 -0
- package/dist/ship/implementation/SHIP_01.js +275 -492
- package/dist/ship/implementation/SHIP_02.js +1366 -0
- package/dist/ship/implementation/SHIP_03.js +855 -0
- package/dist/ship/interfaces/ISHIP_00.js +135 -0
- package/dist/ship/interfaces/ISHIP_01.js +81 -24
- package/dist/ship/interfaces/ISHIP_02.js +57 -0
- package/dist/ship/interfaces/ISHIP_03.js +61 -0
- package/dist/src/gundb/db.js +55 -11
- package/dist/src/index.js +10 -2
- package/dist/src/managers/CoreInitializer.js +41 -13
- package/dist/src/storage/storage.js +22 -9
- package/dist/types/ship/examples/messenger-cli.d.ts +7 -1
- package/dist/types/ship/examples/wallet-cli.d.ts +131 -0
- package/dist/types/ship/implementation/SHIP_00.d.ts +113 -0
- package/dist/types/ship/implementation/SHIP_01.d.ts +44 -77
- package/dist/types/ship/implementation/SHIP_02.d.ts +297 -0
- package/dist/types/ship/implementation/SHIP_03.d.ts +127 -0
- package/dist/types/ship/interfaces/ISHIP_00.d.ts +410 -0
- package/dist/types/ship/interfaces/ISHIP_01.d.ts +157 -119
- package/dist/types/ship/interfaces/ISHIP_02.d.ts +470 -0
- package/dist/types/ship/interfaces/ISHIP_03.d.ts +295 -0
- package/dist/types/src/gundb/db.d.ts +10 -3
- package/dist/types/src/index.d.ts +7 -0
- package/dist/types/src/interfaces/shogun.d.ts +2 -0
- package/dist/types/src/storage/storage.d.ts +2 -1
- package/package.json +22 -9
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SHIP-02: Ethereum HD Wallet Implementation
|
|
3
|
+
*
|
|
4
|
+
* Full port of shogun-BIP44 with SHIP-00 derivation.
|
|
5
|
+
* Extends SHIP-00 to provide deterministic Ethereum address derivation.
|
|
6
|
+
*
|
|
7
|
+
* Based on:
|
|
8
|
+
* - SHIP-00 for identity foundation (replaces mnemonic dependency)
|
|
9
|
+
* - BIP-32 for hierarchical deterministic wallets
|
|
10
|
+
* - BIP-44 for multi-account hierarchy
|
|
11
|
+
* - Ethers.js for Ethereum operations
|
|
12
|
+
* - Gun/SEA for encrypted storage
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* ✅ Deterministic address derivation from SHIP-00 identity (no mnemonics needed)
|
|
16
|
+
* ✅ BIP-44 compliant HD wallet support
|
|
17
|
+
* ✅ Multiple address management
|
|
18
|
+
* ✅ Transaction signing
|
|
19
|
+
* ✅ Message signing and verification
|
|
20
|
+
* ✅ Gun persistence with encryption
|
|
21
|
+
* ✅ Export/import functionality
|
|
22
|
+
* ✅ Address book management
|
|
23
|
+
*
|
|
24
|
+
* Note: Stealth addresses moved to SHIP-03
|
|
25
|
+
*/
|
|
26
|
+
import type { ISHIP_00 } from "../interfaces/ISHIP_00";
|
|
27
|
+
import type { ISHIP_02, DerivationResult, StealthAddressResult, SignatureResult, Transaction, AddressEntry, AddressBook, SHIP_02_Config, WalletInfo } from "../interfaces/ISHIP_02";
|
|
28
|
+
import { ethers } from "ethers";
|
|
29
|
+
/**
|
|
30
|
+
* SHIP-02 Reference Implementation
|
|
31
|
+
*
|
|
32
|
+
* Provides Ethereum address derivation on top of SHIP-00 identity.
|
|
33
|
+
* All addresses are deterministically derived from the user's SHIP-00 keypair.
|
|
34
|
+
*/
|
|
35
|
+
declare class SHIP_02 implements ISHIP_02 {
|
|
36
|
+
private identity;
|
|
37
|
+
private config;
|
|
38
|
+
private initialized;
|
|
39
|
+
static readonly NODES: {
|
|
40
|
+
readonly ADDRESS_BOOK: "addressbook";
|
|
41
|
+
readonly MNEMONIC: "mnemonic";
|
|
42
|
+
readonly WALLET_PATHS: "wallet_paths";
|
|
43
|
+
};
|
|
44
|
+
private masterSeed;
|
|
45
|
+
private mnemonic;
|
|
46
|
+
private hdWallet;
|
|
47
|
+
private addressCache;
|
|
48
|
+
private walletCache;
|
|
49
|
+
private nextIndex;
|
|
50
|
+
private persistToGun;
|
|
51
|
+
private provider;
|
|
52
|
+
private mainWallet;
|
|
53
|
+
private walletPaths;
|
|
54
|
+
constructor(identity: ISHIP_00, config?: SHIP_02_Config);
|
|
55
|
+
initialize(useMnemonic?: boolean): Promise<void>;
|
|
56
|
+
isInitialized(): boolean;
|
|
57
|
+
deriveEthereumAddress(path?: string): Promise<DerivationResult>;
|
|
58
|
+
deriveMultipleAddresses(count: number, startIndex?: number): Promise<DerivationResult[]>;
|
|
59
|
+
getPrimaryAddress(): Promise<string>;
|
|
60
|
+
deriveBIP44Address(coinType?: number, account?: number, change?: number, index?: number): Promise<DerivationResult>;
|
|
61
|
+
deriveMultipleAccounts(accountCount: number): Promise<DerivationResult[]>;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Use SHIP-03 for dual-key stealth addresses
|
|
64
|
+
*/
|
|
65
|
+
generateStealthAddress(recipientPublicKey?: string): Promise<StealthAddressResult>;
|
|
66
|
+
/**
|
|
67
|
+
* @deprecated Use SHIP-03 for stealth operations
|
|
68
|
+
*/
|
|
69
|
+
deriveSharedSecret(publicKey: string): Promise<string>;
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Use SHIP-03 for stealth operations
|
|
72
|
+
*/
|
|
73
|
+
isStealthAddress(address: string): Promise<boolean>;
|
|
74
|
+
getPrivateKeyForAddress(address: string): Promise<string>;
|
|
75
|
+
getPublicKeyForAddress(address: string): Promise<string>;
|
|
76
|
+
getPathForAddress(address: string): Promise<string | undefined>;
|
|
77
|
+
signTransaction(tx: Transaction, address: string): Promise<SignatureResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Send transaction to Ethereum network
|
|
80
|
+
* Combines signing + broadcasting in one step
|
|
81
|
+
*/
|
|
82
|
+
sendTransaction(tx: Transaction, address: string, waitForConfirmation?: boolean): Promise<{
|
|
83
|
+
success: boolean;
|
|
84
|
+
txHash?: string;
|
|
85
|
+
receipt?: ethers.TransactionReceipt;
|
|
86
|
+
error?: string;
|
|
87
|
+
}>;
|
|
88
|
+
signMessage(message: string | Uint8Array, address: string): Promise<string>;
|
|
89
|
+
verifySignature(message: string | Uint8Array, signature: string, address: string): Promise<boolean>;
|
|
90
|
+
getAllAddresses(): Promise<AddressEntry[]>;
|
|
91
|
+
getAddressByIndex(index: number): Promise<AddressEntry | undefined>;
|
|
92
|
+
setAddressLabel(address: string, label: string): Promise<void>;
|
|
93
|
+
exportAddressBook(): Promise<AddressBook>;
|
|
94
|
+
importAddressBook(addressBook: AddressBook): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Enable persistence to Gun database
|
|
97
|
+
*/
|
|
98
|
+
enableGunPersistence(): void;
|
|
99
|
+
/**
|
|
100
|
+
* Disable persistence to Gun database
|
|
101
|
+
*/
|
|
102
|
+
disableGunPersistence(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Save address book to Gun (private storage)
|
|
105
|
+
*/
|
|
106
|
+
private saveAddressBookToGun;
|
|
107
|
+
/**
|
|
108
|
+
* Load address book from Gun
|
|
109
|
+
*/
|
|
110
|
+
loadAddressBookFromGun(): Promise<AddressBook | null>;
|
|
111
|
+
/**
|
|
112
|
+
* Sync local cache with Gun storage
|
|
113
|
+
*/
|
|
114
|
+
syncWithGun(): Promise<void>;
|
|
115
|
+
ownsAddress(address: string): Promise<boolean>;
|
|
116
|
+
getMasterPublicKey(): Promise<string>;
|
|
117
|
+
clearCache(): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Generate new BIP-39 mnemonic (12 words)
|
|
120
|
+
* Compatible with MetaMask and other wallets
|
|
121
|
+
*/
|
|
122
|
+
generateNewMnemonic(): string;
|
|
123
|
+
/**
|
|
124
|
+
* Get addresses that would be derived from a mnemonic (standard BIP-44)
|
|
125
|
+
* Useful to verify compatibility with MetaMask
|
|
126
|
+
*/
|
|
127
|
+
getStandardBIP44Addresses(mnemonic: string, count?: number): string[];
|
|
128
|
+
/**
|
|
129
|
+
* Get current mnemonic (if using mnemonic mode)
|
|
130
|
+
*/
|
|
131
|
+
getMnemonic(): Promise<string | null>;
|
|
132
|
+
/**
|
|
133
|
+
* Get user's master mnemonic from Gun or localStorage
|
|
134
|
+
* Used by createWallet/loadWallets for frontend compatibility
|
|
135
|
+
*/
|
|
136
|
+
getUserMasterMnemonic(): Promise<string | null>;
|
|
137
|
+
/**
|
|
138
|
+
* Export mnemonic (encrypted)
|
|
139
|
+
*/
|
|
140
|
+
exportMnemonic(): Promise<string | null>;
|
|
141
|
+
/**
|
|
142
|
+
* Import mnemonic and re-initialize wallet
|
|
143
|
+
*/
|
|
144
|
+
importMnemonic(encryptedMnemonic: string): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Save mnemonic to Gun (encrypted)
|
|
147
|
+
*/
|
|
148
|
+
private saveMnemonicToGun;
|
|
149
|
+
/**
|
|
150
|
+
* Load mnemonic from Gun (encrypted)
|
|
151
|
+
*/
|
|
152
|
+
private loadMnemonicFromGun;
|
|
153
|
+
/**
|
|
154
|
+
* Get storage identifier for current user
|
|
155
|
+
*/
|
|
156
|
+
getStorageUserIdentifier(): string;
|
|
157
|
+
/**
|
|
158
|
+
* Encrypt sensitive data using SEA
|
|
159
|
+
*/
|
|
160
|
+
encryptSensitiveData(text: string): Promise<string>;
|
|
161
|
+
/**
|
|
162
|
+
* Decrypt sensitive data using SEA
|
|
163
|
+
*/
|
|
164
|
+
decryptSensitiveData(encryptedText: string): Promise<string | null>;
|
|
165
|
+
/**
|
|
166
|
+
* Export master seed (encrypted)
|
|
167
|
+
* SECURITY: Handle with extreme care!
|
|
168
|
+
*/
|
|
169
|
+
exportMasterSeed(): Promise<string>;
|
|
170
|
+
/**
|
|
171
|
+
* Export all wallet data (encrypted)
|
|
172
|
+
*/
|
|
173
|
+
exportWalletData(): Promise<string>;
|
|
174
|
+
/**
|
|
175
|
+
* Import wallet data (encrypted)
|
|
176
|
+
*/
|
|
177
|
+
importWalletData(encryptedData: string): Promise<void>;
|
|
178
|
+
/**
|
|
179
|
+
* Ensure system is initialized
|
|
180
|
+
*/
|
|
181
|
+
private ensureInitialized;
|
|
182
|
+
/**
|
|
183
|
+
* Derive master seed from SHIP-00 keypair
|
|
184
|
+
*/
|
|
185
|
+
private deriveMasterSeed;
|
|
186
|
+
/**
|
|
187
|
+
* Build BIP-44 derivation path
|
|
188
|
+
*/
|
|
189
|
+
private buildBIP44Path;
|
|
190
|
+
/**
|
|
191
|
+
* Set RPC provider URL
|
|
192
|
+
*/
|
|
193
|
+
setRpcUrl(rpcUrl: string): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Get current RPC provider
|
|
196
|
+
*/
|
|
197
|
+
getProvider(): ethers.JsonRpcProvider | null;
|
|
198
|
+
/**
|
|
199
|
+
* Get signer (main wallet connected to provider)
|
|
200
|
+
*/
|
|
201
|
+
getSigner(): ethers.Wallet;
|
|
202
|
+
/**
|
|
203
|
+
* Set custom signer
|
|
204
|
+
*/
|
|
205
|
+
setSigner(signer: ethers.Wallet): Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Get main wallet (derived from Gun user keys, not BIP-44)
|
|
208
|
+
* This provides a consistent "main" wallet independent of HD derivation
|
|
209
|
+
*/
|
|
210
|
+
getMainWallet(): ethers.Wallet;
|
|
211
|
+
/**
|
|
212
|
+
* Get main wallet credentials
|
|
213
|
+
*/
|
|
214
|
+
getMainWalletCredentials(): {
|
|
215
|
+
address: string;
|
|
216
|
+
priv: string;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Create new wallet with auto-incremented index
|
|
220
|
+
* Frontend-friendly API that returns ready-to-use wallet object
|
|
221
|
+
*/
|
|
222
|
+
createWallet(): Promise<WalletInfo>;
|
|
223
|
+
/**
|
|
224
|
+
* Load all wallets from stored paths
|
|
225
|
+
* Reconstructs wallet objects from mnemonic/seed and paths
|
|
226
|
+
*/
|
|
227
|
+
loadWallets(): Promise<WalletInfo[]>;
|
|
228
|
+
/**
|
|
229
|
+
* Export wallet keys for all derived addresses
|
|
230
|
+
*/
|
|
231
|
+
exportWalletKeys(): Promise<string>;
|
|
232
|
+
/**
|
|
233
|
+
* Export Gun SEA keypair
|
|
234
|
+
*/
|
|
235
|
+
exportGunPair(): Promise<string>;
|
|
236
|
+
/**
|
|
237
|
+
* Export all user data (mnemonic, wallets, Gun pair)
|
|
238
|
+
*/
|
|
239
|
+
exportAllUserData(): Promise<string>;
|
|
240
|
+
/**
|
|
241
|
+
* Import wallet keys and restore wallets
|
|
242
|
+
*/
|
|
243
|
+
importWalletKeys(walletsData: string): Promise<number>;
|
|
244
|
+
/**
|
|
245
|
+
* Import Gun SEA keypair
|
|
246
|
+
* Note: This is a placeholder for compatibility
|
|
247
|
+
* SHIP-02 doesn't manage Gun keys directly (use SHIP-00 for that)
|
|
248
|
+
*/
|
|
249
|
+
importGunPair(pairData: string): Promise<boolean>;
|
|
250
|
+
/**
|
|
251
|
+
* Import all user data from backup
|
|
252
|
+
*/
|
|
253
|
+
importAllUserData(backupData: string, options?: {
|
|
254
|
+
importMnemonic?: boolean;
|
|
255
|
+
importWallets?: boolean;
|
|
256
|
+
importGunPair?: boolean;
|
|
257
|
+
}): Promise<{
|
|
258
|
+
success: boolean;
|
|
259
|
+
mnemonicImported?: boolean;
|
|
260
|
+
walletsImported?: number;
|
|
261
|
+
gunPairImported?: boolean;
|
|
262
|
+
}>;
|
|
263
|
+
/**
|
|
264
|
+
* Initialize wallet paths from Gun storage
|
|
265
|
+
*/
|
|
266
|
+
initializeWalletPaths(): Promise<void>;
|
|
267
|
+
/**
|
|
268
|
+
* Save wallet paths to localStorage
|
|
269
|
+
*/
|
|
270
|
+
saveWalletPathsToLocalStorage(): Promise<void>;
|
|
271
|
+
/**
|
|
272
|
+
* Load wallet paths from localStorage
|
|
273
|
+
*/
|
|
274
|
+
loadWalletPathsFromLocalStorage(): Promise<void>;
|
|
275
|
+
/**
|
|
276
|
+
* Save wallet paths to Gun
|
|
277
|
+
*/
|
|
278
|
+
private saveWalletPathsToGun;
|
|
279
|
+
/**
|
|
280
|
+
* Load wallet paths from Gun
|
|
281
|
+
*/
|
|
282
|
+
private loadWalletPathsFromGun;
|
|
283
|
+
/**
|
|
284
|
+
* Generate deterministic private key from string seed
|
|
285
|
+
* Uses same algorithm as shogun-BIP44 for compatibility
|
|
286
|
+
*/
|
|
287
|
+
private generatePrivateKeyFromString;
|
|
288
|
+
/**
|
|
289
|
+
* Initialize wallet paths and test encryption system
|
|
290
|
+
*/
|
|
291
|
+
initializeWalletPathsAndTestEncryption(): Promise<void>;
|
|
292
|
+
/**
|
|
293
|
+
* Cleanup resources
|
|
294
|
+
*/
|
|
295
|
+
cleanup(): Promise<void>;
|
|
296
|
+
}
|
|
297
|
+
export { SHIP_02 };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SHIP-03: Dual-Key Stealth Address Implementation
|
|
3
|
+
*
|
|
4
|
+
* Full port of shogun-stealth-address with Fluidkey integration.
|
|
5
|
+
* Extends SHIP-00 and SHIP-02 to provide ERC-5564 compatible stealth addresses.
|
|
6
|
+
*
|
|
7
|
+
* Based on:
|
|
8
|
+
* - SHIP-00 for identity foundation
|
|
9
|
+
* - SHIP-02 for Ethereum operations
|
|
10
|
+
* - ERC-5564 for stealth address standard
|
|
11
|
+
* - Fluidkey Stealth Account Kit
|
|
12
|
+
* - @scure/bip32 for HD key derivation
|
|
13
|
+
*
|
|
14
|
+
* Features:
|
|
15
|
+
* ✅ Dual-key stealth (viewing + spending keys)
|
|
16
|
+
* ✅ ERC-5564 / Fluidkey compatible
|
|
17
|
+
* ✅ Deterministic derivation from SHIP-00
|
|
18
|
+
* ✅ View tag optimization for scanning
|
|
19
|
+
* ✅ Announcement metadata
|
|
20
|
+
* ✅ Batch generation
|
|
21
|
+
* ✅ Fluidkey generateStealthAddresses
|
|
22
|
+
* ✅ Fluidkey generateStealthPrivateKey
|
|
23
|
+
*/
|
|
24
|
+
import type { ISHIP_00 } from "../interfaces/ISHIP_00";
|
|
25
|
+
import type { ISHIP_02 } from "../interfaces/ISHIP_02";
|
|
26
|
+
import type { ISHIP_03, StealthKeys, EphemeralKeyPair, StealthAddressResult, StealthMetadata, AnnouncedStealth, OwnedStealthAddress, SHIP_03_Config } from "../interfaces/ISHIP_03";
|
|
27
|
+
/**
|
|
28
|
+
* SHIP-03 Reference Implementation
|
|
29
|
+
*
|
|
30
|
+
* Full Fluidkey-compatible stealth address system derived from SHIP-00.
|
|
31
|
+
* All keys are deterministically derived from the user's SHIP-00 identity.
|
|
32
|
+
*/
|
|
33
|
+
declare class SHIP_03 implements ISHIP_03 {
|
|
34
|
+
private identity;
|
|
35
|
+
private eth;
|
|
36
|
+
private config;
|
|
37
|
+
private initialized;
|
|
38
|
+
static readonly NODES: {
|
|
39
|
+
readonly STEALTH_KEYS_PUBLIC: "stealth_keys_public";
|
|
40
|
+
readonly STEALTH_ANNOUNCEMENTS: "stealth_announcements";
|
|
41
|
+
};
|
|
42
|
+
private viewingKey;
|
|
43
|
+
private spendingKey;
|
|
44
|
+
private ownedStealthAddresses;
|
|
45
|
+
private announcementCache;
|
|
46
|
+
constructor(identity: ISHIP_00, eth: ISHIP_02, config?: SHIP_03_Config);
|
|
47
|
+
initialize(): Promise<void>;
|
|
48
|
+
isInitialized(): boolean;
|
|
49
|
+
getStealthKeys(): Promise<StealthKeys>;
|
|
50
|
+
/**
|
|
51
|
+
* Get public stealth keys by username (alias)
|
|
52
|
+
* Resolves username → Gun pub → stealth keys
|
|
53
|
+
*/
|
|
54
|
+
getPublicStealthKeysByUsername(username: string): Promise<{
|
|
55
|
+
viewingPublicKey: string;
|
|
56
|
+
spendingPublicKey: string;
|
|
57
|
+
} | null>;
|
|
58
|
+
/**
|
|
59
|
+
* Get public stealth keys by Gun public key
|
|
60
|
+
*/
|
|
61
|
+
getPublicStealthKeys(userPub: string): Promise<{
|
|
62
|
+
viewingPublicKey: string;
|
|
63
|
+
spendingPublicKey: string;
|
|
64
|
+
} | null>;
|
|
65
|
+
/**
|
|
66
|
+
* Search stealth keys in directory (all published keys)
|
|
67
|
+
* Returns list of users who have published stealth keys
|
|
68
|
+
*/
|
|
69
|
+
searchStealthDirectory(): Promise<Array<{
|
|
70
|
+
username?: string;
|
|
71
|
+
gunPub: string;
|
|
72
|
+
viewingPublicKey: string;
|
|
73
|
+
spendingPublicKey: string;
|
|
74
|
+
timestamp?: number;
|
|
75
|
+
}>>;
|
|
76
|
+
exportStealthKeys(): Promise<string>;
|
|
77
|
+
importStealthKeys(encryptedKeys: string): Promise<void>;
|
|
78
|
+
generateEphemeralKeyPair(): Promise<EphemeralKeyPair>;
|
|
79
|
+
generateStealthAddress(recipientViewingKey: string, recipientSpendingKey: string, ephemeralPrivateKey?: string): Promise<StealthAddressResult>;
|
|
80
|
+
generateMultipleStealthAddresses(recipients: Array<{
|
|
81
|
+
viewingKey: string;
|
|
82
|
+
spendingKey: string;
|
|
83
|
+
}>, ephemeralPrivateKey?: string): Promise<StealthAddressResult[]>;
|
|
84
|
+
openStealthAddress(stealthAddress: string, ephemeralPublicKey: string): Promise<any>;
|
|
85
|
+
isStealthAddressMine(stealthAddress: string, ephemeralPublicKey: string): Promise<boolean>;
|
|
86
|
+
getStealthPrivateKey(stealthAddress: string, ephemeralPublicKey: string): Promise<string>;
|
|
87
|
+
scanStealthAddresses(announcements: AnnouncedStealth[]): Promise<OwnedStealthAddress[]>;
|
|
88
|
+
quickScanWithViewTags(announcements: AnnouncedStealth[]): Promise<AnnouncedStealth[]>;
|
|
89
|
+
createAnnouncementMetadata(stealthAddress: string, ephemeralPublicKey: string): StealthMetadata;
|
|
90
|
+
parseAnnouncement(txData: any): Promise<AnnouncedStealth | null>;
|
|
91
|
+
getAllOwnedStealthAddresses(): Promise<OwnedStealthAddress[]>;
|
|
92
|
+
clearCache(): Promise<void>;
|
|
93
|
+
verifyStealthAddress(stealthAddress: string, ephemeralPublicKey: string, spendingPublicKey: string): Promise<boolean>;
|
|
94
|
+
/**
|
|
95
|
+
* Ensure system is initialized
|
|
96
|
+
*/
|
|
97
|
+
private ensureInitialized;
|
|
98
|
+
/**
|
|
99
|
+
* Derive stealth keys deterministically from SHIP-00 identity
|
|
100
|
+
*
|
|
101
|
+
* Uses simple deterministic derivation instead of Fluidkey's generateKeysFromSignature
|
|
102
|
+
* because it requires specific EIP-712 signature format.
|
|
103
|
+
*
|
|
104
|
+
* We use Fluidkey only for:
|
|
105
|
+
* - generateStealthAddresses (address generation)
|
|
106
|
+
* - generateStealthPrivateKey (opening addresses)
|
|
107
|
+
*/
|
|
108
|
+
private deriveStealthKeysFromIdentity;
|
|
109
|
+
/**
|
|
110
|
+
* Publish public stealth keys to Gun for others to use (PUBLIC METHOD)
|
|
111
|
+
*/
|
|
112
|
+
publishStealthKeys(): Promise<void>;
|
|
113
|
+
/**
|
|
114
|
+
* Compute view tag for quick scanning
|
|
115
|
+
*/
|
|
116
|
+
private computeViewTag;
|
|
117
|
+
/**
|
|
118
|
+
* Fallback method to open stealth address (manual ECDH computation)
|
|
119
|
+
* Used when Fluidkey is not available or fails
|
|
120
|
+
*/
|
|
121
|
+
private openStealthAddressFallback;
|
|
122
|
+
/**
|
|
123
|
+
* Add two private keys using modular arithmetic (secp256k1)
|
|
124
|
+
*/
|
|
125
|
+
private addPrivateKeys;
|
|
126
|
+
}
|
|
127
|
+
export { SHIP_03 };
|