rlp 1.0.1

  • README.md
  • Example
  • Installing
  • Versions
  • new70


An Ethereum RLP library for Dart - https://pub.dartlang.org/packages/rlp

Build Status

The purpose of RLP (Recursive Length Prefix) is to encode arbitrarily nested arrays of binary data, and RLP is the main encoding method used to serialize objects in Ethereum

rlp takes a String, int or List and returns an RLP encoded List<int>


A simple usage example:

import 'package:rlp/rlp.dart';

main() {
  var encoded = Rlp.encode(["dog", "cat"]);
  print(encoded); // List<int> [200, 131, 100, 111, 103, 131, 99, 97, 116]

A more complex usage example:

import 'dart:typed_data';

import 'package:convert/convert.dart';
import 'package:pointycastle/pointycastle.dart';
import 'package:rlp/rlp.dart';

main() {

  const sender = Address('0xba52c75764d6f594735dc735be7f1830cdf58ddf');
  const nonce = 3515;

  var encoded = Rlp.encode([sender, nonce]);

  var out = new Digest('SHA-3/256').process(Uint8List.fromList(encoded));
  var contractAddress = hex.encode(out.sublist(12));

  print('Cryptokitties contract address is 0x$contractAddress'); // 0x06012c8cf97bead5deae237070f9587f8e7a266d


Features and bugs

Please file feature requests and bugs at the issue tracker.


  • Initial release version. Encoder only.


import 'package:rlp/rlp.dart';

main() {
  var encoded = Rlp.encode(["dog", "cat"]);
  print(encoded); // [200, 131, 100, 111, 103, 131, 99, 97, 116]

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  rlp: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:rlp/rlp.dart';
Version Uploaded Documentation Archive
1.0.1 Oct 20, 2018 Go to the documentation of rlp 1.0.1 Download rlp 1.0.1 archive
1.0.0 Oct 20, 2018 Go to the documentation of rlp 1.0.0 Download rlp 1.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:rlp/rlp.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
convert ^2.0.2 2.0.2
Transitive dependencies
charcode 1.1.2
typed_data 1.1.6
Dev dependencies
pointycastle 1.0.0-rc4
test ^1.0.4