<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dimitr Chis</title>
    <description>The latest articles on DEV Community by Dimitr Chis (@triel-lang).</description>
    <link>https://dev.to/triel-lang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4051368%2Fceb12b5c-f63e-43fc-b663-b9f84d21d464.png</url>
      <title>DEV Community: Dimitr Chis</title>
      <link>https://dev.to/triel-lang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/triel-lang"/>
    <language>en</language>
    <item>
      <title>TRIEL: a specification language where compliance rules compile into cryptographic artifacts</title>
      <dc:creator>Dimitr Chis</dc:creator>
      <pubDate>Tue, 28 Jul 2026 13:11:07 +0000</pubDate>
      <link>https://dev.to/triel-lang/triel-a-specification-language-where-compliance-rules-compile-into-cryptographic-artifacts-182a</link>
      <guid>https://dev.to/triel-lang/triel-a-specification-language-where-compliance-rules-compile-into-cryptographic-artifacts-182a</guid>
      <description>&lt;p&gt;Software specifications and their implementations tend to drift apart over time. A specification is written once; the implementation is built, maintained, and modified separately — and the two slowly diverge. This gap is a routine source of costly failures, compliance issues, and audit findings, not just a documentation nuisance.&lt;/p&gt;

&lt;p&gt;TRIEL is an open specification language that treats specification-to-implementation translation as the point where correctness evidence should be generated — not recovered afterward through separate testing or review.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it looks like
&lt;/h2&gt;

&lt;p&gt;Here's the actual &lt;code&gt;hello_triel.triel&lt;/code&gt; from the repository — not a simplified stand-in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SPECIFICATION hello_triel VERSION 1.0.0

SUBJECTS {
  alice : PARTY,
  bob   : PARTY
}

TERMS {
  alice MUST send_greeting
}

FACTORS {
  greeting_sent : Boolean METADATA SOURCE alice
}

INVARIANTS {
  greeting_happens : LIVENESS : EVENTUALLY(greeting_sent == true)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Subjects, obligations (&lt;code&gt;MUST&lt;/code&gt; / &lt;code&gt;MAY&lt;/code&gt; / &lt;code&gt;MUST_NOT&lt;/code&gt;), factors, and invariants — that's the core vocabulary. Invariants can express both safety properties (&lt;code&gt;ALWAYS&lt;/code&gt;) and liveness properties (&lt;code&gt;EVENTUALLY&lt;/code&gt;, with an optional &lt;code&gt;WITHIN&lt;/code&gt; deadline), backed by full LTL/CTL temporal logic underneath.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it gets more interesting: zero-knowledge constraints
&lt;/h2&gt;

&lt;p&gt;TRIEL has native zero-knowledge predicates built into the type system. Here's a real example from the repo — an EUDI Wallet–style driving license credential:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-- TRIEL example: EUDI Wallet driving license — issuance and presentation policy
-- Demonstrates: conditional obligations, ZK age predicate, prohibition on stale credentials
SPECIFICATION eudi_driving_license VERSION 1.0.0
    STANDARD "ISO-18013-5", "eIDAS-2.0"
    JURISDICTION "EU"
SUBJECTS {
  applicant : PARTY,
  issuer    : REGULATOR,
  verifier  : PARTY
}
FACTORS {
  age                       : ZK&amp;lt;Integer&amp;gt; PROVES(self &amp;gt;= 18) WITHOUT REVEALING self
                              METADATA SOURCE applicant,
  vision_correction_needed  : Boolean METADATA SOURCE issuer,
  license_category          : String  METADATA SOURCE issuer,
  license_valid             : Boolean METADATA SOURCE issuer MAX_AGE 24 HOURS
}
TERMS {
  applicant MUST submit_proof(age) BY DATETIME("2026-09-01T00:00:00Z");
  IF vision_correction_needed THEN
    issuer MUST attach_restriction("corrective_lenses")
  ELSE
    issuer MAY issue_unrestricted_category;
  verifier MUST_NOT accept_presentation WHEN license_valid == false
}
INVARIANTS {
  license_requires_adult_holder       : SAFETY : ALWAYS(age &amp;gt;= 18);
  presentation_requires_valid_license : SAFETY : ALWAYS(license_valid == true)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;age : ZK&amp;lt;Integer&amp;gt; PROVES(self &amp;gt;= 18) WITHOUT REVEALING self&lt;/code&gt; declares a field where the predicate ("at least 18") is checkable without exposing the underlying value. Combined with conditional obligations and a prohibition on stale credentials, this one spec captures a fairly realistic identity-verification policy — the kind of thing that today usually lives split across legal text, a compliance checklist, and application code that may or may not match either.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where it sits relative to existing tools
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;vs. OPA/Rego:&lt;/strong&gt; Rego evaluates structured queries at a perimeter — admission control, gateways. It's decoupled from the cryptographic execution layer and can't reach into an MPC circuit or a ZK pipeline. TRIEL expresses compliance constraints at the data-field level, so they can compile into the cryptographic artifacts themselves, not be enforced from outside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vs. Wysteria/Wys*:&lt;/strong&gt; these are rigorous languages for secure multiparty computation, built for cryptographers who already understand type theory and principal-splitting. TRIEL is aimed the other direction — non-cryptographers (compliance officers, analysts) writing and auditing declarative invariants, with low-level cryptographic targeting handled at compilation time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Current state
&lt;/h2&gt;

&lt;p&gt;The current grammar version is v2.4 (the previous v2.3.3 is kept in the repo for reference). v2.4 added three backward-compatible extensions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;REPLACES&lt;/code&gt; in the declaration block, for chaining specification versions&lt;/li&gt;
&lt;li&gt;an optional &lt;code&gt;WITHIN&lt;/code&gt; deadline on &lt;code&gt;EVENTUALLY(...)&lt;/code&gt; invariants, for bounded liveness properties&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;Progress&amp;lt;T&amp;gt;&lt;/code&gt; composite type, for expressing graduated status instead of just boolean done/not-done&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The grammar is published under the Open Web Foundation Agreement 1.0 (OWFa 1.0). It's a work in progress — feedback on the primitive set, the ZK syntax, or prior art I should know about is welcome.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repo: &lt;a href="https://github.com/triel-lang/grammar" rel="noopener noreferrer"&gt;https://github.com/triel-lang/grammar&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Site: &lt;a href="https://triel.dev" rel="noopener noreferrer"&gt;https://triel.dev&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>opensource</category>
      <category>security</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
