<?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: Lidiya</title>
    <description>The latest articles on DEV Community by Lidiya (@lidiya_26_01).</description>
    <link>https://dev.to/lidiya_26_01</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%2F4158890%2F33c6aae3-c1a6-4bd9-ac8e-2325f4115cd3.png</url>
      <title>DEV Community: Lidiya</title>
      <link>https://dev.to/lidiya_26_01</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lidiya_26_01"/>
    <language>en</language>
    <item>
      <title>TrialFence: Privacy-Preserving Duplicate Enrollment for Multi-Site Clinical Trials with ZK Proofs</title>
      <dc:creator>Lidiya</dc:creator>
      <pubDate>Sat, 28 Nov 2026 11:05:07 +0000</pubDate>
      <link>https://dev.to/lidiya_26_01/trialfence-privacy-preserving-duplicate-enrollment-for-multi-site-clinical-trials-with-zk-proofs-ofo</link>
      <guid>https://dev.to/lidiya_26_01/trialfence-privacy-preserving-duplicate-enrollment-for-multi-site-clinical-trials-with-zk-proofs-ofo</guid>
      <description>&lt;p&gt;Multi-site clinical trials face a persistent problem: the same participant can enroll at two different sites, either by mistake or to claim duplicate stipends. The traditional fix — sharing participant records across sites — directly conflicts with HIPAA and GDPR. Centralizing names or document numbers creates a single breach target and violates the principle of data minimization.&lt;/p&gt;

&lt;p&gt;TrialFence solves this with a cryptographic gate built on Semaphore v4 zero-knowledge proofs. Sites learn only whether a participant is "already enrolled" or "accepted" — never who the participant is. No names, no document numbers, no PII leaves the coordinator.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Core Idea
&lt;/h2&gt;

&lt;p&gt;TrialFence replaces the shared identity database with a nullifier-based on-chain registry. Each participant generates a Semaphore Identity locally in the browser. The commitment (a hash of the identity) is the only value shared with the coordinator. When a participant tries to enroll, they generate a Groth16 proof that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;They are a member of the protocol's Merkle tree (registered by the issuer)&lt;/li&gt;
&lt;li&gt;The proof message matches the submitting site&lt;/li&gt;
&lt;li&gt;The scope matches the correct protocol&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The on-chain contract verifies the proof and checks the nullifier. If the nullifier already exists, the transaction reverts with TrialFence_DuplicateEnrollment. If the proof is invalid, it reverts with TrialFence_InvalidProof.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;The system has three services:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Issuer (port 4001): Verifies physical ID documents off-chain, HMACs the document number for deduplication, and calls issueMembership(commitment) on-chain. Identity verification stays centralized at this boundary.&lt;/li&gt;
&lt;li&gt;Relayer (port 4002): Validates enrollment payloads, re-checks the scope, runs a staticCall, then submits the transaction with the relayer key. Participants never pay gas.&lt;/li&gt;
&lt;li&gt;Web App (Next.js 15): Volunteer, coordinator, and sponsor/IRB flows. Same-origin API proxies avoid CORS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The smart contract (Solidity 0.8.28) handles the enrollment gate. The scope is computed as keccak256("TrialFence-Protocol-v1:" || protocolId), ensuring that a proof for Protocol A cannot be used for Protocol B. The nullifier is derived from the identity secret and the scope, so the same participant at a second site in the same protocol produces the same nullifier — and gets rejected.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Design Decisions
&lt;/h2&gt;

&lt;p&gt;Scope-binding: The proof is scoped to a specific protocol. A wrong protocol reverts with TrialFence_WrongScope. A wrong site reverts with TrialFence_SiteMismatch. This prevents cross-protocol linkage — a participant can enroll in multiple protocols without those enrollments being connected.&lt;/p&gt;

&lt;p&gt;Stale root expiration: Membership changes mark the previous Merkle root as superseded. In-flight proofs remain valid for MERKLE_TREE_DURATION (1 hour), then revert with TrialFence_MerkleTreeRootIsExpired. This prevents replay attacks while allowing for network latency.&lt;/p&gt;

&lt;p&gt;No PII on-chain: Events carry only protocolId, siteId, scope, nullifier, root, and the relayer address. The issuer stores HMAC keyed-digests of document numbers — never names or raw numbers.&lt;/p&gt;

&lt;p&gt;PII-free monitoring: The monitor generates deterministic anomaly flags over public events and denial records. Auditing does not require access to participant identity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Solidity 0.8.28 with Hardhat (contracts)&lt;/li&gt;
&lt;li&gt;TypeScript 5.7 with Node.js 22 (server)&lt;/li&gt;
&lt;li&gt;Next.js 15 App Router (web)&lt;/li&gt;
&lt;li&gt;Semaphore v4 (ZK proof system, Groth16)&lt;/li&gt;
&lt;li&gt;SQLite via node:sqlite (local prototype, portable to Postgres)&lt;/li&gt;
&lt;li&gt;WebAssembly (snarkjs proof generation in browser)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Prerequisites: Node.js &amp;gt;= 22, npm &amp;gt;= 10.&lt;/p&gt;

&lt;p&gt;npm ci&lt;br&gt;
npm run start:render&lt;/p&gt;

