You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Allow state wallet to sign state while user wallet sends transaction #78
The SDK does not support the common state channel pattern where:
state wallet signs the off-chain state (e.g., channel creation)
user wallet sends the on-chain transaction (pays gas)
Currently, createChannel does not expose a way to separate these roles. This leads to contract signature errors or prevents best-practice separation of keys.
Example (Desired Usage)
constclient=newNitroliteClient({
publicClient,
walletClient,// p1: user wallet (sends tx)
stateWalletClient,// p2: state wallet (signs state)
chainId,
addresses,});awaitclient.createChannel({initialAllocationAmounts: [BigInt(100),BigInt(0)],stateData: "0x",});// Expectation: p2 signs the state, p1 sends the transaction
Expected
SDK should always use stateWalletClient for state signing (if provided), and walletClient for sending transactions.
Why
This is standard in state channel protocols
Needed for security and protocol compliance
Suggestion
Update SDK to support this pattern and document it with an example.
Activity
cqlyj commentedon May 21, 2025
Btw I find that the interface for
createChannelparams are different in docs and this sdk:In the docs it's like:
However in the current sdk, the interface is still:
Perhaps some updates are required here.
akushniruk commentedon May 22, 2025
@cqlyj Thank you for your finding
Yes, you're right about
stateWalletClient. And about documentation, we will update it soon.