Jabit is a Bitmessage library for the Java environment, written in Kotlin. It is used by both Abit and Jabit-Server, and it shouldn’t be too hard to create your own Bitmessage client with it. https://dissem.ch/jabit/
Go to file
Christian Basler 1f05a52f05 Improvements
- Massively reduced logging, especially at debug level
- Optimizations to reduce system load
- Use bootstrapping to find stable nodes
2015-11-08 10:14:37 +01:00
demo Connections now use two separate threads for writing and listening 2015-10-14 18:37:43 +02:00
domain Improvements 2015-11-08 10:14:37 +01:00
gradle/wrapper Moving "Security" to a separate port, so there can be a Bouncycastle and a Spongycastle implementation. (BC doesn't work on Android, SC can't be used on Oracle's JVM) 2015-08-05 19:52:18 +02:00
networking Improvements 2015-11-08 10:14:37 +01:00
repositories Connections now use two separate threads for writing and listening 2015-10-14 18:37:43 +02:00
security-bc The nonce is now set over a callback method in the POW engine. This should make some POW implementations easier. 2015-10-26 09:49:49 +01:00
security-sc Moving "Security" to a separate port, so there can be a Bouncycastle and a Spongycastle implementation. (BC doesn't work on Android, SC can't be used on Oracle's JVM) 2015-08-05 19:52:18 +02:00
wif Moving "Security" to a separate port, so there can be a Bouncycastle and a Spongycastle implementation. (BC doesn't work on Android, SC can't be used on Oracle's JVM) 2015-08-05 19:52:18 +02:00
.gitignore Added some improvements to the demo application 2015-06-11 21:02:01 +02:00
.travis.yml Update .travis.yml 2015-10-15 08:21:41 +02:00
Bitmessage.uml Updated UML 2015-05-15 11:02:56 +02:00
build.gradle Fixed NetworkHandlerTest 2015-10-15 15:34:04 +02:00
gradle.properties now the build should work for anyone (esp. travis) 2015-07-04 11:13:35 +02:00
gradlew Some basic entities and project structure 2015-03-20 14:18:29 +01:00
gradlew.bat Some basic entities and project structure 2015-03-20 14:18:29 +01:00
LICENSE Some basic entities and project structure 2015-03-20 14:18:29 +01:00
README.md Version 0.2.0 bump 2015-07-03 14:47:25 +02:00
settings.gradle Moving "Security" to a separate port, so there can be a Bouncycastle and a Spongycastle implementation. (BC doesn't work on Android, SC can't be used on Oracle's JVM) 2015-08-05 19:52:18 +02:00

Jabit Build Status

A Java implementation for the Bitmessage protocol. To build, use command gradle build or ./gradlew build.

Please note that development is still heavily in progress, and I will break the database a lot until it's ready for prime time.

Security

There are most probably some security issues, me programming this thing all by myself. Jabit doesn't do anything against timing attacks yet, for example. Please feel free to use the library, report bugs and maybe even help out. I hope the code is easy to understand and work with.

Project Status

Basically, everything needed for a working Bitmessage client is there:

  • Creating new identities (private addresses)
  • Adding contracts and subscriptions
  • Receiving broadcasts
  • Receiving messages
  • Sending messages and broadcasts
  • Managing outgoing and incoming connections
  • Initialise and manage a registry of Bitmessage network nodes
  • An easy to use API
  • A command line demo application built using the API

Setup

Add Jabit as Gradle dependency:

compile 'ch.dissem.jabit:jabit-domain:0.2.0'

Unless you want to implement your own, also add the following:

compile 'ch.dissem.jabit:jabit-networking:0.2.0'
compile 'ch.dissem.jabit:jabit-repositories:0.2.0'

And if you want to import from or export to the Wallet Import Format (used by PyBitmessage) you might also want to add:

compile 'ch.dissem.jabit:jabit-wif:0.2.0'

Usage

First, you'll need to create a BitmessageContext:

JdbcConfig jdbcConfig = new JdbcConfig();
BitmessageContext ctx = new BitmessageContext.Builder()
        .addressRepo(new JdbcAddressRepository(jdbcConfig))
        .inventory(new JdbcInventory(jdbcConfig))
        .messageRepo(new JdbcMessageRepository(jdbcConfig))
        .nodeRegistry(new MemoryNodeRegistry())
        .networkHandler(new NetworkNode())
        .build();

This creates a simple context using a H2 database that will be created in the user's home directory. Next you'll need to start the context and decide what happens if a message arrives:

ctx.startup(new BitmessageContext.Listener() {
    @Override
    public void receive(Plaintext plaintext) {
        // TODO: Notify the user
    }
});

Then you might want to create an identity

BitmessageAddress identity = ctx.createIdentity(false, Pubkey.Feature.DOES_ACK);

or add some contacts

BitmessageAddress contact = new BitmessageAddress("BM-2cTarrmjMdRicKZ4qQ8A13JhoR3Uq6Zh5j");
address.setAlias("Chris");
ctx.addContact(contact);

to which you can send some messages

ctx.send(identity, contact, "Test", "Hello Chris, this is a message.");