Skip to content

add support for wizardconnect to "generateWcTransactionObject" #401

Closed as not planned

Description

@mr-zwets

add support for wizardconnect to "generateWcTransactionObject"

wizardconnect supports HD wallets so user inputs can come from multiple addresses and hence the UTXO info needs to be mapped to the corresponding address

Activity

  1. added this to the v0.13.0 milestone on Apr 21, 2026
  2. modified the milestones: v0.13.0, v0.13.1 on May 12, 2026
  3. mr-zwets commented on Jun 2, 2026

    @mr-zwets
    MemberAuthor

    we could do something like this where we optionally extend placeholderP2PKHUnlocker(address, options?)

    we'd then add hdPath info to the user inputs and add a generateWizardConnectTransactionObject method to the transaction builder

    const userUnlocker = placeholderP2PKHUnlocker({
      address: userAddress,
      hdPath: {
        name: "receive",
        addressIndex: 5,
      },
    });
    
    const transactionBuilder = new TransactionBuilder({ provider })
      .addInput(contractUtxo, contract.unlock.spend(...))
      .addInput(userUtxo, userUnlocker)
      .addOutput(output);
    
    const signRequest = transactionBuilder.generateWizardConnectTransactionObject({
      userPrompt: "Confirm transaction",
      broadcast: false,
    });
    
    await wizardConnect.signTransaction(signRequest);

    implemented in #408

  4. rkalis commented on Jun 4, 2026

    @rkalis
    Member

    We tried to implement WizardConnect into the SDK directly. Since the only difference with WalletConnect is that there's an extra list of inputPaths, which documents the HD path of the address that is expected to sign the input, we added optional HD path information to the existing PlaceholderP2PKHUnlocker.

    However, then we ran into the issue that you might also need to sign placeholder signatures in contract inputs (e.g. withdrawing from a Cauldron pool), in which case you would also need to add the HD path information to "regular" contract inputs. This becomes a bit too complicated for a very light abstraction.

    Since a WizardConnect-integrated dapp would be expected to already provide the HD information to the SDK, it might as well provide the entire inputPaths directly. An extra WizardConnect abstraction on the CashScript SDK side is therefore not something we'll add.

    Instead they can use the existing WalletConnect utils to generate the main WC transaction object, and they can manually add the inputPaths to it. We'll update the docs for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    javascript-sdkRelates to the CashScript JavaScript SDK

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions