Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
  AIP: 8
  Title: toonsbuf : an improvement of transaction protocol
  Authors: toons 
  Status: Draft
  Type: Standards Track
  Created: 2017-01-29
  Last Update: 2017-02-01


Developing a python API for ARK ecosystem, i read javascript source code from ark-js repository. Considering the way a transaction is granted by the ARK blockchain, it seems to me there are rooms for improvments within the core protocol.


Speed and simplicity are roots of efficiency. ARK stands to provide mass adoption of blockchain. Delegate nodes have to be very fast.

How speed can be improved ?

  • on server side : reducing javascript function calls
  • within ARK net : reducing transaciont data size


In fact, transactions are sent as json data via REST protocol, using POST method, on the ARK net.

ARK defines 6 types of transaction:

  1. token transaction
  2. delegate registering
  3. delegate up/down voting
  4. second signature registering
  5. multisignature registering
  6. interplanetary file system transaction

Transaction is a set of information (acount, amount, name, fees and so on...) tied in a javascript object, signed using a private key and identified by an id. Note that singature and id are also stored in the same javascript object.

Example used for this AIP : AJWRd23HNEhPLkK1ymMnwnDBX2a7QBZqff send 1 ARK to AR1LhtKphHSAPdef8vksHWaXYFxLPjDQNU
This transaction is defined by a js object :
  senderPublicKey = '03a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933';
  timestamp       = 21781590;
  asset           = {};
  type            = 0;
  amount          = 100000000;
  fee             = 10000000;
  recipientId     = 'AR1LhtKphHSAPdef8vksHWaXYFxLPjDQNU';
  signature       = '3045022100dc3ba689329c38aa5b76d186511d5123fbf3d4638d577cdf92c017a0db927ad502
  id              = '3570708643510389756'

When doing a POST request via REST protocol, javascript object is serialized into json before going on the Internet. Basicly, it is sent as string describing the js object, gzipped or not according to what is asked in the request headder :

serialized transaction -> 318 chars = 1.272 ko with utf-8 charset defined in request header

When a delegate receive json data it has to:

  1. unserialize json into a js object
  2. transform js object into a serie of bytes (i call it getbyte) using getBytes() function
  3. compute a sha256 hash of concatenation [getbyte + signature]
  4. check id with that hash [accept transaction if check succesfull]
  5. check signature with getbyte [apply the transaction if check succesfull]
  6. save transaction with the id

In my opignon, a transaction can be reduced to its signature and its getbyte computed on client side. Knowing structure of signature, it is possible to quicly separate it from the getbytes.

signature + getbytes = 202 bytes = 0.202 ko (1.272 ko for json data)

When a delegate receive json data it has to:

  1. create an id with data
  2. separate signature from getbyte and check signature [accept transaction into blockchain]
  3. retrieve transaction info and apply it
  4. save transaction with the id

So what ?

  • on server side : less operation to do
  • within ARK net : smaller data size per transaction