Dispatch Transactions
Broadcasting transactions requires slightly more effort, due to the signing process. In SignumJS all transactions are signed locally, that is no secret is ever sent over the wire.
To sign the transaction you need the private signing key, which can be obtained by the generateMasterKeys function. All functions that requires signing in SignumJS can work in two modes:
- Automatic Signing
- Manual Signing
For the most common cases, the developer has somehow access to a private key, may it by asking the user for his passphrase, and/or having the necessary keys securely stored somewhere, for example as environment variable on the server, or in an encrypted form on the clients browser.
Everytime the signPrivateKey is provided, SignumJS automatically uses the key, signs and broadcasts the transaction.
In contrast to Automatic Signing, it is also possible to sign and broadcast a transaction manually. Actually, this is most commonly used in conjunction with the XT Wallet. The XT Wallet securely manages the keys of an user and thus the wallet can be used as "Signer". This way, the developer does not take care of securing an users keys (which can be an annoying and also risky task), and simply sends the unsigned transaction bytes to the wallet.
It is not possible to request unsigned bytes on one node and use another node for broadcasting.