Development of a Java-SDK


#1

Hello,

is anybody already working on a Java-SDK? We need one to integrate Æternity into a 3rd-party project. As we need the Java-SDK anyway we would start to implement it.

Just want to know whether anybody else is already working on it :slight_smile:


#2

Hello,
there is no one working on a Java SDK afaik.


#3

Hi @marc0olo, did you started to work on a java sdk?


#4

Yes, we published the current dev state a few days ago.

It’s not ready yet. You can follow the progress here: https://github.com/kryptokrauts/aepp-sdk-java/tree/dev?files=1


#5

@noandrea is there any test available to check the validity of a signed transaction?

when broadcasting it I always receive Bad Request as response :confused:


#6

There is an experimental tool that you can use to test signed transactions (currently only spend ones)

https://goggles.aepps.com

For example you can test it with this transaction (that has a lot of issues):

tx_+LsLAfhCuEByfG/wPQ1EEuGRHQ/EsiW3ZCWKWKo07eYfr7Gwtsp+J6cW6ra9RzB4Rrh+RTgZH25SfbFBDDNIyA8zJDiCgoEFuHP4cQwBoQErhur1eJn/RBV05rwez1XXy/p0Zlghrxdc1gWlCHrKrqEBHxOjsIvwAUAGYqaLadh194A87EwIZH9u1dhMeJe9UKOJAaEVcvQZvTTrggPogkZQggu4l3lvdSBzaGFsbCBub3QgcGFzcyDwn5ikw1XokQ==

This will only check if a signed spend transaction is valid in the mainnet network


#7

Ok will check that out when I find time. Thanks!

At this moment spend tx is all I need :blush:

Edit: I would like to have this tool to be working with my local network. Is the source code available to build it and configure the network manually?


#8

the source is here: https://github.com/aeternity/aepp-goggles

but it is a bit hacky to make it run


#9

thanks. I got it working locally. unfortunately I am not able to create a valid signedTx at this moment. either I have some issue in the signing method or in the encoding part.

@noandrea maybe you can have a look into the code and give me a hint?:


#10

@marc0olo the code looks good to me.
On the other side, I have discovered an issue with the goggles that about the signature verification, I pushed a fix.
Can you check again?


#11

I can check again but I think it won’t change anything. I always get an invalid tx string. It seems like the signed tx from our code is much shorter than the regular tx.

this is an example of a signedTx created from our code:
tx_+J4LAbhAxhPDAzdN0KdmnKlSZeapQ401YSGhjJS6TBVagvTA32b7TA0tvI4pSxSOMSYJxenzeDQgz1CNwQv1KzxQItnVB7hY+FYMAaEBde6YJa1jCWNIK7GTmiEqDlNYg8a014BOQCh+H1VtonKhAXfp5nKshm6B5Ytk5PUStR//5noibuMFmNMZEx5m4BdTAYJOIIJOIAGHcGF5bG9hZIB/iTY=

this is created when using following parameters:

  • address: ak_twR4h7dEcUtc2iSEDv8kB7UFJJDGiEDQCXr85C3fYF8FdVdyo
  • amount: 1
  • payload: payload
  • fee: 20000
  • ttl: 20000
  • nonce: 1

I think the signedTx generally is invalid. but I don’t know what’s wrong in the code generating it

edit: we use ae_devnet as network for this example


#12

ah! I understood the problem was specific for the signature verification.

One thing I can tell you is that the field signature for a signed transaction is an array (to allow multi-signature).

So the method encodeSignedTransaction:

private String encodeSignedTransaction(byte[] sig, byte[] binaryTx) { 

should be something like this

private String encodeSignedTransaction(byte[][] sig, byte[] binaryTx) {

#13

ok yes that was the problem. got it working now. thanks! :slight_smile:

is multi-signature already supported? I mean should the SDK provide the possibility to put an array of multiple signatures at this moment of time?

haven’t seen this implemented in other SDKs so far


#14

Multi signature is currently used for state channels, see for example this transaction


#15

a few days ago we released the new version aepp-sdk-java v1.0.2.

@noandrea
do we already have some Æ-unit-conversion tools? I would like too add this to the sdk.
we also want to provide a tool to estimate the best fees. can you tell us the best way to do this?


#16

@marc0olo for fee calculation you can check the specs here

what do you mean for unit conversion ?


#17

ahh thanks. didn’t catch that in the specs :sweat_smile:

with unit conversion I generally mean how we define the units in æternity. there was some discussion about that in this thread. but it seems like it isn’t defined yet how to name the units.

some call the smallest unit aettos and in the blockexplorer I saw something like picoAE. I would love to have this specified and published by the æternity team :slight_smile:


#18

@noandrea do you know which SDKs already support state channel operations? we started implementing state channel support in our Java SDK and I just want to have a look at other implementatons.


#19

The JS SDK supports state channels https://github.com/aeternity/aepp-sdk-js

For the unit conversion, there are no specific guidelines afaik.


#20

AE supports Java sdk? Where can I find it?