Skip to content
Swaxxx edited this page Dec 3, 2017 · 9 revisions

Fix dependencies conflict of bouncycastle when importing Web3j library

JXTA library (used to establish peer-to-peer connection) is imported by the package com.kenai.jxse:jxse:2.7 and depends of package bouncycastle:bcprov-jdk15:140.

Web3j library (used to establish a connection with the Ethereum client Geth) is imported by the package org.web3j:core:3.1.1 and depends of package org.bouncycastle:bcprov-jdk15on:1.54 -> 1.58.

It can be verify by typing gradle dependencies --configuration runtime command, that gives the dependencies tree of the project (gradle is replaced by gradlew on Windows).

The problem is that this two versions of bouncycastle isn't compatible.

So how to fix that ? JXTA is no longer supported and the version 2.7 it's the last version, so it's not possible to update the library. There are two tracks :

  • Replace JXTA by an updated library that follow the last version of bouncycastle.
  • Find a way to used two version of bouncycastle for different things. But as I saw in my researchs, it doesn't seems possible for two reasons :

Update the signing process to multiple

The solidity file is the following : https://github.com/Swaxxx/SXP/blob/master/Contracts/MultipleTradeContract.sol

Set trade process anonymous and add expiration date to the contract

Both can be done with https://github.com/Swaxxx/SXP/tree/master/Contracts/anonymousvoting-master/anonymousvoting-master that is a fork of the project https://github.com/stonecoldpat/anonymousvoting.

## Infura light client Geth support light client with parameter --syncmode="light". However, although it's nice for desktop, the blockchain stays too big for a mobile solution. In this case, have a look at Infura : https://www.infura.io.