Swisstronik Docs
  • πŸ‡¨πŸ‡­About Swisstronik
    • What is Swisstronik?
    • Swisstronik vs Ethereum
    • Useful links
  • 🌐General
    • Intel SGX
    • Governance
      • On-Chain Proposal
      • Formatting a Proposal
      • Submitting a Proposal
      • Governable Parameters
    • Community Pool
    • Accounts
    • Transactions
    • Gas and Fees
    • Coin & Tokens
  • βš’οΈDevelopment
    • Endpoints
    • Connect wallets
      • MetaMask (EVM) - Manual
      • Keplr (Cosmos)
      • Testnet Metamask (EVM) - Chainlist
      • Testnet MetaMask (EVM) - Manual
      • Testnet Keplr (Cosmos)
    • Get test coins
    • SwisstronikJS SDK
      • SwisstronikJS Functions
      • Swisstronik & Ethereum transactions
      • Transaction - code sample
      • Swisstronik & Ethereum calls
      • Call - code sample
    • Swisstronik CLI
      • Installation
      • Configuration
      • Key management
      • Queries
      • Sending SWTR
      • For SDI Issuers
    • Guides
      • Contract deployment - Hardhat
        • 1. Setting up the Hardhat environment
        • 2. Configure hardhat.config.js
        • 3. Write and compile the smart contract
        • 4. Deploy the smart contract
        • 5. Interact with the contract - Transaction
        • 6. Interact with the contract - Call
      • Contract deployment - Remix IDE
      • Deployment & Interaction PERC-20
        • ERC-20 & PERC-20
        • Sample PERC20 contract
        • Deployment & Interaction with contract
        • How to use encryption
      • Contract verification
      • SDI for dapp developers
    • Local testnet
    • Web3JS, Ethers, Viem and other third-party libraries
  • πŸ–₯️Node setup
    • Setup SGX
      • Supported Hardware
      • Setup Intel SGX
    • Setup node
      • Mainnet
        • v1.0.1 Upgrade
      • Testnet
        • Install from .deb package
        • Configure node
        • Upgrade your testnet node
          • Swisstronik v3 Testnet
          • Swisstronik v4 Testnet
          • Swisstronik v5 Testnet
          • Swisstronik v5.1 Testnet
          • Swisstronik v6 Testnet
          • Swisstronik v7 Testnet
          • Swisstronik v8 Testnet
        • Seed Node
        • Live Peers
        • Genesis Mirror Download
    • CLI Cheatsheet
  • 🀝Delegators
    • What is a delegator?
    • Delegator Guide (CLI)
    • Delegators Security
Powered by GitBook
On this page
  • Ethereum Transactions
  • Swisstronik Transactions
  1. Development
  2. SwisstronikJS SDK

Swisstronik & Ethereum transactions

PreviousSwisstronikJS FunctionsNextTransaction - code sample

Last updated 10 months ago

Ethereum Transactions

When sending transactions in the Ethereum blockchain, there are several fields you need to fill out such as from, to, value, nonce, data, etc... so the nodes can process and validate your transactions before adding them to the blockchain.

signer.sendTransaction({
    from: //Address of the sender,
    to: //Address of the recipient,
    data: //Data to include in the transaction
    value: //Amount of Ether to send,
  });

Swisstronik Transactions

Sending transactions in the Swisstronik blockchain is similar to Ethereum, with one crucial distinction: when the data field is not empty, the value of the data field must be encrypted. This encryption step is vital for maintaining confidentiality. By sending encrypted values to the nodes, we ensure that only the nodes can decrypt the data within the , ensuring the secure validation of your transaction.

The data field is empty only when sending value between accounts (e.g., sending 1 SWTR from Alice to Bob). For transactions of this type, there is no need for any encryption.

signer.sendTransaction({
    from: //Address of the sender,
    to: //Address of the recipient,
    data: //THIS VALUE MUST BE ENCRYPTED USING SWISSTRONIKJS
    value: //Amount of Swtr to send,
  });

For a deeper dive into transactions data field on EVM-based blockchains, check out the article

βš’οΈ
Intel SGX enclave
Decoding the β€œdata” field in Ethereum Transactions