48 lines
3.8 KiB
Markdown
48 lines
3.8 KiB
Markdown
|
# Zencode usage
|
||
|
|
||
|
In order to better explain the potential of the Zencode Domain Specific Language (DSL), approaches may change on a domain-specific basis, meaning an explanation will be more effective when tailored on the specific context it applies to. As we are on the quest to merge the description of an algorithm with its executive expression we get close to the concept of a speech act that refers to a specific context and adopts a limited taxonomy which may or may not be inscribed in a larger ontology.
|
||
|
|
||
|
At the time of writing our explanation can be based on an extended experimentation of in-vitro usage (lab tests) and a limited experimentation of in-vivo usage mostly bound to the conceptualization of use-cases in the IoT pilot and the Amsterdam's register pilot. In order to extend the coverage of Zencode to more pilots, we need to have a completed implementation of the underlying cryptographic contract, in this case the petition.
|
||
|
|
||
|
What follows is a brief visualisation of what is realised so far. In particular the first visualisation below refers to the implementation of an asymmetric cryptographic exchange in the fashion of the PGP implementation, based on an exchange of pulic/private keys and their collection into a keyring:
|
||
|
|
||
|
![Asymmetric Diffie-Helman encryption using Zencode](encryption.dot.png)
|
||
|
|
||
|
This simplified flow diagram shows **actual Zencode** that can be executed, higlighting variables that are normally just surrounded by single quotes. Between each code block, which is executed asynchronously as required and at different times, there is a schema which indicates the shape of data in output.
|
||
|
|
||
|
What follows is another flow diagram leading to data outputs that can be reused into the above: is the use of ECQV implicit certificates via Zencode, which leads to obtaining public/private keypairs that are compatible with asymmetric encryption.
|
||
|
|
||
|
![Implicit certificate issuing and retrieval using Zencode](implicit_certificate.dot.png)
|
||
|
|
||
|
Future horizons of development of Zencode include further implementations supporting interoperable and extensible crypto schemes on the same EC curve that can still work with the above implementations, as well further refinement of the parser and extension of the schema validation. From this point onwards Zencode must be informed by piloting, while it will be also refined in cooperation with legal experts to match the smart-rule statements so far identified to express consensual data processing conditions.
|
||
|
|
||
|
|
||
|
# Zencode Integration
|
||
|
|
||
|
The integration of Zencode is so far relying on the same integration schemes present for Zenroom, with the addition of a minimal layer of boilerplate code for its execution. This is so to facilitate flexibility in piloting, but will be later changed to lock down to the sole execution of Zencode via new specific API calls.
|
||
|
|
||
|
Therefore, for now, in addition to the C call that we have exported to Java, Go, Python and Javascript languages along with utility wrappers:
|
||
|
|
||
|
```c
|
||
|
int zenroom_exec(char *script, char *conf, char *keys,
|
||
|
char *data, int verbosity);
|
||
|
```
|
||
|
|
||
|
We also have the boilerplate internal to the `script` buffer:
|
||
|
|
||
|
```lua
|
||
|
verbosity_level = 1
|
||
|
ZEN:begin(verbosity_level)
|
||
|
ZEN:parse([[
|
||
|
-- your zencode here
|
||
|
]])
|
||
|
ZEN:run()
|
||
|
```
|
||
|
|
||
|
The execution of actual Zencode lines happens sequentially at the time of the `ZEN:run()` call. Each line as part of the whole statement block (utterance) makes use of data types which may or may be validated and should be present in the KEYS and DATA buffers.
|
||
|
|
||
|
A list of Zenroom/Zencode integrated implementations follow: they have been developed in relation to each pilot software implementation as needed, covering several languages. Also notable the presence of the `zenroom` module inside the NodeJS Package Manager collection (NPM) and of course its extremely portable WebAssembly optimized build (universal binary).
|
||
|
|
||
|
TODO: list git repos
|
||
|
|