5

I have been reading about RSK lately and was wondering about the compatibility and possibilities, so I wanted to ask for some basic info in case there's someone more knowleadgable.

I have a smart contract running on the Ethereum network. The contract is based on the ERC20 standard. So, this smart contract, with its setup today, would it be possible to make it use the RSK network instead of Ethereum?

If yes, what could be the pros and cons? Eg. cheaper/faster transactions.

4
  • 1
    Fair question - upvoted. Just the final part though: Ethereum node count is currently ~11,100 (ethernodes.org), Bitcoin node count is ~10,500 (bitnodes.io). Not sure how users could be quantified, but an estimate of relative use could be made from the fees being paid on the two networks (Ethereum is several times bigger) -> cryptofees.info Commented Mar 1, 2021 at 17:36
  • (Thinking about it, this question might be better answered on the Bitcoin SE site: bitcoin.stackexchange.com) Commented Mar 1, 2021 at 18:08
  • Fair enough. I wasn't sure where would be the best place, but opted for the ETH SE site cuz the original platform from which I start the problem is ETH. I'll ask there as well, with reference to this Q. :) Thanks. Commented Mar 1, 2021 at 21:06
  • Hey, yes, RSK is EVM compatible at the op-code level, and supports a geth-compatible RPC. This means that the solidity development toolchain works on RSK too - just config differences.
    – bguiz
    Commented Dec 7, 2021 at 9:15

1 Answer 1

6

Yes, you can easily deploy your Ethereum smart contracts to the RSK blockchain. Smart contracts for RSK can be written using Solidity and are fully compatible with Ethereum Smart Contracts, so you can migrate your existing Ethereum Smart Contract to RSK without changing the smart contract. You just need to configure your truffle-config.js file to point to RSK. Here's an example for the RSK Testnet:

testnet: {
      provider: () => new HDWalletProvider({
        mnemonic: {
          phrase: testnetSeedPhrase,
        },
        providerOrUrl: 'https://public-node.testnet.rsk.co/',
        derivationPath: "m/44'/37310'/0'/0/",
        // Higher polling interval to check for blocks less frequently
        pollingInterval: 15e3,
      }),
      // Ref: http://developers.rsk.co/rsk/architecture/account-based/#chainid
      network_id: 31,
      gasPrice: gasPriceTestnet,
      networkCheckTimeout: 1e6,
      timeoutBlocks: 100,
      // Higher polling interval to check for blocks less frequently
      // during deployment
      deploymentPollingInterval: 15e3,
    },

Pros

  • RSK has lower gas fees compared to Ethereum - ~2-2.5%
  • You can build and use smart contracts using the same tools/software/libraries

Cons

  • The block time is 30 sec, which is slower than 15 sec in Ethereum

You can find a guide here on how to port Ethereum dApp to RSK.

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.