Creating transactions

There are three ways to create and send a travel rule transaction using the SDK:

  1. Basic transaction - Hosted
  2. End-to-end encryption
  3. Hybrid encryption

See here for more information.


Hosted Encryption

Notabene encrypts all raw Travel Rule transaction data created through our easy-to-use restful API without worrying about local key management. Each VASP has a dedicated encryption key managed by Notabene’s PII service and can be rotated on-demand.

const { Notabene } = require("@notabene/nodejs");

const client = new Notabene({
    authURL: 'https://auth.notabene.id',
    baseURL: "https://api.notabene.dev",
    audience: "https://api.notabene.dev",
    clientId: "xxxxxxxxxxxxxxxx",
    clientSecret:"xxxxxxxx-xxxxxxxxx",
    baseURLPII: "https://pii.notabene.dev",
    audiencePII: "https://pii.notabene.dev",
});

const ivms = {
    originator: {
      originatorPersons: [
        {
          naturalPerson: {
            name: [
              {
                nameIdentifier: [
                  {
                    primaryIdentifier: 'Normann',
                    secondaryIdentifier: 'Christoffer'
                  },
                ],
              },
            ],
            geographicAddress: [
              {
                addressLine: ['Oslo street 123, 2001, Oslo'],
                country: 'NO'
              },
            ],
          },
        },
      ],
      accountNumber: ['01234567890'],
    },
  
    beneficiary: {
      beneficiaryPersons: [
        {
          naturalPerson: {
            name: [
              {
                nameIdentifier: [
                  {
                    primaryIdentifier: 'Danskmann',
                    secondaryIdentifier: 'Niels'
                  },
                ],
              },
            ],
          },
        },
      ],
      accountNumber: ['01234567890'],
    },
  };
  
  const payload = {
    transactionAsset: 'BTC',
    transactionAmount: '123456789',
    originatorVASPdid: 'did:ethr:0xd4bd902ec78578f33a20ff601504d2ab324cfab9',
    beneficiaryVASPdid: 'did:ethr:0xb62c155177f40d3ad75d2d19c087fcc69a1be7a0',
    transactionBlockchainInfo: {
      origin: '0x12htre3456337897grt5644e56dtv',
      destination: '0x3215867fff456brt342436423',
    },
    originator: ivms.originator,
    beneficiary: ivms.beneficiary,
  };
    
  const myfunc = async function(){
      const txCreated = await client.transaction.create(payload);
      console.log(txCreated);
    }
    myfunc().catch((err)=>console.error(err));

End-2-End Encrypted

End-to-End Escrow PII brings the most security, as the Originating VASP encrypts PII data so that only they and the Beneficiary VASP can decrypt it:

const { Notabene } = require("@notabene/nodejs");

const client = new Notabene({
    // same as above
});

const ivms = {
    // same as above
  };
  
  const payload = {
  // same as above
  };

const jsonDIDKey = '{"did": "did:key:z6MkjwpTikNZkpfop2ebcbPfsxi786ftTr9nGBD3XKKHZ2S", "keys": [{"privateKeyHex": "0d07d8acda928f98765e4a0b80013e2be369c29564419ac3ba08107599aeb3fc519b59a6b7ebf128f6c6af4081f5e512750e1b4e47f08263dbc656b7b3541c33"}]}';
  
  const myfunc = async function(){
      const txCreated = await client.transaction.create(
        payload,
        jsonDIDKey);
      console.log(txCreated);
    }
    myfunc().catch((err)=>console.error(err));

🚧

Notabene dashboard + E2E

You will not be able to see the details within the Notabene dashboard when using E2E encryption.


Hybrid Encryption

The Hybrid Escrow PII mode extends the End-to-End flow, where the Originator VASP further encrypts the PII data selectively using their dedicated Notabene-managed encryption key, allowing Notabene to decrypt the PII (or parts of the PII data) for in-flow pre-transaction name sanction screening:

const { Notabene } = require("@notabene/nodejs");

const client = new Notabene({
    // same as above
});

const ivms = {
    // same as above
  };
  
  const payload = {
  // same as above
  };

const jsonDIDKey = '{"did": "did:key:z6MkjwpTikNZkpfop2ebcbPfsxi786ftTr9nGBD3XKKHZ2S", "keys": [{"privateKeyHex": "0d07d8acda928f98765e4a0b80013e2be369c29564419ac3ba08107599aeb3fc519b59a6b7ebf128f6c6af4081f5e512750e1b4e47f08263dbc656b7b3541c33"}]}';
  
  const myfunc = async function(){
      const txCreated = await client.transaction.create(payload,jsonDIDKey,true);
      console.log(txCreated);
    }
    myfunc().catch((err)=>console.error(err));

🚧

Notabene dashboard + Hybrid

With this flow, you can decrypt and view the data within the Notabene dashboard.


Getting your JsonDIDKey

For End-2-End and Hybrid encryption, your VASP needs a dedicated DIDKey which is a public-private keypair. You can create a new keypair using the @notabene/cli and then publish it to the Notabene directory under the pii_didkey field. This allows other VASPs retrieve your public key and encrypt PII data to you.

Please see the guide here.