API

      \Transaction::cancel
      \Transaction::create
      \Transaction::send
      \Transaction::sendmany
      \Transaction::status
      \Transaction::transfer
      

1.1 REGISTRATION

First retrieve the bloqts.com registration public key (regkey)* bymaking a GET request to https://api.bloqts.com/regkey.

* regkey updates hourly

Next locally generate a 4096 bit RSA key pair.

DO NOT TRANSMIT YOUR PRIVATE KEY TO BLOQTS.COM!!!Then create a JSON-formatted request as follows and encrypt using alocally generated AES-256-CBC symmetric key (32) and initializationvector (16).1

      {
        "request": sym({
        "phone": int
        "email": "str"
        "key": "str"
        }),
        "keyiv": pub("str")
      }
      

phone​ is 11 digit US phone eg. 13239893782email​ is eg. info@bloqts.comkey​ is the above generated public keykeyiv​ is the above generated symmetric key and initialization vectoras JSON-formatted array.

Encrypt keyiv in this request using the bloqts.com ​regkey​.
POST this encrypted request to api.bloqts.com/register.
An email with an encrypted URI will be sent to ​email​ and an SMS textmessage with a 6-digit PIN will be sent to ​phone​.
Retrieve this email and return to the link provided to enter the PINreceived via SMS.Successful submission of PIN at URI will register the ​key​ and returnan on-screen ​id​. This ​id​ is required for all future transactions.

The assigned ​id​ can be recovered using the same process. This processis idempotent.

The following outline describes the process illustrated in Figure 1.

2.0 REQUESTS

The Bloqts API allows for a single machine to make requests on behalfof many ids. Each request is stateless and there is no authorizationprocess outside of registration of a public key.

This process introduces additional complexity and overhead as all APIrequests must be encrypted and sealed as follows.

      {
        "id": "string",
        "eid": "base64encode(prikey(id,time))",
        "keyiv": "base64encode(pubkey(keyiv))",
        "request": "base64encode(keyiv(string))"
      }
      

There is one Bloqts API endpoint: https://api.bloqts.com

3.0 PUBLIC CLASSES::METHODS

PUBLIC CLASSES::METHODSThere is currently one publicly accessible class. The \Transactionclass. This class is composed of six (6) methods including (inalphabetical order) ::cancel, ::create, ::send, ::sendmany, ::status,and ::transfer.

\Transaction::cancel
@params [array tid(str) ]@returns [array time(int), [array {object time(int), id(str), address(str), from(str), [array to(str) ]; false on fail] ]; false on fail

      {
        "Transaction: {
          "cancel": [
            "3ltlmgsm9y80880ccwcwswocs044sc4ko0kgw808gcggko8gs4",
            "pzwvx4qef400ggksco0occgs4o8oc4884kos0sk8kcw004c0k"
          ]
        }
      }
      

\Transaction::create
@params [array {object id(str), amount(int), expiry(int), url(str) } ]@returns [array time(int), tid(str), address(str)]; false on fail

\Class::method request must be json formatted, encrypted with key-ivand base64-encoded in the request element of the request object.

      {
        "Transaction: {
          "create": [
            {
              "id": "string",
              "amount": integer,
              "expiry": integer
              "url": "string"
            }
          ]
        }
      }
      

\Transaction::send
@params [array {object address (str): amount (int) }]@returns array time (int), tid (str), address (str), amount (int),txid (str); false on fail

      {
        "Transaction: {
          "send": [
            {
              "3LaF3w67wANfonM2xFzkpTtMu6nekmp5Z6": 12332
            },
            {
              "3LaF3Z67wANfonM2xFzkpTtMu6kenkmp528": 4576
            }
          ]
        }
      }
      

\Transaction::sendmany
@params [array {object id(str): {object address (str): amount (int),... }}]

@returns [array time (int), tid (str), [array object address (str):amount (int), txid (str)]]; false on fail

      {
        "Transaction: {
          "sendmany": [
            {
              "3LaF3w67wANfonM2xFzkpTtMu6nekmp5Z6": 12332,
              "3LaF3Z67wANfonM2xFzkpTtMu6kenkmp528": 4576
            }
          ]
        }
      }
      

\Transaction::status
@params [array tid(str)...]@returns [array time(int), [array {object tid(str); false on fail] ];false on fail

\Transaction::transfer
@params [array {object fromaddr (str), toaddr (str), amount (int) }]@returns array time (int), id (str), from (str), to (str), amount(int); false on fail. Same client only.