@sip-protocol/sdk 0.6.17 → 0.6.18

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/dist/browser.js CHANGED
@@ -5434,9 +5434,9 @@ async function createShieldedIntent(params, options) {
5434
5434
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
5435
5435
  return (0, import_utils6.hexToBytes)(cleanHex);
5436
5436
  };
5437
- const effectiveOwnershipSig = ownershipSignature ?? new Uint8Array(64);
5438
- const effectiveSenderSecret = senderSecret ?? new Uint8Array(32);
5439
- const effectiveAuthSig = authorizationSignature ?? new Uint8Array(64);
5437
+ const effectiveOwnershipSig = ownershipSignature ?? (0, import_utils6.randomBytes)(64);
5438
+ const effectiveSenderSecret = senderSecret ?? (0, import_utils6.randomBytes)(32);
5439
+ const effectiveAuthSig = authorizationSignature ?? (0, import_utils6.randomBytes)(64);
5440
5440
  const fundingResult = await proofProvider.generateFundingProof({
5441
5441
  balance: input.amount,
5442
5442
  minimumRequired: input.amount,
@@ -5453,8 +5453,7 @@ async function createShieldedIntent(params, options) {
5453
5453
  senderBlinding: hexToUint8(senderCommitment.blindingFactor),
5454
5454
  senderSecret: effectiveSenderSecret,
5455
5455
  authorizationSignature: effectiveAuthSig,
5456
- nonce: new Uint8Array(32),
5457
- // Could use randomBytes here
5456
+ nonce: (0, import_utils6.randomBytes)(32),
5458
5457
  timestamp: now,
5459
5458
  expiry: now + ttl
5460
5459
  });
package/dist/browser.mjs CHANGED
@@ -263,7 +263,7 @@ import {
263
263
  walletRegistry,
264
264
  withSecureBuffer,
265
265
  withSecureBufferSync
266
- } from "./chunk-O33JCQFJ.mjs";
266
+ } from "./chunk-NM5PTCQ5.mjs";
267
267
  import {
268
268
  fulfillment_proof_default,
269
269
  funding_proof_default,
@@ -1303,7 +1303,7 @@ function generateRandomBytes(length) {
1303
1303
  }
1304
1304
 
1305
1305
  // src/intent.ts
1306
- import { hexToBytes as hexToBytes4, bytesToHex as bytesToHex5 } from "@noble/hashes/utils";
1306
+ import { hexToBytes as hexToBytes4, bytesToHex as bytesToHex5, randomBytes as randomBytes6 } from "@noble/hashes/utils";
1307
1307
  import { sha256 as sha2565 } from "@noble/hashes/sha256";
1308
1308
 
1309
1309
  // src/privacy.ts
@@ -1777,9 +1777,9 @@ async function createShieldedIntent(params, options) {
1777
1777
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
1778
1778
  return hexToBytes4(cleanHex);
1779
1779
  };
1780
- const effectiveOwnershipSig = ownershipSignature ?? new Uint8Array(64);
1781
- const effectiveSenderSecret = senderSecret ?? new Uint8Array(32);
1782
- const effectiveAuthSig = authorizationSignature ?? new Uint8Array(64);
1780
+ const effectiveOwnershipSig = ownershipSignature ?? randomBytes6(64);
1781
+ const effectiveSenderSecret = senderSecret ?? randomBytes6(32);
1782
+ const effectiveAuthSig = authorizationSignature ?? randomBytes6(64);
1783
1783
  const fundingResult = await proofProvider.generateFundingProof({
1784
1784
  balance: input.amount,
1785
1785
  minimumRequired: input.amount,
@@ -1796,8 +1796,7 @@ async function createShieldedIntent(params, options) {
1796
1796
  senderBlinding: hexToUint8(senderCommitment.blindingFactor),
1797
1797
  senderSecret: effectiveSenderSecret,
1798
1798
  authorizationSignature: effectiveAuthSig,
1799
- nonce: new Uint8Array(32),
1800
- // Could use randomBytes here
1799
+ nonce: randomBytes6(32),
1801
1800
  timestamp: now,
1802
1801
  expiry: now + ttl
1803
1802
  });
@@ -3598,7 +3597,7 @@ import { sha256 as sha2567 } from "@noble/hashes/sha256";
3598
3597
 
3599
3598
  // src/proofs/mock.ts
3600
3599
  import { sha256 as sha2568 } from "@noble/hashes/sha256";
3601
- import { bytesToHex as bytesToHex10, randomBytes as randomBytes6 } from "@noble/hashes/utils";
3600
+ import { bytesToHex as bytesToHex10, randomBytes as randomBytes7 } from "@noble/hashes/utils";
3602
3601
  var MOCK_PROOF_PREFIX = "0x4d4f434b";
3603
3602
  var WARNING_MESSAGE = `
3604
3603
  \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
@@ -3764,7 +3763,7 @@ var MockProofProvider = class {
3764
3763
  (_, v) => typeof v === "bigint" ? v.toString() : v
3765
3764
  );
3766
3765
  const hash2 = sha2568(new TextEncoder().encode(input));
3767
- const random = randomBytes6(16);
3766
+ const random = randomBytes7(16);
3768
3767
  const combined = new Uint8Array(4 + hash2.length + random.length);
3769
3768
  combined.set(new TextEncoder().encode("MOCK"), 0);
3770
3769
  combined.set(hash2, 4);
@@ -4393,7 +4392,7 @@ import { ReportStatus as ReportStatus2 } from "@sip-protocol/types";
4393
4392
  import {
4394
4393
  IntentStatus as IntentStatus3
4395
4394
  } from "@sip-protocol/types";
4396
- import { bytesToHex as bytesToHex14, randomBytes as randomBytes7 } from "@noble/hashes/utils";
4395
+ import { bytesToHex as bytesToHex14, randomBytes as randomBytes8 } from "@noble/hashes/utils";
4397
4396
  var MockSolver = class {
4398
4397
  info;
4399
4398
  capabilities;
@@ -4475,7 +4474,7 @@ var MockSolver = class {
4475
4474
  const spreadAmount = baseOutput * BigInt(Math.floor(this.spreadPercent * 1e4)) / 10000n;
4476
4475
  const outputAmount = baseOutput + spreadAmount;
4477
4476
  const feeAmount = outputAmount * BigInt(Math.floor(this.feePercent * 1e4)) / 10000n;
4478
- const quoteId = `quote-${bytesToHex14(randomBytes7(8))}`;
4477
+ const quoteId = `quote-${bytesToHex14(randomBytes8(8))}`;
4479
4478
  const now = Math.floor(Date.now() / 1e3);
4480
4479
  const quote = {
4481
4480
  quoteId,
@@ -4486,7 +4485,7 @@ var MockSolver = class {
4486
4485
  expiry: now + 60,
4487
4486
  // Quote valid for 1 minute
4488
4487
  fee: feeAmount,
4489
- signature: `0x${bytesToHex14(randomBytes7(64))}`,
4488
+ signature: `0x${bytesToHex14(randomBytes8(64))}`,
4490
4489
  // Mock signature
4491
4490
  validUntil: now + 60,
4492
4491
  estimatedGas: 200000n
@@ -4523,7 +4522,7 @@ var MockSolver = class {
4523
4522
  error: status.error
4524
4523
  };
4525
4524
  }
4526
- const txHash = `0x${bytesToHex14(randomBytes7(32))}`;
4525
+ const txHash = `0x${bytesToHex14(randomBytes8(32))}`;
4527
4526
  status.status = "completed";
4528
4527
  status.txHash = txHash;
4529
4528
  return {
@@ -4533,7 +4532,7 @@ var MockSolver = class {
4533
4532
  txHash: intent.privacyLevel === "transparent" ? txHash : void 0,
4534
4533
  fulfillmentProof: {
4535
4534
  type: "fulfillment",
4536
- proof: `0x${bytesToHex14(randomBytes7(128))}`,
4535
+ proof: `0x${bytesToHex14(randomBytes8(128))}`,
4537
4536
  publicInputs: [
4538
4537
  `0x${bytesToHex14(new TextEncoder().encode(intent.intentId))}`,
4539
4538
  `0x${bytesToHex14(new TextEncoder().encode(quote.quoteId))}`
@@ -5688,7 +5687,7 @@ function createZcashNativeBackend(config) {
5688
5687
 
5689
5688
  // src/settlement/backends/direct-chain.ts
5690
5689
  import { PrivacyLevel as PrivacyLevel5 } from "@sip-protocol/types";
5691
- import { randomBytes as randomBytes8, bytesToHex as bytesToHex15 } from "@noble/hashes/utils";
5690
+ import { randomBytes as randomBytes9, bytesToHex as bytesToHex15 } from "@noble/hashes/utils";
5692
5691
  var DEFAULT_GAS_FEES = {
5693
5692
  ethereum: 21000n * 50n * 1000000000n,
5694
5693
  // 21k gas * 50 gwei = 0.00105 ETH
@@ -7309,7 +7308,7 @@ import {
7309
7308
  PaymentStatus
7310
7309
  } from "@sip-protocol/types";
7311
7310
  import { sha256 as sha25613 } from "@noble/hashes/sha256";
7312
- import { bytesToHex as bytesToHex18, hexToBytes as hexToBytes14, randomBytes as randomBytes9 } from "@noble/hashes/utils";
7311
+ import { bytesToHex as bytesToHex18, hexToBytes as hexToBytes14, randomBytes as randomBytes10 } from "@noble/hashes/utils";
7313
7312
  import { xchacha20poly1305 as xchacha20poly13052 } from "@noble/ciphers/chacha.js";
7314
7313
  import { hkdf as hkdf2 } from "@noble/hashes/hkdf";
7315
7314
 
@@ -7876,7 +7875,7 @@ function encryptMemo(memo, viewingKey) {
7876
7875
  const keyBytes = hexToBytes14(keyHex);
7877
7876
  const encKey = hkdf2(sha25613, keyBytes, new Uint8Array(0), new Uint8Array(0), 32);
7878
7877
  try {
7879
- const nonce = randomBytes9(24);
7878
+ const nonce = randomBytes10(24);
7880
7879
  const cipher = xchacha20poly13052(encKey, nonce);
7881
7880
  const plaintext = new TextEncoder().encode(memo);
7882
7881
  const ciphertext = cipher.encrypt(plaintext);
@@ -7948,7 +7947,7 @@ import {
7948
7947
  } from "@sip-protocol/types";
7949
7948
  import { secp256k1 as secp256k16 } from "@noble/curves/secp256k1";
7950
7949
  import { sha256 as sha25614 } from "@noble/hashes/sha256";
7951
- import { bytesToHex as bytesToHex19, hexToBytes as hexToBytes15, randomBytes as randomBytes10 } from "@noble/hashes/utils";
7950
+ import { bytesToHex as bytesToHex19, hexToBytes as hexToBytes15, randomBytes as randomBytes11 } from "@noble/hashes/utils";
7952
7951
  var DEFAULT_PROPOSAL_TTL = 7 * 24 * 60 * 60;
7953
7952
  var Treasury = class _Treasury {
7954
7953
  config;
@@ -8439,11 +8438,11 @@ var Treasury = class _Treasury {
8439
8438
  }
8440
8439
  };
8441
8440
  function generateTreasuryId() {
8442
- const bytes = randomBytes10(16);
8441
+ const bytes = randomBytes11(16);
8443
8442
  return `treasury_${bytesToHex19(bytes)}`;
8444
8443
  }
8445
8444
  function generateProposalId() {
8446
- const bytes = randomBytes10(16);
8445
+ const bytes = randomBytes11(16);
8447
8446
  return `prop_${bytesToHex19(bytes)}`;
8448
8447
  }
8449
8448
  function computeProposalHash(proposal) {
@@ -8634,7 +8633,7 @@ function validateBatchProposalParams(params, config) {
8634
8633
  import {
8635
8634
  ReportStatus
8636
8635
  } from "@sip-protocol/types";
8637
- import { bytesToHex as bytesToHex20, randomBytes as randomBytes11 } from "@noble/hashes/utils";
8636
+ import { bytesToHex as bytesToHex20, randomBytes as randomBytes12 } from "@noble/hashes/utils";
8638
8637
  var DEFAULTS2 = {
8639
8638
  riskThreshold: 70,
8640
8639
  highValueThreshold: 10000000000n,
@@ -9381,7 +9380,7 @@ var ComplianceManager = class _ComplianceManager {
9381
9380
  }
9382
9381
  };
9383
9382
  function generateId(prefix) {
9384
- return `${prefix}_${bytesToHex20(randomBytes11(12))}`;
9383
+ return `${prefix}_${bytesToHex20(randomBytes12(12))}`;
9385
9384
  }
9386
9385
  function validateRegisterAuditorParams(params) {
9387
9386
  if (!params.organization?.trim()) {
@@ -10158,7 +10157,7 @@ var ComplianceReporter = class {
10158
10157
 
10159
10158
  // src/compliance/conditional.ts
10160
10159
  import { sha256 as sha25616 } from "@noble/hashes/sha256";
10161
- import { bytesToHex as bytesToHex22, hexToBytes as hexToBytes17, randomBytes as randomBytes12 } from "@noble/hashes/utils";
10160
+ import { bytesToHex as bytesToHex22, hexToBytes as hexToBytes17, randomBytes as randomBytes13 } from "@noble/hashes/utils";
10162
10161
  import { xchacha20poly1305 as xchacha20poly13053 } from "@noble/ciphers/chacha.js";
10163
10162
  var ConditionalDisclosure = class {
10164
10163
  /**
@@ -10224,7 +10223,7 @@ var ConditionalDisclosure = class {
10224
10223
  params.commitment,
10225
10224
  revealAfterSeconds
10226
10225
  );
10227
- const nonce = randomBytes12(24);
10226
+ const nonce = randomBytes13(24);
10228
10227
  const viewingKeyBytes = hexToBytes17(params.viewingKey.slice(2));
10229
10228
  const cipher = xchacha20poly13053(encryptionKey, nonce);
10230
10229
  const encryptedKey = cipher.encrypt(viewingKeyBytes);
@@ -10411,7 +10410,7 @@ var CURVE_ORDER2 = secp256k17.CURVE.n;
10411
10410
 
10412
10411
  // src/compliance/threshold.ts
10413
10412
  import { sha256 as sha25618 } from "@noble/hashes/sha256";
10414
- import { bytesToHex as bytesToHex24, hexToBytes as hexToBytes19, randomBytes as randomBytes13 } from "@noble/hashes/utils";
10413
+ import { bytesToHex as bytesToHex24, hexToBytes as hexToBytes19, randomBytes as randomBytes14 } from "@noble/hashes/utils";
10415
10414
  var FIELD_PRIME = 2n ** 256n - 189n;
10416
10415
  var ThresholdViewingKey = class {
10417
10416
  /**
@@ -10628,7 +10627,7 @@ var ThresholdViewingKey = class {
10628
10627
  * Generate a random field element
10629
10628
  */
10630
10629
  static randomFieldElement() {
10631
- const bytes = randomBytes13(32);
10630
+ const bytes = randomBytes14(32);
10632
10631
  let value = 0n;
10633
10632
  for (let i = 0; i < bytes.length; i++) {
10634
10633
  value = value << 8n | BigInt(bytes[i]);
@@ -11099,7 +11098,7 @@ var AuditorKeyDerivation = class {
11099
11098
  };
11100
11099
 
11101
11100
  // src/auction/sealed-bid.ts
11102
- import { randomBytes as randomBytes14, bytesToHex as bytesToHex26 } from "@noble/hashes/utils";
11101
+ import { randomBytes as randomBytes15, bytesToHex as bytesToHex26 } from "@noble/hashes/utils";
11103
11102
  var SealedBidAuction = class {
11104
11103
  /**
11105
11104
  * Create a sealed bid for an auction
@@ -11176,7 +11175,7 @@ var SealedBidAuction = class {
11176
11175
  );
11177
11176
  }
11178
11177
  }
11179
- const salt = params.salt ?? randomBytes14(32);
11178
+ const salt = params.salt ?? randomBytes15(32);
11180
11179
  const { commitment, blinding } = commit(params.amount, salt);
11181
11180
  const sealedBid = {
11182
11181
  auctionId: params.auctionId,
@@ -11807,7 +11806,7 @@ function createSealedBidAuction() {
11807
11806
  // src/governance/private-vote.ts
11808
11807
  import { sha256 as sha25620 } from "@noble/hashes/sha256";
11809
11808
  import { hkdf as hkdf3 } from "@noble/hashes/hkdf";
11810
- import { bytesToHex as bytesToHex27, hexToBytes as hexToBytes21, randomBytes as randomBytes15, utf8ToBytes as utf8ToBytes5 } from "@noble/hashes/utils";
11809
+ import { bytesToHex as bytesToHex27, hexToBytes as hexToBytes21, randomBytes as randomBytes16, utf8ToBytes as utf8ToBytes5 } from "@noble/hashes/utils";
11811
11810
  import { xchacha20poly1305 as xchacha20poly13054 } from "@noble/ciphers/chacha.js";
11812
11811
  var VOTE_ENCRYPTION_DOMAIN = "SIP-PRIVATE-VOTE-ENCRYPTION-V1";
11813
11812
  var NONCE_SIZE2 = 24;
@@ -11844,7 +11843,7 @@ var PrivateVoting = class {
11844
11843
  const { proposalId, choice, weight, encryptionKey, voter = "anonymous" } = params;
11845
11844
  const derivedKey = this.deriveEncryptionKey(encryptionKey, proposalId);
11846
11845
  try {
11847
- const nonce = randomBytes15(NONCE_SIZE2);
11846
+ const nonce = randomBytes16(NONCE_SIZE2);
11848
11847
  const voteData = {
11849
11848
  proposalId,
11850
11849
  choice,
@@ -12161,7 +12160,7 @@ var PrivateVoting = class {
12161
12160
  }
12162
12161
  const encryptedBlindings = {};
12163
12162
  for (const [choice, blinding] of Object.entries(blindings)) {
12164
- const nonce = randomBytes15(NONCE_SIZE2);
12163
+ const nonce = randomBytes16(NONCE_SIZE2);
12165
12164
  const derivedKey = this.deriveEncryptionKey(decryptionKey, `${proposalId}-tally-${choice}`);
12166
12165
  try {
12167
12166
  const cipher = xchacha20poly13054(derivedKey, nonce);
@@ -16280,7 +16279,7 @@ function createTrezorAdapter(config) {
16280
16279
 
16281
16280
  // src/wallet/hardware/mock.ts
16282
16281
  import { WalletErrorCode as WalletErrorCode17 } from "@sip-protocol/types";
16283
- import { bytesToHex as bytesToHex29, randomBytes as randomBytes16 } from "@noble/hashes/utils";
16282
+ import { bytesToHex as bytesToHex29, randomBytes as randomBytes17 } from "@noble/hashes/utils";
16284
16283
  var MockLedgerAdapter = class extends BaseWalletAdapter {
16285
16284
  chain;
16286
16285
  name = "mock-ledger";
@@ -16525,12 +16524,12 @@ var MockLedgerAdapter = class extends BaseWalletAdapter {
16525
16524
  }
16526
16525
  }
16527
16526
  generateMockAddress(index) {
16528
- const bytes = randomBytes16(20);
16527
+ const bytes = randomBytes17(20);
16529
16528
  bytes[0] = index;
16530
16529
  return `0x${bytesToHex29(bytes)}`;
16531
16530
  }
16532
16531
  generateMockPublicKey(index) {
16533
- const bytes = randomBytes16(33);
16532
+ const bytes = randomBytes17(33);
16534
16533
  bytes[0] = 2;
16535
16534
  bytes[1] = index;
16536
16535
  return `0x${bytesToHex29(bytes)}`;
@@ -16731,12 +16730,12 @@ var MockTrezorAdapter = class extends BaseWalletAdapter {
16731
16730
  }
16732
16731
  }
16733
16732
  generateMockAddress(index) {
16734
- const bytes = randomBytes16(20);
16733
+ const bytes = randomBytes17(20);
16735
16734
  bytes[0] = index + 100;
16736
16735
  return `0x${bytesToHex29(bytes)}`;
16737
16736
  }
16738
16737
  generateMockPublicKey(index) {
16739
- const bytes = randomBytes16(33);
16738
+ const bytes = randomBytes17(33);
16740
16739
  bytes[0] = 3;
16741
16740
  bytes[1] = index + 100;
16742
16741
  return `0x${bytesToHex29(bytes)}`;
package/dist/index.js CHANGED
@@ -5421,9 +5421,9 @@ async function createShieldedIntent(params, options) {
5421
5421
  const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
5422
5422
  return (0, import_utils6.hexToBytes)(cleanHex);
5423
5423
  };
5424
- const effectiveOwnershipSig = ownershipSignature ?? new Uint8Array(64);
5425
- const effectiveSenderSecret = senderSecret ?? new Uint8Array(32);
5426
- const effectiveAuthSig = authorizationSignature ?? new Uint8Array(64);
5424
+ const effectiveOwnershipSig = ownershipSignature ?? (0, import_utils6.randomBytes)(64);
5425
+ const effectiveSenderSecret = senderSecret ?? (0, import_utils6.randomBytes)(32);
5426
+ const effectiveAuthSig = authorizationSignature ?? (0, import_utils6.randomBytes)(64);
5427
5427
  const fundingResult = await proofProvider.generateFundingProof({
5428
5428
  balance: input.amount,
5429
5429
  minimumRequired: input.amount,
@@ -5440,8 +5440,7 @@ async function createShieldedIntent(params, options) {
5440
5440
  senderBlinding: hexToUint8(senderCommitment.blindingFactor),
5441
5441
  senderSecret: effectiveSenderSecret,
5442
5442
  authorizationSignature: effectiveAuthSig,
5443
- nonce: new Uint8Array(32),
5444
- // Could use randomBytes here
5443
+ nonce: (0, import_utils6.randomBytes)(32),
5445
5444
  timestamp: now,
5446
5445
  expiry: now + ttl
5447
5446
  });
package/dist/index.mjs CHANGED
@@ -253,7 +253,7 @@ import {
253
253
  walletRegistry,
254
254
  withSecureBuffer,
255
255
  withSecureBufferSync
256
- } from "./chunk-O33JCQFJ.mjs";
256
+ } from "./chunk-NM5PTCQ5.mjs";
257
257
  import {
258
258
  CryptoError,
259
259
  EncryptionNotImplementedError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sip-protocol/sdk",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
4
4
  "description": "Core SDK for Shielded Intents Protocol - Privacy layer for cross-chain transactions",
5
5
  "author": "SIP Protocol <hello@sip-protocol.org>",
6
6
  "homepage": "https://sip-protocol.org",
package/src/intent.ts CHANGED
@@ -31,7 +31,7 @@ import {
31
31
  generateIntentId,
32
32
  hash,
33
33
  } from './crypto'
34
- import { hexToBytes, bytesToHex } from '@noble/hashes/utils'
34
+ import { hexToBytes, bytesToHex, randomBytes } from '@noble/hashes/utils'
35
35
  import { sha256 } from '@noble/hashes/sha256'
36
36
  import { getPrivacyConfig, generateViewingKey } from './privacy'
37
37
  import type { ProofProvider } from './proofs'
@@ -556,9 +556,11 @@ export async function createShieldedIntent(
556
556
  }
557
557
 
558
558
  // Use provided signatures or placeholders (if allowed)
559
- const effectiveOwnershipSig = ownershipSignature ?? new Uint8Array(64)
560
- const effectiveSenderSecret = senderSecret ?? new Uint8Array(32)
561
- const effectiveAuthSig = authorizationSignature ?? new Uint8Array(64)
559
+ // IMPORTANT: senderSecret must be random even for placeholders, as secp256k1
560
+ // rejects all-zero private keys. randomBytes generates cryptographically secure random values.
561
+ const effectiveOwnershipSig = ownershipSignature ?? randomBytes(64)
562
+ const effectiveSenderSecret = senderSecret ?? randomBytes(32)
563
+ const effectiveAuthSig = authorizationSignature ?? randomBytes(64)
562
564
 
563
565
  // Generate funding proof
564
566
  // Note: The funding proof proves balance >= minimumRequired
@@ -583,7 +585,7 @@ export async function createShieldedIntent(
583
585
  senderBlinding: hexToUint8(senderCommitment.blindingFactor as HexString),
584
586
  senderSecret: effectiveSenderSecret,
585
587
  authorizationSignature: effectiveAuthSig,
586
- nonce: new Uint8Array(32), // Could use randomBytes here
588
+ nonce: randomBytes(32),
587
589
  timestamp: now,
588
590
  expiry: now + ttl,
589
591
  })