ZEQ · SDKzeqstate.com

Connect from Python

zeq.Machine is the whole machine as one object. Import the signed zeq.py. It verifies itself first, or refuses to load.

import zeq                                   # the machine verifies itself first, or refuses to load
machine = zeq.Machine()                      # the machine of this folder, unlocked with its PIN when a key is needed
sealed = machine.solve("r_s ? r_s = 2*G*m/c^2 | m = 1.98841e30 kg")
machine.verify(sealed)                       # {"verified": True, "by": "ZEQ7…", "zeqProof": True, "reproduction": {…}}

Applications

An application gets its own handle, and its answers are signed into the log under its name:

lab = machine.app("orbital_lab")
sealed = lab.solve("T ? T^2 = 4*pi^2*a_orb^3/(G*m) | a_orb = 1.496e11 m, m = 1.98841e30 kg")
lab.born()                                   # the application's own ZID on this machine, issued once as a signed row

python3 zeq.py --app NAME does the same from the terminal, and hands the application a write key of its own. Every move an application then makes through the API is a signed row of kind act at its Zeqond. --notebook NAME, GET /notebook?app=NAME and the notebook MCP tool read them back in order.

The facets

zeq.Machine offers its facets by name: identity, time, compute, physics, storage, security, network, agents and apps. The compute facet asks a question without the physics shelf:

machine.compute.ask("SE ? standard error | sd_x = 2, n_s = 16")

Modules from Python

A plugged module's own names come through machine.module(NAME):

vault = machine.module("vault")

Another machine's answer

A machine verifies another machine's sealed answer offline, from that machine's public record alone:

machine.verify(sealed_by_b, peer=record_of_b)   # checked against B's record and recomputed here

Worked examples in the package