Skip to content
Java -SDK for BOScoin 1st main-net ,SEBAK.
Branch: master
Clone or download
MegaSolar Merge pull request #1 from soonkuk/master
Make Transaction builder
Latest commit c07a072 Apr 25, 2019

Sebak java-sdk


  • JVM (java virtual machine) 1.8 or more latest.

  • Gradle version 5.3.1 or more latest.

  • IntelliJ (recommended)


  • You have to check your JVM version is 1.8.

  • running $ ./gradlew test or $ gradle test.

Then you can see the test result.

Before transaction create... You need

  • Secret seed of sender.

  • network id

    You can find network id access to sebak main-net or sebak test-net on policy section.

    $ curl -v
      "policy": {
        "network-id": "sebak-test-network",
        "initial-balance": "10000000000000000000",
        "base-reserve": "1000000",
  • Public keys of recipients.


Transaction format is Json on basis.

Transaction header

Transaction header consists of version,created(ISO8601 format) and signature.

Every elements of Header type are String.

Transaction body

Transaction body consists of sender's public key (a.k.a source), fee(transaction fee), sequence id, and Lists of operation.

  • sender's public key( A.K.A source): This is generated from the sender'ssecret seed.

  • fee : It is multiplied by the number of operations in one transaction.

  • sequence id : sequence_id is the last state of account. It will be varied when your account state is changed, so you should check the latest sequence_id from network. You can get the laetst sequence_id in here. .

  • Lists of operations : Please see the below decription.


For the nature of transaction of SEBAK, one Transction can have multiple operations. Operation is the base unit of operating accounts like creating new account and payment. Currently SEBAK supports various kind of operations, but most of users will use CreateAccount and Payment operations.

when you organize operation, you have to include operation type , targetaddress and amount.

  • amount have to be String type, and its unit is GON. GON is BOScoin's base unit that like 'GWEI' in Ethereum.

    1BOS equal to 10000000GON.


  • target address is have to be valid.

  • At this time, you can up to 100 operations in one transaction. This number can be adjusted. This limit also can be checked by node information.

You can see the how operation lists make :

String newtork_id = "sebak-test-network";
String sequence_id; // you have to search Sequence id on Sebak network through API.
String source = KeyPair.fromSecretSeed(secretSeed).getAccountId();
String type1 = "payment";
String type2 = "create-account";
String amount1 = "100";
String amount2 = "1000000";
Operation operation1 = new Operation(type1, amount1, targetAddress1);
Operation operation2 = new Operation(type2, amount2, targetAddress2);

Create account operation

Target address must be new account, this means, it does not exist in the SEBAK network. You can check the account status thru account API of SEBAK. Please see here . Amount for creating account must be bigger than base reserve, you can check the amount from SEBAK node information like 'network-id' through access sebak main-net or test network that mentioned above.

Payment operation

Target address must exist in network.

Building a Transaction

Check the existence of senders's account. Get the sequece id of sender's account. Start Building a transation.

Transaction transaction  = new Transaction.Builder(source, sequence_id)

make transaction signature

Make a signature with secret seed ,network id. For instance:

transaction.sign(secretSeed, newtork_id);

If you successfully sign your transaction, you can serialize your transaction instance to 'json'.

String json = transaction.toJson();

  "H" : {
    "version" : "1",
    "created" : "2019-04-10T13:13:54.000000951+09:00",
    "signature" : "nU46BuF6f1PUUCoHoy3EXMxdibvRC6ZYyzLPsr4aNJYJnDDvSdcn52Qf9CGy5R9UbkMgW6mdKGwrHNvd3oCoRsp"
  "B" : {
    "fee" : "20000",
    "sequence_id" : 1,
    "operations" : [ {
      "H" : {
        "type" : "payment"
      "B" : {
        "amount" : "100"
    }, {
      "H" : {
        "type" : "create-account"
      "B" : {
        "amount" : "1000000",
        "linked" : ""
    } ]

Sending Transaction

So you are ready to submit transactons, you can just post your json to SEBAK node.

$ curl -v \
    -XPOST \
    -H 'Content-Type: application/json' \
    -d @your-transaction.json \
> POST /api/v1/transactions HTTP/2
> Host:
> User-Agent: curl/7.62.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 749
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
* We are completely uploaded and fine
< HTTP/2 200
< content-type: application/problem+json
< x-ratelimit-limit: 100
< x-ratelimit-remaining: 98
< x-ratelimit-reset: 1542432619
< date: Sat, 17 Nov 2018 05:30:08 GMT
< content-length: 101
< via: 1.1 google
< alt-svc: clear
* Connection #0 to host left intact

The API of sending transaction, please see .

You can’t perform that action at this time.