1

I need to prepare in advance, for a month, a 100 of TXs signed in offline, for SOL and USDT, USDC.

In the documentation - offline transactions - it's described how to sign them via the cli utilities which isn't what I need to. How would I do this via the Solana SDK/web3?

And how would I then send or broadcast them when I need to? For in the SDK there's a method signAndBroadcast(...), whereas in the case of offline signing, for broadcasting there'll have to be used a separate method, right?

1 Answer 1

1

You'll definitely need to use nonce accounts to sign and eventually send these transactions.

If you want to send these all at once, you'll need to create 100 nonce accounts, sign each transaction with the blockhash stored in the nonce account, serialize / store the signed transactions somewhere, and then send them with sendRawTransaction https://github.com/solana-labs/solana-web3.js/blob/fbd397436f622a9b87a7251c08bd9664599299ee/packages/library-legacy/src/connection.ts#L5876

Here's an example from the tests about how to create a transaction with nonceInfo: https://github.com/solana-labs/solana-web3.js/blob/fbd397436f622a9b87a7251c08bd9664599299ee/packages/library-legacy/test/program-tests/system.test.ts#L387-L411

2
  • Ok. nonce is an argument of a TX. What's nonce account? Commented Nov 6, 2023 at 19:29
  • A nonce account is a separate system account that mainly contains a hash that you use to sign against. You can read more about them at docs.solana.com/offline-signing/durable-nonce
    – Jon C
    Commented Nov 6, 2023 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.