node-red-contrib-smartcontracttx 1.1.6

Allows to run transactions on Ethereum based blockchains from within Node RED

npm install node-red-contrib-smartcontracttx

Allows to run transactions on Ethereum based blockchains from within Node RED

Call methods or run transactions using rpcUrl and ABI of existing contract. Allows OffChain DID/VP signing and verification.

npm npm CO2OffsetCode QualityCircleCIFOSSA Status


Install using Node-RED Package Manager (Palett).

Input - msg.payload

OnChain - Transaction/Retrieve

In order to call a method of a SmartContract specify a JSON in msg.payload containing the method name as method and all required arguments in an array as args.


OffChain - Present

To present a set of information (Object) signed to another party DID-VPs are used. In this case msg.payload must contain presentTo with the recipients publicKey (not address - see here ) and presentation with the Data to crypt and sign.

    'TimeStamp': 1641166171599

If presentTo is not specified the presentation itself will just be signed and not encrypted.

Injection of unsecure values

If configuration option Allow Insecure Inject is set additional values might be specified in input msg.payload and will overwrite configured values:

  "abi": [...],
  "rpcUrl": "",

In case no privateKey is specified in either input msg.payload or configuration, a new privateKey gets generated.

Output - msg.payload

For background compatibility all results are returned on Output[0]

Output[1] - OnChain Output. Returns results from method calls or transactions.

Output[2] - OffChain Output (JWT). Encrypted DID to be forwarded to other recipient.

Output[3] - OffChain Output. Presentations received and decoded.

Cloudwallet support

Implementation allows to use CloudWallet to persist received presentations/credentials or digital IDs via

Usage as Module (no Node-RED)

You might use this module without having Node-RED available. However this requires to emulate some of the stuff Node-RED typically provides.


npm i --save node-red-contrib-smartcontracttx

Hello World (DID)

const SmartContractTX = require("node-red-contrib-smartcontracttx");

const app = async function() {
  const instanceAlice = new SmartContractTX();
  let msgAlice = {
    payload: {
        presentation: {

  // We need to do something with DIDComms (Message Alice wants to send) ...
  instanceAlice.setSender(async function(msgs) {
      // As soon as JWT got generated (Alice wants to send) - we forward to a new Bob
      const instanceBob = new SmartContractTX();
      let msgBob = msgs[2]; // Alice Output is [2] as we want the JWT
      console.log('Message from Alice to Bob',msgBob);
      // If Bob received a message he sends via output[3] to internal processes...
      instanceBob.setSender(async function(msgs) {
          console.log('Bob DID',msgs[3]);
      await instanceBob.input(msgBob);

  // Now we are ready to send Message from Alice
  await instanceAlice.input(msgAlice);


Tutorials / Usecases

Maintainer / Imprint

Gerhard Weiser Ring 29
69256 Mauer

+49 6226 968 009 0

[email protected]

Handelsregister: HRB 728691 (Amtsgericht Mannheim)

Project Website:



Node Info

Version: 1.1.6
Updated 5 months, 3 weeks ago
License: Apache-2.0
Rating: 3.0 2




8 in the last week


  • SmartContract
  • DLTConnection
  • Contract
  • Resolver


  • nodered
  • node-red
  • contrib
  • ethereum
  • blockchain
  • transaction
  • smartcontract