&lt;p&gt;The render-start.mjs script boots an in-memory Hardhat chain on port 8545, deploys the contracts, starts the issuer on 4001 and relayer on 4002, and serves the Next.js app on 3000. The local chain and database are ephemeral — re-run the walkthrough after a restart.&lt;/p&gt;

&lt;p&gt;For multi-terminal development:&lt;/p&gt;

&lt;p&gt;npm install&lt;br&gt;
npm run node -w contracts&lt;br&gt;
npm run deploy:local -w contracts&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;TrialFence demonstrates that privacy-preserving coordination is possible without sacrificing determinism. The on-chain nullifier registry provides a trustless, auditable duplicate check that no single party can tamper with. The ZK proof ensures that the verifier learns nothing about the participant beyond "this person is a valid member of this protocol group."&lt;/p&gt;

&lt;p&gt;This pattern generalizes beyond clinical trials. Any multi-organization system that needs to prevent duplicate actions without sharing identity — voter registration across jurisdictions, KYC across financial institutions, license verification across regulatory bodies — can adopt the same architecture.&lt;/p&gt;

&lt;p&gt;The full source is available at &lt;a href="https://github.com/alwaysalearner1234/TrialFence" rel="noopener noreferrer"&gt;https://github.com/alwaysalearner1234/TrialFence&lt;/a&gt;. The project includes 22 integration tests with real Groth16 proofs, a CI pipeline, and documented configuration.&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>blockchain</category>
      <category>web3</category>
    </item>
    <item>
      <title>Understanding AI: From Basics to the Future</title>
      <dc:creator>Lidiya</dc:creator>
      <pubDate>Sat, 28 Nov 2026 10:37:56 +0000</pubDate>
      <link>https://dev.to/lidiya_26_01/understanding-ai-from-basics-to-the-future-j2n</link>
      <guid>https://dev.to/lidiya_26_01/understanding-ai-from-basics-to-the-future-j2n</guid>
      <description>&lt;p&gt;Artificial Intelligence (AI) has moved from science fiction into the fabric of our daily lives. From the recommendations on your favorite streaming platform to the autonomous vehicles on our roads, AI is reshaping how we live, work, and interact with technology.&lt;/p&gt;

&lt;p&gt;What is AI?&lt;/p&gt;

&lt;p&gt;At its core, Artificial Intelligence refers to the simulation of human intelligence processes by computer systems. These processes include learning (the acquisition of information and rules for using it), reasoning (using rules to reach conclusions), and self-correction. Unlike traditional software that follows rigid instructions, AI systems can adapt, improve, and make decisions based on data.&lt;/p&gt;

&lt;p&gt;Types of AI&lt;/p&gt;

&lt;p&gt;AI can be broadly categorized into three types:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Narrow AI (ANI): This is the most common form today. It's designed for specific tasks like image recognition, voice assistants, or recommendation engines. Examples include Siri, Alexa, and Google's image search.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;General AI (AGI): This hypothetical form would possess human-level cognitive abilities across all domains. It can reason, plan, and solve problems in any field, much like a human. AGI remains a goal rather than a reality.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Super AI (ASI): A theoretical concept where AI surpasses human intelligence in every aspect, including creativity, social skills, and problem-solving. This remains purely speculative.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Key Applications of AI&lt;/p&gt;

&lt;p&gt;AI is transforming industries across the board:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Healthcare: AI-powered diagnostics can detect diseases earlier and more accurately than traditional methods. Drug discovery is being accelerated by AI models that can simulate molecular interactions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finance: Algorithmic trading, fraud detection, and personalized financial advice are all powered by AI.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Transportation: Self-driving cars, route optimization, and traffic management systems leverage AI to improve safety and efficiency.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Education: Adaptive learning platforms use AI to personalize educational content based on individual student progress.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creative Industries: AI tools are now assisting in music composition, art generation, and content creation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Future of AI&lt;/p&gt;

&lt;p&gt;The future of AI is both exciting and uncertain. Researchers are working on making AI systems more interpretable, ethical, and aligned with human values. The integration of AI with other technologies like quantum computing and the Internet of Things (IoT) promises to unlock new capabilities.&lt;/p&gt;

&lt;p&gt;However, the rapid advancement of AI also raises important questions about job displacement, privacy, bias, and the concentration of power. As we build more capable AI systems, we must also build the frameworks to govern them responsibly.&lt;/p&gt;

&lt;p&gt;Ethical Considerations&lt;/p&gt;

&lt;p&gt;AI is not neutral. The data it's trained on can reflect and amplify societal biases. Questions of accountability arise when AI systems make decisions that affect people's lives. Transparency in how AI systems arrive at their conclusions is crucial for public trust.&lt;/p&gt;

&lt;p&gt;As developers and users, we have a responsibility to ensure that AI serves humanity rather than the other way around. This means investing in research on AI safety, developing robust regulations, and fostering inclusive dialogue about the future we want to build.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;/p&gt;

&lt;p&gt;AI is not just a technology; it's a force that will define the next century. Understanding its capabilities and limitations, embracing its potential while addressing its risks, is essential for everyone, not just technologists. The question is no longer whether AI will change our world, but how we choose to shape that change.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
