Part 2: An overview of HOLa and its macros

+-------+-----------------+
| | coin |
| +-----------------+
| Macro | ext. parameters |
| +-----------------+
| | run |
+-------+-----------------+
+-----+-----+
| | hdr |
| +-----+
| run | op |
| +-----+
| | sig |
+-----+-----+
[4D] CLEAR_DISPLAY
[42] PUT_TEXT(sec, lin, col, in)
[4C] UPDATE_DISPLAY
[80] RETURN
+----------+-------+-----+-----+-----+-----+-----+-----+-----+-----+
| | imm | 1 | 1 | 0 | d4 | d3 | d2 | d1 | d0 |
| +-------+-----+-----+-----+-----+-----+-----+-----+-----+
| Internal | obj | 1 | 0 | 1 | r | 0 | 0 | k | t |
| +-------+-----+-----+-----+-----+-----+-----+-----+-----+
| | const | 1 | 0 | 0 | n4 | n3 | n2 | n1 | n0 |
+----------+-------+-----+-----+-----+-----+-----+-----+-----+-----+
| | u64 | 0 | 1 | 1 | i4 | i3 | i2 | i1 | i0 |
| +-------+-----+-----+-----+-----+-----+-----+-----+-----+
| External | u32 | 0 | 1 | 0 | i4 | i3 | i2 | i1 | i0 |
| +-------+-----+-----+-----+-----+-----+-----+-----+-----+
| | blk | 0 | 0 | 1 | ind | i3 | i2 | i1 | i0 |
+----------+-------+-----+-----+-----+-----+-----+-----+-----+-----+
| | mem | 0 | 0 | 0 | ind | i3 | i2 | i1 | i0 |
+----------+-------+-----+-----+-----+-----+-----+-----+-----+-----+
  • d is the integer value in binary. This value may represent the index of a specific predefined array.
  • r selects as argument the predefined object that stores the result of the last hardware executed operation.
  • k will select the public key to reference. This value can be 0 if we are referring to the current wallet’s public key and 1 for the HASHWallet master public key.
  • t will be 0 if we need the value of the public key, or 1 if we need its length.
  • n will be the number of bytes of the constant value. The const parameter will precede the byte array that is passed in the run.
  • i will be the referencing index of the corresponding values array.
  • ind will indicate if the referencing index of the values array is determined by the value stored in the i index of the mem array.
  • 001 will indicate the blk array,
  • 1 specifies that it is an indirect addressing (the index will refer to the mem array),
  • 0100 points the fourth (4) element of the mem array.
  • sec: the display’s section (header, body, or footer), is referenced with an imm internal or constant parameter, having 0 for the header, 1 for the body, and 2 for the footer as values.
  • lin, col: these are the offset coordinates (line and column) and have predefined values as well.
  • in: the input string (in our case HOLa, World!)
  • sec will be 11000001 or C1(hex), since 110 indicates that it is an imm parameter and 00001 points to the value 1(dec) for the body.
  • lin and col will both be 11000000 or C0(hex), since, again, 110 indicates that it is an imm parameter with a 0(dec) value.
  • Finally, “HOLa, World!” encoded to hex is 484F4C612C20576F726C6421. Since this is a constant value, we need to pass this argument as a const parameter. Therefore, 8C(hex) will precede the hex-encoded text. 8C(hex) comes from 10001100(bin) where 100 indicates that it is a const parameter and 01100 is the size of the hex-encoded text, which is 12(dec). So, our in argument will be: 8C484F4C612C20576F726C6421.
  • 42 is the opCode for the PUT_TEXT operation,
  • C1 points to the body section of the screen,
  • C0C0 are the line and column (both at 0),
  • 8C484F4C612C20576F726C6421 is our “HOLa, World!” text preceded by the const value 8C(hex).

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
eSignus

eSignus

74 Followers

eSignus is a consultancy firm experienced in the financial, technology and crypto security sectors. We run HASHWallet, the most secure hardwallet in the market.