@sip-protocol/sdk 0.8.1 → 0.10.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/LICENSE +21 -0
- package/dist/{TransportWebUSB-YQMAGJAJ.mjs → TransportWebUSB-2KITI5HD.mjs} +24 -12
- package/dist/browser.d.mts +4 -4
- package/dist/browser.d.ts +4 -4
- package/dist/browser.js +1358 -847
- package/dist/browser.mjs +13 -3
- package/dist/{chunk-64AYA5F5.mjs → chunk-G3TBBG2K.mjs} +221 -146
- package/dist/{chunk-4GRJ5MAW.mjs → chunk-KXETSSKP.mjs} +4 -0
- package/dist/{chunk-YWGJ77A2.mjs → chunk-PT2DNA7E.mjs} +335 -310
- package/dist/{constants-LHAAUC2T.mjs → constants-DCJYTIU3.mjs} +5 -1
- package/dist/{dist-2OGQ7FED.mjs → dist-PYEXZNFD.mjs} +609 -221
- package/dist/{index-DeE1ZzA4.d.mts → index-B1d8pihL.d.mts} +117 -33
- package/dist/{index-DXh2IGkz.d.ts → index-UQhQJZbM.d.ts} +117 -33
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1348 -837
- package/dist/index.mjs +13 -3
- package/dist/{interface-Bf7w1PLW.d.mts → interface-CQi0-WfS.d.mts} +2 -2
- package/dist/{interface-Bf7w1PLW.d.ts → interface-CQi0-WfS.d.ts} +2 -2
- package/dist/{noir-kzbLVTei.d.mts → noir-CwPIyBLj.d.mts} +1 -1
- package/dist/{noir-kzbLVTei.d.ts → noir-CwPIyBLj.d.ts} +1 -1
- package/dist/proofs/halo2.d.mts +1 -1
- package/dist/proofs/halo2.d.ts +1 -1
- package/dist/proofs/kimchi.d.mts +1 -1
- package/dist/proofs/kimchi.d.ts +1 -1
- package/dist/proofs/noir.d.mts +1 -1
- package/dist/proofs/noir.d.ts +1 -1
- package/dist/{solana-U3MEGU7W.mjs → solana-ZWNIQTSU.mjs} +6 -6
- package/package.json +32 -32
- package/src/adapters/gelato-relay.ts +386 -0
- package/src/adapters/index.ts +28 -0
- package/src/adapters/oneinch.ts +126 -0
- package/src/chains/ethereum/constants.ts +33 -1
- package/src/chains/ethereum/index.ts +2 -1
- package/src/chains/ethereum/privacy-adapter.ts +44 -26
- package/src/chains/ethereum/stealth.ts +84 -30
- package/src/chains/ethereum/types.ts +4 -0
- package/src/chains/near/privacy-adapter.ts +8 -5
- package/src/chains/near/resolver.ts +22 -8
- package/src/chains/near/stealth.ts +9 -9
- package/src/chains/solana/constants.ts +13 -1
- package/src/chains/solana/ephemeral-keys.ts +3 -257
- package/src/chains/solana/index.ts +2 -3
- package/src/chains/solana/providers/helius-enhanced.ts +6 -6
- package/src/chains/solana/providers/webhook.ts +2 -2
- package/src/chains/solana/scan.ts +9 -8
- package/src/chains/solana/stealth-scanner.ts +3 -3
- package/src/chains/solana/types.ts +18 -4
- package/src/cosmos/ibc-stealth.ts +6 -6
- package/src/index.ts +6 -0
- package/src/move/aptos.ts +15 -9
- package/src/move/sui.ts +15 -9
- package/src/nft/private-nft.ts +10 -6
- package/src/privacy-backends/shadowwire.ts +13 -0
- package/src/stealth/ed25519.ts +173 -12
- package/src/stealth/index.ts +47 -4
- package/src/stealth/secp256k1.ts +144 -7
- package/src/stealth.ts +7 -0
- package/src/wallet/ethereum/privacy-adapter.ts +1 -1
- package/src/wallet/hardware/ledger-privacy.ts +2 -2
- package/src/wallet/near/adapter.ts +2 -2
- package/src/wallet/near/meteor-wallet.ts +2 -2
- package/src/wallet/near/my-near-wallet.ts +2 -2
- package/src/wallet/near/wallet-selector.ts +2 -2
- package/src/wallet/solana/privacy-adapter.ts +9 -9
|
@@ -277,8 +277,8 @@ export class PrivacySolanaWalletAdapter extends SolanaWalletAdapter {
|
|
|
277
277
|
try {
|
|
278
278
|
const isOwned = checkEd25519StealthAddress(
|
|
279
279
|
announcement,
|
|
280
|
-
this.stealthKeys.metaAddress.spendingKey,
|
|
281
280
|
this.stealthKeys.viewingPrivateKey,
|
|
281
|
+
this.stealthKeys.metaAddress.spendingKey,
|
|
282
282
|
)
|
|
283
283
|
|
|
284
284
|
results.push({
|
|
@@ -358,23 +358,23 @@ export class PrivacySolanaWalletAdapter extends SolanaWalletAdapter {
|
|
|
358
358
|
// Compute stealth address from ephemeral key
|
|
359
359
|
const ephemeralPubBytes = hexToBytes(ephemeralPublicKey.slice(2))
|
|
360
360
|
|
|
361
|
-
// Compute shared secret: S =
|
|
362
|
-
const
|
|
363
|
-
hexToBytes(this.stealthKeys.
|
|
361
|
+
// Compute shared secret: S = viewing_scalar * R (canonical EIP-5564)
|
|
362
|
+
const viewingScalar = getEd25519ScalarFromPrivate(
|
|
363
|
+
hexToBytes(this.stealthKeys.viewingPrivateKey.slice(2))
|
|
364
364
|
)
|
|
365
365
|
|
|
366
366
|
const ephemeralPoint = ed25519.ExtendedPoint.fromHex(ephemeralPubBytes)
|
|
367
|
-
const sharedSecretPoint = ephemeralPoint.multiply(
|
|
367
|
+
const sharedSecretPoint = ephemeralPoint.multiply(viewingScalar)
|
|
368
368
|
const sharedSecretHash = sha256(sharedSecretPoint.toRawBytes())
|
|
369
369
|
|
|
370
|
-
// Derive stealth public key: P_stealth =
|
|
370
|
+
// Derive stealth public key: P_stealth = P_spend + hash(S)*G
|
|
371
371
|
const hashScalar = bytesToBigInt(sharedSecretHash) % ED25519_ORDER
|
|
372
372
|
const hashTimesG = ed25519.ExtendedPoint.BASE.multiply(hashScalar)
|
|
373
373
|
|
|
374
|
-
const
|
|
375
|
-
hexToBytes(this.stealthKeys.metaAddress.
|
|
374
|
+
const spendingPoint = ed25519.ExtendedPoint.fromHex(
|
|
375
|
+
hexToBytes(this.stealthKeys.metaAddress.spendingKey.slice(2))
|
|
376
376
|
)
|
|
377
|
-
const stealthPoint =
|
|
377
|
+
const stealthPoint = spendingPoint.add(hashTimesG)
|
|
378
378
|
const stealthAddressHex = `0x${bytesToHex(stealthPoint.toRawBytes())}` as HexString
|
|
379
379
|
|
|
380
380
|
// Create StealthAddress for derivation
|