<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by yihao on Medium]]></title>
        <description><![CDATA[Stories by yihao on Medium]]></description>
        <link>https://medium.com/@zero5011?source=rss-3289760666ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jVe_uD5cMOH1D9H4</url>
            <title>Stories by yihao on Medium</title>
            <link>https://medium.com/@zero5011?source=rss-3289760666ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:57:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@zero5011/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Prove I’m Over 18 Without Saying My Age: A First Look at Zero-Knowledge Proof]]></title>
            <link>https://medium.com/@zero5011/how-to-prove-im-over-18-without-saying-my-age-a-first-look-at-zero-knowledge-proof-f87b812e2877?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/f87b812e2877</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Tue, 12 Aug 2025 03:56:02 GMT</pubDate>
            <atom:updated>2025-08-12T03:56:02.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9EcojplnP8RtBj_8.png" /></figure><p>Have you ever thought about how to prove something is true without telling others anything else? For example, you want to get into a bar, so you have to prove you are over 18, but you don’t want to tell the guard your age.</p><p>Zero-Knowledge Proof (ZKP) is the technology born to solve this kind of problem.</p><h4>What is ZKP?</h4><p>Imagine you are standing at the entrance of a nightclub, and the guard asks you, “Are you over 18?”</p><p>You could choose to take out your ID card and let him know all your information — birthday, name, address, blood type… all exposed, just to prove one thing: you are an adult.</p><p>But you could also just hand him a simple slip of paper that says: “This person is over 18,” and nothing else.</p><p>ZKP is this kind of magic: you can make the other party believe you meet a condition, without needing to tell them who you are, how old you are, or even when you were born.</p><p>Simply put, ZKP is a way of proving, “I know this secret, but I won’t tell you what it is, yet you can be sure that I know it.”</p><h4>A Real-World Example: Understanding the Spirit of ZKP with a Sudoku Proof via “Probability”</h4><p>Let’s use an intuitive example to understand the core spirit of ZKP. This example can help you build a preliminary understanding of ZKP’s three major properties: “Completeness, Soundness, and Zero-Knowledge.”</p><p>Suppose Alice says she has solved an extremely difficult Sudoku puzzle, but she doesn’t want to show the complete solution directly to Bob. How can she prove that she really has an answer?</p><p><strong>“Permutation” and “Commitment”:</strong> Alice will randomly shuffle all the numbers in the entire Sudoku solution (for example, swapping 1s with 9s, 2s with 5s…), generate a new corresponding relationship, and then fill out a new Sudoku grid. Next, she will hide this shuffled Sudoku behind a pile of sealed envelopes or cover sheets, so Bob cannot see the entire solution at once. This is like her making a “commitment,” indicating the answer is now fixed and unchangeable.</p><p><strong>“Challenge”:</strong> Bob can randomly choose a section from these covered areas to be revealed (for example, a certain row, a certain column, or a certain 3x3 block). He cannot predict or control how Alice “permutes” the numbers, nor can he specify the location of a particular original number to be revealed; he can only draw randomly.</p><p><strong>“Verification”:</strong> Alice then opens the section Bob chose, allowing Bob to check if these numbers comply with Sudoku rules (for example, there are no repeated numbers in the revealed row/column/block).</p><p>If Alice doesn’t have a complete answer at all and just filled it in randomly, Bob’s random check has a high probability of catching her cheating (for example, opening a row to find two number 5s).</p><p><strong>Repeat Verification, Build Confidence:</strong> Alice reshuffles the numbers and covers them up again each time, and then lets Bob randomly check a different block. This is repeated 30 times. If Alice can pass the check in all 30 rounds, Bob can have extremely high confidence that Alice indeed has a legitimate Sudoku solution.</p><p>This example perfectly demonstrates the three major properties of ZKP:</p><ul><li><strong>Completeness:</strong> If the prover (Alice) truly possesses the secret (the Sudoku solution), she can always successfully pass the verification.</li><li><strong>Soundness:</strong> If the prover (Alice) does not have the secret (has not solved the Sudoku), her probability of deceiving the verifier (Bob) is very, very small. The probability of cheating decreases exponentially with each additional successful verification.</li><li><strong>Zero-Knowledge:</strong> Throughout the entire process, the verifier (Bob), apart from knowing that the prover “has the solution,” gains absolutely no new information about the Sudoku solution itself. He only sees localized, permuted parts and cannot deduce the original solution from them.</li></ul><p>But we must also understand that this Sudoku example, through dozens of checks, gives Bob an “overwhelming probabilistic belief,” not a 100% mathematical certainty. Cryptographic proofs, like the Schnorr protocol we will introduce next, elevate this “belief” to a level of certainty based on mathematical hard problems — a cryptographic level of certainty.</p><h4>A Simple ZKP: The Schnorr Protocol</h4><p>So, how is this magical proof implemented with mathematics? Let’s use an analogy of a “magic lock and key,” adding some mathematical formulas to understand it.</p><ul><li>You have a secret x (your secret key).</li><li>You use a public moldg and a secret keyx to forge a lock y that is exclusive to you. Mathematically, this is written as y=g^x. Everyone can see this locky but they cannot reverse-engineer your key x from the lock.</li></ul><p>Now, you need to prove to a guard that you possess the key x, but you must never show the key directly to him.</p><p>The flow of the Schnorr protocol is like this:</p><p><strong>Prover’s First Step: Make a Commitment<br></strong>You first randomly forge a “one-time key” r, and use the same mold g to make a &quot;one-time lock&quot; t (which is t=g^r). You publicly give this one-time lock t to the guard. This step is like saying, &quot;Look, I have locked in the random number I will use this time; it cannot be changed.&quot;</p><p><strong>Verifier’s Challenge<br></strong>To prevent you from preparing an answer in advance to trick him, the guard gives you a random challenge number c.</p><p><strong>Prover’s Response<br></strong>After receiving the challenge c, you use a magical formula to combine your original &quot;secret key&quot; x and that &quot;one-time key&quot; r to calculate the final answer s. The formula is s=r+c⋅x. Please note, because s is mixed with the random r, the guard cannot directly reverse-solve for your secret x from s.</p><p><strong>Verifier’s Verification<br></strong>After the guard gets the final answer s you provided, he doesn&#39;t need to know your secret x. He only needs to use all the public information he has (your exclusive lock y, the one-time lock t you gave, his challenge c) and your answer s, and plug them into a final verification formula: Does gs equal t · y^c?</p><p>Magically, due to the magic of exponents (g^(r+c⋅x)=gr⋅(g^x)^c=t⋅y^c), this equation only holds if the prover knows the secret x.</p><p>In this way, you have successfully proven that you possess the secret x without leaking it.</p><h4>From Interactive to Non-Interactive — The Fiat-Shamir Heuristic</h4><p>Although the Schnorr protocol is simple, each proof requires back-and-forth interaction, which is inconvenient in an asynchronous environment like a blockchain. So, cryptographers came up with a clever method: Can the prover simulate a fair challenge by themselves, without actually needing a person to pose the question? This idea is called the <strong>Fiat-Shamir Heuristic</strong>.</p><p>The core concept of Fiat-Shamir is: Instead of waiting for a verifier to issue a challenge, let’s source the challenge from a fair “digital fingerprint blender” that cannot be manipulated by anyone — that is, a <strong>Hash function</strong>.</p><p><strong>What is a Hash function?</strong> Imagine a magical blender:</p><ul><li><strong>One-wayness:</strong> You can throw the entire Harry Potter novel into it and get a unique cup of “novel juice” (the Hash value). But no one can ever restore the original novel from this cup of juice.</li><li><strong>Collision Resistance (Avalanche Effect):</strong> If you change even a single punctuation mark in the novel, the resulting juice will taste completely different.</li><li><strong>Determinism:</strong> The same content, no matter how many times it’s blended, will always produce the same juice.</li></ul><p>With this tool, the process becomes:</p><ol><li>The prover calculates t = g^r.</li><li>The prover no longer waits for the verifier but instead throws t (along with other public information like g, y) into the Hash blender to generate a challenge c that no one can predict. That is, c = Hash(g, y, t).</li><li>The prover then uses this self-generated c to calculate the final answer<br>s = r + c⋅x.</li></ol><p>You might wonder, “Doesn’t generating the challenge yourself allow for cheating?”</p><p>No, and this is the ingenuity of the design. The process has a strict order: the prover must first “commit” to and publicize t. Once he hands overt, it&#39;s like giving a locked box to a notary; it cannot be changed.</p><p>Only then can he calculate c based on this t. Due to the avalanche effect of the hash function, he absolutely cannot predict what kind of c t will blend into. It&#39;s impossible for him to first pick a c that is favorable to him and then reverse-engineer a t that would produce the correct result.</p><p>In this way, we transform a ZKP protocol that originally required back-and-forth interaction into a proof format that is “generated once, verifiable by anyone” — this is the so-called NIZK (Non-Interactive Zero-Knowledge) proof. The commonly seen zk-SNARK in the blockchain world relies on this method to achieve the foundation for large-scale verification.</p><h4>ZKP and Blockchain</h4><p>One of the most exciting applications of ZKP is in the blockchain.</p><p>The essence of a blockchain is public transparency; every transaction is laid bare under the sun. But this design also creates privacy limitations: every address, every payment, every message is public.</p><p>This is where ZKP can play a key role. It allows us to “only prove that something is true” on the chain, without disclosing the details — just like only showing the “I am an adult” proof, instead of the whole ID card.</p><p>This characteristic brings two revolutionary values:</p><ul><li><strong>Privacy:</strong> Verifying conditions without revealing content (e.g., anonymous transactions in Zcash, identity verification with ZK-DID).</li><li><strong>Scaling:</strong> Believing that large-scale off-chain computations are correct by just verifying a tiny ZK proof (e.g., zk-Rollups).</li></ul><p>For this reason, ZKP has become one of the most critical foundational technologies in the blockchain world.</p><h4>Next time: Let’s Write a ZK Proof</h4><p>ZK sounds magical, so how is it implemented? What tools are needed, what circuits need to be written, and what steps are executed?</p><p>In the next article, we will use Circom + snarkjs to build a ZK proof system: How to prove “I am over 18,” without telling you my age?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f87b812e2877" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Midnight: A blockchain that strikes a balance between freedom, privacy and compliance]]></title>
            <link>https://medium.com/@zero5011/midnight-a-blockchain-that-strikes-a-balance-between-freedom-privacy-and-compliance-62270eccb57b?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/62270eccb57b</guid>
            <category><![CDATA[blockchain-technology]]></category>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[midnight]]></category>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 10:09:49 GMT</pubDate>
            <atom:updated>2025-07-24T10:09:49.947Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EgmUQTHlib6t7Ej3.png" /></figure><p>In the minds of most people, blockchain is a “decentralized and transparent” technology. The Bitcoin ledger can be viewed by anyone, and the contracts and transaction content on Ethereum are completely visible. This openness brings trust, but it also makes data privacy a difficult problem to solve.</p><p>Imagine you are a patient, and the hospital wants to put your medical records on the blockchain so that doctors everywhere can access them in real time, but these records cannot be publicly exposed. Traditional public chains cannot do this, and private chains cannot comply with government regulations. This is the problem that Midnight wants to solve.</p><p>This is the context in which privacy chains (such as Monero, Zcash) emerged: they focus on transaction anonymity and untraceability, supplementing the privacy deficiencies of mainstream public chains.</p><p>But new problems have also arisen. These “completely anonymous” privacy chains are often regarded as hotbeds for illegal activities such as money laundering and fraud because they cannot meet regulatory requirements. As a result, it is even more difficult for them to enter the formal financial system or large-scale commercial applications.</p><p><strong>Midnight</strong> was born out of this dilemma.</p><p>Midnight is a blockchain led and built by IOG (Input Output Global), the development company behind the Cardano ecosystem. Its core goal is to explore the possibility of “<strong>coexistence of privacy, freedom, and compliance.</strong>”</p><p>It is a blockchain that is designed by default to <strong>allow data to be kept confidential, but also to be verified and disclosed in legitimate situations</strong>.</p><p>This article will give you a preliminary understanding of Midnight’s positioning, design philosophy, and how it differs from other privacy chains (such as Monero, Zcash, and Secret).</p><h3>From Public to Private: Why We Need a Compliant Privacy Chain</h3><p>Midnight is a blockchain specifically designed for<strong> data privacy and regulatory compliance</strong>, launched by Cardano’s development team, IOG. Its emergence is not only a supplement to traditional privacy chains but also a rethinking of the limitations of blockchain data openness.</p><p>In modern applications, much key data is not suitable for public disclosure on the chain: personal identity, medical records, corporate financial reports, government documents… If this information is completely exposed on the chain, it is equivalent to permanently handing over sensitive data to the world for review.</p><p>This will pose challenges for blockchain in fields that highly value data protection, such as healthcare, finance, and government.</p><p>In contrast, although some blockchains specifically designed to handle privacy have emerged, they still face many challenges in terms of scalability and practical application.</p><p>For example, Monero adopts a strong anonymity design that can effectively hide transaction information, but this also makes it difficult to support more advanced application logic. Although Zcash has introduced advanced encryption technology, its high user threshold and limited tool support have resulted in a low proportion of private transactions. As for Secret Network, it relies on a specific hardware environment to execute private contracts, which still poses security and trust risks.</p><p>Midnight has chosen to take a new route: <strong>not to completely hide the data, nor to make it all public</strong>, but to allow the data to be disclosed according to conditions, and to support the logical operation and compliance needs of applications while protecting privacy.</p><p>This design goal is not only important for users but also provides a new way of balancing for developers, enterprises, and even regulatory agencies. Midnight is not just a blockchain; it was born to solve the problem of “how to handle sensitive data safely and legally.”</p><h3>The ACE Freedom Model: Midnight’s Design Philosophy and Value Proposition</h3><p>Behind Midnight’s technical architecture is a clear design philosophy: to defend three basic freedoms of people in the digital age — <strong>Association</strong>, <strong>Commerce</strong>, and <strong>Expression</strong>, or <strong>ACE</strong> for short.</p><p>In recent years, these freedoms have been threatened by large-scale data surveillance, excessive platform censorship, and users having almost no control over their own data.</p><p>Midnight hopes to provide a more secure digital environment through cryptography and decentralized technology:</p><p><strong>Association</strong></p><p>People should be able to freely organize, collaborate, and participate in communities without worrying about their identities being tracked or their speech being monitored. Midnight supports decentralized identity (DID), allowing users to participate in DAO or community interactions through private credentials while maintaining personal privacy.</p><p><strong>Commerce</strong></p><p>In traditional platforms or financial systems, commercial activities are often subject to data censorship, payment audits, and regional blockades. Midnight provides private transactions and conditional disclosure mechanisms, allowing legitimate commercial activities to be conducted safely while protecting both parties’ data from being misused.</p><p><strong>Expression</strong></p><p>Midnight encourages users to speak freely and verifies their eligibility to speak (such as whether they are a member or over a certain age) through ZK assertions without revealing the user’s identity. This allows for anonymous speech while preventing abuse.</p><h3>Midnight’s Technical Foundation: How to Achieve Selective Disclosure and Conditional Authorization</h3><p>To achieve the design goals of “controllable data, protectable privacy, and verifiable compliance,” Midnight does not rely on a single technology stack. Instead, it has made conscious choices from its system architecture, identity model, and contract language to its development experience.</p><p>In this section, we will introduce how Midnight implements “selective disclosure,” “accountable anonymity,” and “conditional authorization” in on-chain applications through a complete set of technical combinations.</p><p><strong>ZK Assertions and Selective Disclosure: Completing Verification While Maintaining Confidentiality</strong></p><p>Midnight uses Zero-Knowledge Proofs (ZKPs) to achieve a special data interaction method:</p><blockquote><em>You can prove that “something is true” without revealing the actual content.</em></blockquote><p>This ability is called a ZK assertion. For example, a user can prove that they are over 18 years old without revealing their date of birth. Or a company can prove that a certain report has been audited without disclosing the content of the report.</p><p>This allows DApps to authorize or deny access based on contract logic without touching or disclosing the sensitive data itself.</p><p><strong>On-Chain Verification, Off-Chain Storage: Separation of Data and Permissions</strong></p><p>Midnight does not put all data on the chain. Instead, it stores the actual data (such as medical records, images, and confidential reports) off-chain and stores the encrypted index and ZK verification conditions (assertions) on-chain. This not only protects privacy but also maintains the openness and transparency of the verification and authorization logic.</p><p><strong>Compact DSL: A Development Tool Tailored for Private Contracts</strong></p><p>Midnight supports private smart contracts. Its core tool is Compact, a Domain-Specific Language (DSL) specially designed for privacy scenarios:</p><ul><li>Developers can write contract logic to define conditions such as “who has the right to read the data” and “when to disclose it.”</li><li>It can be seamlessly integrated with TypeScript, lowering the barrier to entry.</li><li>It provides fine-grained permission control similar to an Access Control List (ACL).</li></ul><p><strong>DID and Attestation Mechanism: Achieving Identity Verification and Compliance Review While Protecting Privacy</strong></p><p>Midnight’s identity model is based on “attestations.” Users can obtain ZK certification from third-party credentialing agencies. This allows the platform to verify identity, limit abuse, and support compliance review without violating privacy:</p><ul><li>Users can prove that they have a certain attribute (such as being a member, government-approved, having a certain level of education, or being of a certain age) without revealing their full identity.</li><li>DID can be combined with contract logic to achieve actions such as attribute-based authorization and tiered access.</li></ul><p>Overall, Midnight’s technical architecture is not a modification of mainstream public chains. Instead, it is designed from first principles to solve the problem of “using blockchain to handle sensitive data in the real world.” It is a new attempt at a privacy chain and a blockchain design that speaks to both institutions and freedom.</p><h3>The Relationship Between Midnight and Cardano</h3><p>Midnight is not a blockchain built from scratch. It is designed and led by IOG, the research and development team behind Cardano, and is closely integrated with the Cardano ecosystem. The relationship between the two can be viewed from the following aspects:</p><p><strong>Sidechain Architecture</strong></p><p>Midnight adopts a sidechain architecture, which means it is an independent chain that operates in parallel with the Cardano mainnet. It has its own consensus mechanism and computing logic but maintains data interoperability with the mainnet through a bridging mechanism.</p><p>This allows Midnight to:</p><ul><li>Use different privacy models and smart contract designs.</li><li>Maintain the security and interoperability of Cardano.</li><li>Write the processing results back to the mainnet, so that mainnet applications can use the results of privacy-protected data.</li></ul><p><strong>Two-Way Bridge</strong></p><p>A two-way bridge will be developed by the official team to allow assets, credentials, and verification messages to move between Midnight and Cardano. For example:</p><ul><li>Users can move ADA to Midnight for private applications.</li><li>The ZK verification results on Midnight can be queried by DApps on Cardano without leaking the data itself.</li></ul><p>This design can achieve a division of labor where “privacy processing is done on Midnight, and public applications are on Cardano.”</p><p><strong>Shared Identity System and Certification</strong></p><p>Midnight will support a decentralized identity (DID) and ZK assertions that are compatible with Cardano. For example:</p><ul><li>A user holds a ZK credential on Midnight stating, “I am over 18 years old.”</li><li>A DApp on Cardano can verify whether this statement is true without knowing who the user is.</li></ul><p>This design makes Midnight a “privacy service layer” in the Cardano ecosystem, supporting functions such as identity verification, authorization, and sensitive data processing.</p><h3>Comparison with Other Privacy Chains: Midnight’s Technical and Compliance Advantages</h3><p>Midnight is not the first chain to attempt to solve the problem of blockchain privacy. Before it, Monero, Zcash, and Secret Network each proposed technical solutions in different directions. However, these solutions still have some limitations in terms of privacy and practicality. The following is a brief comparison of the four chains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hulYZtYcP2_VD3iA.png" /></figure><p>Compared with other chains, Midnight’s key feature is that it does not “<strong>hide as much as possible</strong>” but “<strong>allows data to be controlled and disclosed according to the context</strong>” — this makes it the first privacy chain to consider compliance from its design.</p><h3>Midnight’s Positioning and Challenges: The Long Road from Concept to Ecosystem</h3><p>In today’s world where information is increasingly sensitive and data processing standards are getting higher, how to balance transparency, privacy, and compliance in blockchain has always been a major challenge. The emergence of Midnight is a positive response to this difficult problem.</p><p>It not only breaks through the dilemma of traditional privacy chains being “fully hidden” or public chains being “fully public” but also provides a new balance for individuals, enterprises, and regulatory agencies through programmatic and conditional disclosure. Midnight’s design philosophy and technical practice show us that blockchain has the opportunity to play a greater role in highly sensitive fields such as healthcare, finance, and identity verification.</p><p>Of course, such a vision is also accompanied by many challenges. The development language, privacy model, and contract logic adopted by Midnight are all different from mainstream blockchains. This means that developers need time to learn, and users and enterprises must also gradually build trust in this new type of interaction, “selective disclosure.” As a sidechain of Cardano, Midnight’s performance and reliability will also directly affect the feasibility and adoption speed of mainnet applications.</p><p>In the future, with the improvement of compliance requirements and privacy awareness, Midnight may promote the further development of the industry ecosystem and promote blockchain to truly become a bridge connecting freedom and responsibility, innovation and regulation.</p><h3>Reference</h3><ul><li><a href="https://midnight.network/">https://midnight.network</a></li><li><a href="https://docs.midnight.network/">https://docs.midnight.network/</a></li><li><a href="https://docs.midnight.network/learn/introduction/what-is-midnight/why-midnight">https://docs.midnight.network/learn/introduction/what-is-midnight/why-midnight</a></li><li><a href="https://www.youtube.com/watch?v=1J3zwftYLPo">https://www.youtube.com/watch?v=1J3zwftYLPo</a></li><li><a href="https://docs.midnight.network/develop/compact/overview">https://docs.midnight.network/develop/compact/overview</a></li><li><a href="https://docs.midnight.network/develop/zk-assertions/overview">https://docs.midnight.network/develop/zk-assertions/overview</a></li><li><a href="https://docs.scrt.network/">https://docs.scrt.network</a></li><li><a href="https://z.cash/technology/">https://z.cash/technology/</a></li><li><a href="https://www.getmonero.org/">https://www.getmonero.org</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62270eccb57b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[用 zk-SNARK 實現 Zero-Knowledge Proof]]></title>
            <link>https://medium.com/@zero5011/%E7%94%A8-zk-snark-%E5%AF%A6%E7%8F%BE-zero-knowledge-proof-09995dbd7f1c?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/09995dbd7f1c</guid>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[zksnark]]></category>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 08:47:24 GMT</pubDate>
            <atom:updated>2025-07-24T09:55:27.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t1jfMnBASadTDgKetrpC2w.png" /></figure><p>零知識簡明非互動知識論證 (ZK-SNARK) 是當代密碼學領域最具突破性的技術之一 。它允許一方（證明者）向另一方（驗證者）證明其擁有某個秘密知識，而無需透露秘密本身 。</p><p>本文旨在提供一份入門的技術解析，通過一個具體的數學範例，完整呈現 ZK-SNARK 從一個普通計算問題到最終密碼學證明的<strong>四大核心轉換過程</strong>，帶領讀者透徹理解其科學原理。</p><p>我們將以一個簡單而完整的範例來貫穿始終：</p><blockquote><strong><em>證明者宣稱：我知道一個秘密整數 </em></strong><strong><em>x，使得 x3+x+5=35 成立</em></strong><em> 。</em></blockquote><p>在這裡，計算函式 f(x)=x³+x+5 和公開輸出 35 是公開資訊，而秘密見證 w 就是 x 的值 。</p><h3>ZK-SNARK的四個轉換</h3><h4>轉換一：從任意運算到算術電路 (ARCS)</h4><p><strong>目標：將計算邏輯「代數化」</strong></p><p>所有在多項式時間內可完成的程式，都可以等價轉換為「算術電路可滿足性問題 (Arithmetic Circuit Satisfiability, ARCS)」。這一步的核心是將任何複雜的計算函式，分解為一系列僅包含基礎加法和乘法運算的「門」，從而將程式邏輯轉化為代數結構 。</p><p>對於我們的範例 f(x)=x³+x+5，我們可以將其「扁平化」為以下基礎步驟（門）：</p><ol><li>out_1 = x * x (計算 x²)</li><li>out_2 = out_1 * x (計算 x³)</li><li>out_3 = out_2 + x (計算 x³+x)</li><li>y = out_3 + 5 (計算 x³+x+5)</li></ol><h4>轉換二：從算術電路到 R1CS (Rank-1 Constraint System)</h4><p><strong>目標：將電路結構「形式化」</strong></p><p>有了電路的代數藍圖，下一步是將這個圖形結構轉換為一種更適合數學處理的形式化表達 — 「一階約束系統 (R1CS)」。R1CS 的目標是將每個運算門轉換為一個標準格式的約束，以便後續進行統一處理 。</p><p><strong>1. 見證向量 (Witness Vector)</strong></p><p>見證向量 S 是一個包含了計算過程中所有變數值的向量，包括常數 1、私有輸入、公開輸出以及所有中間變數 。</p><p>在我們的範例中，當 x=3 時，見證向量 S 的構成是 [1, x, y, out_1, out_2, out_3]，其值為：S=[1,3,35,9,27,30]</p><p><strong>2. R1CS 約束</strong></p><p>每個 R1CS 約束都由三個向量 (A,B,C) 組成，它們必須滿足以下方程式：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/1*Vl3-5FXOvpCUAZryEXmS7g.png" /></figure><p>這三個向量的作用是從見證向量 S 中「挑選」出正確的數值來驗證每個門的運算是否正確 。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5dg4SdKB9YYcqUwDFt93Q.png" /></figure><p><strong>轉換三：從 R1CS 到 QAP (Quadratic Arithmetic Program)<br>目標：將離散約束「多項式化」</strong></p><p>為了極大地提升驗證效率，我們需要將多個離散的 R1CS 約束，轉換為一個單一的、連續的多項式問題 。這個過程稱為「二次算術程式 (QAP)」，其核心工具是「拉格朗日插值法」，它能將 R1CS 矩陣的列轉換為多項式 。</p><p>最終，我們將得到三組基礎多項式：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*uDKXi__ttDmtyJMt5WiYHw.png" /></figure><p>QAP 的核心約束是一個單一的多項式可除性問題：</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7e4a4hYdPpnwk1o6m2N67w.png" /></figure><p>這個方程式的意義是：如果證明者的見證 S 是正確的，那麼他組合出的多項式</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*zXfvjyT83kXgFfIab94VaQ.png" /></figure><p>在 x=1,2,3,4 這些點上的值必然為 0，因此 P(x) 必然能被 Z(x) 整除 。</p><p><strong>轉換四：使用密碼學進行概率性驗證 (NP 問題的證明)<br>目標：實現「零知識」驗證</strong></p><p>現在，問題變成了如何驗證上述多項式等式，同時不洩漏證明者的秘密見證 S 。這一步引入了橢圓曲線密碼學，將多項式問題的證明，轉換為對橢圓曲線離散對數點的驗證 。</p><p>證明方將多項式係數放到橢圓曲線點上，形成離散對數困難；而驗證方則對這些點進行運算，重構整除關係，從而驗證證明的正確性 。</p><blockquote><strong>階段一：信任設置與公共參數生成<br></strong>此階段的目標是創造一套加密的「遊戲規則」，這套規則由一個受信任的方式生成，過程中使用的秘密將被徹底銷毀 。</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*64LPW9u8tME483g_ixrPAQ.png" /></figure><blockquote><strong>階段二：證明生成 (加密計算)</strong><br>此階段由證明者執行，目標是利用他的秘密見證和證明金鑰，生成一個簡潔的證明 π 。</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x3umX-KQXRpw-TbsuF1Rhw.png" /></figure><blockquote><strong>階段三：證明驗證<br></strong>此階段由驗證者執行，目標是快速驗證證明的有效性 。</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o3_rZ5Wpda7tC5Hn-yTMKw.png" /></figure><h3>參考資料與延伸閱讀</h3><ul><li><a href="https://www.youtube.com/watch?v=TQjzKAkHFls">https://www.youtube.com/watch?v=TQjzKAkHFls</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09995dbd7f1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[如何不說出我的年齡下，證明我已滿18歲：初探零知識證明 (Zero Knowledge Proof)]]></title>
            <link>https://medium.com/@zero5011/%E5%A6%82%E4%BD%95%E4%B8%8D%E8%AA%AA%E5%87%BA%E6%88%91%E7%9A%84%E5%B9%B4%E9%BD%A1%E4%B8%8B-%E8%AD%89%E6%98%8E%E6%88%91%E5%B7%B2%E6%BB%BF18%E6%AD%B2-%E5%88%9D%E6%8E%A2%E9%9B%B6%E7%9F%A5%E8%AD%98%E8%AD%89%E6%98%8E-zero-knowledge-proof-8273d77b46ad?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/8273d77b46ad</guid>
            <category><![CDATA[zero-knowledge-proofs]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Wed, 09 Jul 2025 03:54:43 GMT</pubDate>
            <atom:updated>2025-07-09T05:44:32.140Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkalMf28vVJ-nDHQoXRXlA.png" /></figure><blockquote><em>你有沒有想過，怎麼證明一件事是真的，卻不告訴別人其他件事？ 比如，你想進酒吧，就要證明自己已滿18歲，但你不想告訴守衛你的年齡。</em></blockquote><p>零知識證明 (Zero Knowledge Proof，簡稱 ZKP) 就是為了解決這類問題而誕生的技術。</p><h4>什麼是 ZKP？</h4><p>想像你站在夜店門口，守衛問你：「你滿18了嗎？」</p><p>你可以選擇拿出你的身分證，讓他知道你的所有資訊──生日、姓名、地址、血型……一覽無遺，只為了證明一件事：你已經成年了。</p><p>但你也可以只遞給他一張簡單的證明紙條，上面寫著：「這個人已滿18歲」，除此之外什麼都沒有。</p><p>ZKP 就是這樣的魔法：你能讓對方相信你符合條件，卻不需要告訴他你是誰、你幾歲，甚至什麼時候出生。</p><p>簡單來說，ZKP 是一種「我知道這個秘密，但我不會告訴你是什麼，但你可以確信我知道」的證明方式。</p><h4>現實世界範例：從「機率」看懂 ZKP 精神的數獨證明</h4><p>讓我們從一個直觀的例子來理解 ZKP 的核心精神。這個範例能幫助你建立對 ZKP「完整性、健全性、零知識」三大特性的初步認知。</p><p>假設 Alice 說自己解出了一個極難的數獨，但不想把完整的答案直接給 Bob 看。她要如何證明自己真的有答案呢？</p><ol><li><strong>「置換」與「承諾」：</strong> <br>Alice 會把整個數獨解法中的數字隨機打亂（例如，1 換成 9，2 換成 5……），生成一個新的對應關係後，再重新填寫成一張新的數獨表。 接著，她會將這張打亂後的數獨藏在一堆密封的信封或遮蓋紙後面，讓 Bob 無法一次看到整張解答。這就像是她做出一個「承諾」，表明答案已經固定且不可更改</li><li><strong>「挑戰」：<br></strong>Bob 可以從這些遮蔽中隨機選一個部分（例如某一行、某一列或某一個 3x3 區塊）要求揭示。他無法預知或控制 Alice 如何「置換」數字，也無法指定揭示特定原始數字的位置，只能隨機抽取</li><li><strong>「驗證」：<br></strong>Alice 就打開 Bob 所選的部分，讓 Bob 檢查這些數字是否符合數獨規則（例如，揭示的行/列/區塊內沒有重複的數字）</li></ol><p>如果 Alice 根本沒有完整答案，她只是隨便亂填，那麼 Bob 的抽查有很高的機率會抓到她作弊（例如，打開一行發現有兩個數字 5）。</p><p><strong>重複驗證，建立信心：</strong> Alice 每次都重新打亂數字並遮蓋，再讓 Bob 任意抽查不同區塊，如此重複 30 次。如果 Alice 在這 30 次中都能通過檢查，Bob 就可以有非常高的信心，相信 Alice 確實有一份合法的數獨解法。</p><p><strong>這個例子完美地展示了 ZKP 的三大特性：</strong></p><ul><li><strong>完整性 (Completeness)：</strong> 如果證明者（Alice）真的擁有秘密（數獨解法），她總能成功通過驗證。</li><li><strong>健全性 (Soundness)：</strong> 如果證明者（Alice）沒有秘密（沒有解出數獨），她欺騙驗證者（Bob）的機率將非常非常小。每多一次成功驗證，作弊的機率就呈指數級下降。</li><li><strong>零知識 (Zero-Knowledge)：</strong> 在整個過程中，驗證者（Bob）除了知道證明者「有解」之外，完全沒有獲得關於數獨解法的任何新資訊。他只看到了置換後的局部，無法從中推斷出原始解法。</li></ul><p>但我們也要理解，這個數獨例子是透過數十次的抽查，Bob 得到的是一種「壓倒性的機率相信」，而不是 100% 的數學確定性。而像接下來我們要介紹的 Schnorr 協議等密碼學證明，則是將這種「相信」，提升到了基於數學難題的、<strong>密碼學等級的確定性</strong>。</p><h4>簡單的 ZKP：Schnorr 協議</h4><p>那麼，這種魔法般的證明是怎麼用數學實現的呢？讓我們用一個「魔法鎖與鑰匙」的比喻，並加上一些數學式來理解。</p><ul><li>你有一個秘密 x（<strong>你的秘密鑰匙</strong>）。</li><li>你用一個公開的模具 g，和你的秘密鑰匙 x，打造出一個專屬於你的鎖 y。數學上寫成 y = g^x。所有人都看得到這個鎖 y，但無法從鎖倒推出你的鑰匙 x。</li></ul><p>現在，你要向守衛證明你擁有鑰匙 x，但絕不能把鑰匙直接給他看。</p><p>Schnorr 協議的流程就像這樣：</p><ol><li><strong>證明者 (Prover) 的第一步：做出承諾<br></strong>你先隨機打造一把「一次性鑰匙」r，並用同樣的模具 g 做出一個「一次性鎖頭」t (也就是 t = g^r)。你把這個<strong>一次性鎖頭 </strong><strong>t</strong> 公開交給守衛。這一步像是在說：「看，我已經鎖定我這次要用的隨機數了，不能再改了。」</li><li><strong>驗證者 (Verifier) 的挑戰<br></strong>守衛為了防止你預先準備好答案來騙他，他給你一個<strong>隨機的挑戰數字 </strong><strong>c</strong>。</li><li><strong>證明者的回應<br></strong>你收到挑戰 c 後，用一個神奇的公式，把你原來的「秘密鑰匙」x 和那把「一次性鑰匙」r 結合起來，算出最終的答案 s。公式是 s = r + c·x。請注意，因為 s 裡面混合了隨機的 r，所以守衛無法從 s 直接反解出你的秘密 x。</li><li><strong>驗證者的驗證<br></strong>守衛拿到你給的最終答案 s 後，他不需要知道你的秘密 x，只需要用他手上有的所有公開資訊（你的專屬鎖 y、你給的一次性鎖頭 t、他自己出的挑戰 c）和你的答案 s，放進一個最終驗證公式裡：g^s 是否等於 t · y^c？</li></ol><p>神奇的是，由於指數的魔法 (g^(r + c·x) = g^r · (g^x)^c = t · y^c)，這個等式只有在證明者真的知道秘密 x 的情況下才會成立。</p><p>如此一來，你就成功地在不洩漏秘密 x 的情況下，證明了你擁有它。</p><h4>從互動到非互動 — Fiat-Shamir 轉換</h4><p>Schnorr 協議雖然簡單，但每一次證明都需要來回互動，這在區塊鏈這種非同步的環境下很不方便。於是，密碼學家想出一個聰明的辦法：能不能讓證明者自己模擬出一個公平的 challenge，而不用真的找一個人來出題？這個點子，就叫做 <strong>Fiat-Shamir 轉換</strong>。</p><p>Fiat-Shamir 的核心概念是：與其等待驗證者出 challenge，不如將 challenge 的來源，交給一個絕對公正、無法被任何人操控的「<strong>數位指紋攪拌機</strong>」 — — 也就是 <strong>Hash 函數</strong>。</p><p><strong>什麼是 Hash 函數？</strong></p><p>想像一個神奇的攪拌機：</p><ul><li><strong>單向性</strong>：你可以把《哈利波特》整本小說丟進去，得到一杯獨一無二的「小說果汁」(Hash 值)。但任何人都不可能從這杯果汁，還原出原來的小說。</li><li><strong>防碰撞性 (雪崩效應)</strong>：只要小說內容改動一個標點符號，攪出來的果汁味道就會天差地遠，完全不同。</li><li><strong>確定性</strong>：同樣的內容，不管攪拌幾次，出來的果汁永遠一模一樣。</li></ul><p>有了這個工具，流程就變成：</p><ol><li>證明者算出 t = g^r</li><li>證明者不再等待驗證者，而是自己將 t（以及其他像 g, y 等公開資訊）一起丟進 Hash 攪拌機，生成一個誰也無法預測的 challenge c。也就是 c = Hash(g, y, t)</li><li>證明者再用這個自己生成的 c，算出最終答案 s = r + c·x</li></ol><blockquote>你可能會懷疑：「自己生成 challenge，不就可以作弊了嗎？」</blockquote><p>不行，這正是這個設計的巧妙之處。因為流程有嚴格的先後順序：證明者必須先「承諾」並公開 t。他一旦交出了 t，就如同把一個鎖好的箱子交給了公證人，無法再更改。</p><p>接著，他才能根據這個 t 去計算出 c。由於 Hash 函數的雪崩效應，他完全無法預測 t 會攪拌出什麼樣的 c。他不可能先選好一個對自己有利的 c，再反推出一個能湊出正確結果的 t。</p><p>這樣一來，我們就把原本需要來回互動的 ZKP 協議，轉換成一種「一次產出，任何人都能驗證」的證明格式──這就是所謂的 NIZK（Non-Interactive Zero-Knowledge），非互動式 ZKP。區塊鏈世界裡常見的 zk-SNARK，就是靠這種方式，實現大規模驗證的基礎</p><h4>ZKP 與區塊鏈</h4><p>ZKP 最令人興奮的應用之一，就在區塊鏈。</p><p>區塊鏈的本質是公開透明，每一筆交易都攤在陽光下。但這樣的設計也造成了隱私上的限制：每個地址、每筆付款、每個訊息都是公開的。</p><p>這時，ZKP 就能扮演關鍵角色。</p><p>它讓我們可以在鏈上「只證明某件事為真」，卻不公開細節──就像只出示「我已成年」的證明，而不是整張身分證。</p><p>這特性帶來了兩個革命性的價值：</p><ul><li><strong>隱私</strong>：在不揭露內容的前提下驗證條件（如 Zcash 的匿名交易、ZK-DID 的身分驗證）</li><li><strong>擴容</strong>：只需驗證小小的 ZK 證明，就能相信大規模的鏈下運算是正確的（如 zk-Rollup）</li></ul><p>也因此，ZKP 成為區塊鏈世界最關鍵的基礎技術之一。</p><h4>下一篇：我們動手寫一個 ZK 證明</h4><p>ZK 聽起來很神奇，那它到底怎麼實作？需要哪些工具、寫哪些電路、執行哪些步驟？</p><p>在下一篇，我們會用 Circom + snarkjs 打造一個 ZK 證明系統：</p><blockquote><em>如何證明「我已滿 18 歲」，卻不告訴你我幾歲？</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8273d77b46ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Midnight：在自由、隱私與合規之間尋找平衡的區塊鏈]]></title>
            <link>https://medium.com/@zero5011/midnight-%E5%9C%A8%E8%87%AA%E7%94%B1-%E9%9A%B1%E7%A7%81%E8%88%87%E5%90%88%E8%A6%8F%E4%B9%8B%E9%96%93%E5%B0%8B%E6%89%BE%E5%B9%B3%E8%A1%A1%E7%9A%84%E5%8D%80%E5%A1%8A%E9%8F%88-3b49c7dcd963?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b49c7dcd963</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[midnight]]></category>
            <category><![CDATA[crypto]]></category>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Tue, 01 Jul 2025 01:38:33 GMT</pubDate>
            <atom:updated>2025-07-01T01:38:33.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IgMZ3sY2aGoFmeIzjU5j8w.png" /><figcaption>Image generated with AI</figcaption></figure><p>在多數人的印象中，區塊鏈是一種「去中心化且透明」的技術。比特幣帳本可以被任何人查閱，以太坊上的合約和交易內容一覽無遺。這樣的公開性帶來了信任，但也讓資料隱私成為一個難以解決的問題。</p><p>想像你是一位病患，醫院希望將你的病歷放到區塊鏈上，讓各地醫師可以即時調閱，但這些紀錄不能被公開曝光。傳統公鏈做不到，私密鏈又無法配合政府合規。這就是 Midnight 想解決的問題。</p><p>這正是隱私鏈（如 Monero、Zcash）出現的背景：主打交易匿名性與不可追蹤性，補足主流公鏈在隱私上的不足。</p><p>但新的問題也隨之而來。這類「完全匿名」的隱私鏈，往往因無法配合監管要求，而被視為洗錢、詐騙等非法行為的溫床。結果是，它們反而更難進入正規金融體系或大型商業應用。</p><p>在這樣的兩難之中，<strong>Midnight</strong> 應運而生。</p><p>Midnight 是由 Cardano 生態系背後的開發公司 IOG（Input Output Global）主導打造的一條區塊鏈，核心目標是探索一種「<strong>隱私、自由與合規可以共存</strong>」的可能。</p><p>它是一種設計上就預設：<strong>資料可以保密，但也能在合法情境中被驗證與揭露</strong>的區塊鏈。</p><p>這篇文章將帶你初步了解 Midnight 的定位、設計理念與它如何與其他隱私鏈（如 Monero、Zcash、Secret）不同。</p><h3>從公開到私密：為什麼需要一條兼顧合規的隱私鏈</h3><p>Midnight 是一條專門為<strong>資料隱私與法規合規</strong>所設計的區塊鏈，由 Cardano 的開發團隊 IOG 推出。它的出現，不只是對傳統隱私鏈的補足，更是一種對區塊鏈資料公開性限制的重新思考。</p><p>在現代應用中，許多關鍵資料並不適合上鏈公開：個人身份、醫療紀錄、企業財報、政府文件……如果這些資訊完全暴露在鏈上，就等於將敏感資料永久地交給全世界審視。</p><p>這將使區塊鏈在醫療、金融、政府等高度重視資料保護的領域面臨挑戰。</p><p>相對地，雖然已有一些專門處理隱私的區塊鏈出現，但它們在可擴展性與實務應用上，仍面臨不少挑戰。</p><p>例如 Monero 採用了強匿名性設計，能有效隱藏交易資訊，但也因此難以支援更進階的應用邏輯。Zcash 雖然引入了先進的加密技術，但使用門檻高、工具支援有限，真正使用私密交易的比例偏低。至於 Secret Network，則仰賴特定硬體環境來執行私密合約，仍存在安全與信任風險。</p><p>Midnight 則選擇走一條新的路線：<strong>不是把資料完全藏起來，也不是全部公開</strong>，而是讓資料能夠根據條件進行揭露，並在保護隱私的前提下，支援應用程式的邏輯運作與合規需求。</p><p>這種設計目標，不只對使用者重要，也為開發者、企業、甚至監管機關提供了一種新的平衡方式。Midnight 不只是一條區塊鏈，它是為了解決「<strong>如何安全且合法地處理敏感資料</strong>」這個問題而誕生的。</p><h3>ACE 自由模型：Midnight 的設計哲學與價值主張</h3><p>Midnight 的技術架構背後，有一個明確的設計哲學：捍衛人們在數位時代中的三項基本自由 — — <strong>結社自由（Association）、商業自由（Commerce）、表達自由（Expression）</strong>，簡稱 ACE。</p><p>近年在資料被大規模監控、平台擁有過多審查權力、使用者對自己資料幾乎毫無控制權的情況下，這些自由正面臨威脅。</p><p>Midnight 希望透過密碼學與去中心化技術，提供一種更具保障的數位環境：</p><p><strong>結社自由（Association）<br></strong>人們應該能夠自由組織、協作、參與社群，而不必擔心身份被追蹤、發言被監控。Midnight 支援去中心化身份（DID），用戶可透過私密憑證參與 DAO 或社群互動，同時保有個人隱私。</p><p><strong>商業自由（Commerce）</strong><br>在傳統平台或金融體系中，商業行為往往受到資料審查、支付審核、地區封鎖等限制。Midnight 提供私密交易與條件揭露機制，讓合法的商業行為可以安全進行，同時保護雙方資料不被濫用。</p><p><strong>表達自由（Expression）</strong><br>Midnight 鼓勵用戶自由發言，並透過 ZK assertions 驗證發言資格（如是否具會員身分、是否超過某年齡），而不揭露使用者本人。這讓言論空間可以匿名進行，同時避免濫用。</p><h3>Midnight 的技術基礎：如何實現選擇性揭露與條件授權</h3><p>為了實現「資料可控、隱私可守、合規可驗」這樣的設計目標，Midnight 並非單靠單一技術堆疊，而是從系統架構、身份模型、合約語言到開發體驗，都做出了有意識的選擇。</p><p>在這一節，我們將介紹 Midnight 如何透過一套完整的技術組合，把「選擇性揭露」、「可問責的匿名性」與「條件式授權」落實到鏈上應用之中。</p><h4>ZK Assertions 與選擇性揭露：保密中完成驗證</h4><p>Midnight 採用零知識證明（Zero-Knowledge Proofs, ZKPs）來實現一種特殊的資料互動方式：</p><blockquote><em>你可以證明「某事為真」，但無需揭露實際內容。</em></blockquote><p>這種能力被稱為 ZK assertion，舉例來說用戶可以證明自己年滿 18 歲，但不必揭露出生年月日。或是企業可以證明某份報表經過審核，但不必公開報表內容。</p><p>這讓 DApp 能根據合約邏輯授權或拒絕存取，而不需接觸或揭露敏感資料本身。</p><h4>鏈上驗證、鏈下儲存：資料與權限的分離設計</h4><p>Midnight 不將所有資料上鏈，而是透過<strong>鏈下儲存實際資料</strong>（如醫療紀錄、影像、機密報告），<strong>鏈上儲存加密索引與 ZK 驗證條件</strong>（assertions）的方式。這樣做既保護了隱私，也保有驗證與授權邏輯的公開性與透明性。</p><h4>Compact DSL：為私密合約量身打造的開發工具</h4><p>Midnight 支援私密智能合約。其核心工具是 Compact，一種特別設計給隱私場景的 DSL（Domain-Specific Language）：</p><ul><li>開發者可撰寫合約邏輯來定義「誰有權讀取資料」、「揭露時機」等條件</li><li>可與 TypeScript 無縫整合，降低上手門檻</li><li>提供類似 ACL（Access Control List）的細緻權限控管</li></ul><h4>DID 與聲明機制：在保護隱私下實現身份驗證與合規審查</h4><p>Midnight 的身份模型以「聲明」為基礎，用戶可以透過第三方憑證機構獲得 ZK 認證，這讓平台在不違反隱私的情況下，仍能驗證身份、限制濫用與支援合規審查：</p><ul><li>不需透露完整身份，也能證明自己具備某項屬性（如：會員、政府核可、學歷、年齡等）</li><li>DID 可與合約邏輯結合，做到依屬性授權、分級存取等行為</li></ul><p>整體而言，Midnight 的技術架構不是從主流公鏈改造而來，而是從第一原則出發，為了解決「在現實世界中使用區塊鏈處理敏感資料」這個問題而設計。它是隱私鏈的一種新嘗試，也是一種<strong>向制度與自由同時對話的區塊鏈設計</strong>。</p><h3>Midnight 與 Cardano 的關係</h3><p>Midnight 並不是從零打造的區塊鏈，它是由 Cardano 背後的研發團隊 IOG 所主導設計，並與 Cardano 生態系有密切整合。兩者的關係，可以從以下幾個層面來看：</p><p><strong>Sidechain 架構<br></strong>Midnight 採用 Sidechain（側鏈）架構，意即它是一條與 Cardano 主鏈平行運作的獨立鏈，擁有自己的共識機制與運算邏輯，但透過橋接機制與主鏈保持資料互通。</p><p>這讓 Midnight 可以：</p><ul><li>使用不同的隱私模型與智能合約設計</li><li>保有 Cardano 的安全性與互操作性</li><li>將處理結果回寫至主鏈，讓主鏈應用能使用經隱私保護的資料結果</li></ul><p><strong>雙向橋接（Two-Way Bridge）<br></strong>Midnight 與 Cardano 之間會透過官方開發的橋接機制，讓資產、憑證、驗證訊息可以在兩鏈間移動。例如：</p><ul><li>使用者可以將 ADA 移入 Midnight，用於私密應用</li><li>Midnight 上的 ZK 驗證結果可供 Cardano 上的 DApp 查詢，但不洩漏資料本體</li></ul><p>這樣的設計可實現「隱私處理在 Midnight、公開應用在 Cardano」的分工模式。</p><p><strong>共享身份系統與認證<br></strong>Midnight 將支援與 Cardano 相容的 去中心化身份（DID） 與 ZK assertions，例如：</p><ul><li>使用者在 Midnight 上持有「我已年滿 18 歲」的 ZK 憑證</li><li>Cardano 上的 DApp 可以驗證此聲明是否真實，而不需要知道使用者是誰</li></ul><p>這種設計讓 Midnight 成為 Cardano 生態中的一個「隱私服務層」，支援身份驗證、授權、敏感資料處理等功能。</p><h3>與其他隱私鏈的比較：Midnight 的技術與合規優勢</h3><p>Midnight 並不是第一條試圖解決區塊鏈隱私問題的鏈。在它之前，Monero、Zcash 和 Secret Network 各自提出了不同方向的技術解法。不過，這些方案在隱私與實用性之間仍存在一些限制。以下是四條鏈的簡要比較。</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AixHLZuS9bGqNM40tggKOw.png" /></figure><p>與其他鏈相比，Midnight 的關鍵特點在於它不是「盡量隱藏」，而是「讓資料根據情境控制揭露」 — — 這讓它成為第一條從設計就考慮合規性的隱私鏈。</p><h3>Midnight 的定位與挑戰：從理念落地到生態建立的長路</h3><p>在今日資訊越來越敏感、資料處理標準越來越高的世界裡，區塊鏈如何兼顧透明、隱私與合規，始終是一大挑戰。Midnight 的出現，正是對這一難題的積極回應。</p><p>它不僅突破了傳統隱私鏈「全隱藏」或公鏈「全公開」的兩難，更以程式化、條件式揭露的方式，為個人、企業與監管機構提供了新的平衡點。Midnight 的設計理念與技術實踐，讓我們看見區塊鏈有機會在醫療、金融、身份驗證等高度敏感領域發揮更大作用。</p><p>當然，這樣的願景也伴隨不少挑戰。Midnight 採用的開發語言、隱私模型與合約邏輯，都與主流區塊鏈有所不同。這代表開發者需要時間學習，用戶與企業也必須逐步建立起對「選擇性揭露」這類新型互動方式的信任。而作為 Cardano 的側鏈，Midnight 的效能與可靠性也將直接影響主鏈應用的可行性與採納速度。</p><p>未來，隨著合規需求與隱私意識的提升，Midnight 或許將推動產業生態進一步發展，促使區塊鏈真正成為連接自由與責任、創新與規範的橋樑。</p><h3>參考資料與延伸閱讀</h3><ul><li><a href="https://midnight.network/">https://midnight.network</a></li><li><a href="https://docs.midnight.network/">https://docs.midnight.network/</a></li><li><a href="https://docs.midnight.network/learn/introduction/what-is-midnight/why-midnight">https://docs.midnight.network/learn/introduction/what-is-midnight/why-midnight</a></li><li><a href="https://www.youtube.com/watch?v=1J3zwftYLPo">https://www.youtube.com/watch?v=1J3zwftYLPo</a></li><li><a href="https://docs.midnight.network/develop/compact/overview">https://docs.midnight.network/develop/compact/overview</a></li><li><a href="https://docs.midnight.network/develop/zk-assertions/overview">https://docs.midnight.network/develop/zk-assertions/overview</a></li><li><a href="https://docs.scrt.network/">https://docs.scrt.network</a></li><li><a href="https://z.cash/technology/">https://z.cash/technology/</a></li><li><a href="https://www.getmonero.org/">https://www.getmonero.org</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b49c7dcd963" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[初探 Oracle（預言機）]]></title>
            <link>https://medium.com/@zero5011/%E5%88%9D%E6%8E%A2-oracle-%E9%A0%90%E8%A8%80%E6%A9%9F-2f3590f81d97?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f3590f81d97</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[oracle]]></category>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Mon, 23 Jun 2025 01:45:55 GMT</pubDate>
            <atom:updated>2025-06-23T01:45:55.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*Frg_EA7UmGZj99NB19zusA.png" /></figure><p>Oracle 是把區塊鏈和外部世界連起來的「資料傳輸層」。這篇文章會從什麼是 Oracle、為什麼需要它、它的結構到目前主流的做法，帶你快速上手，特別適合第一次接觸預言機的人。</p><h3>1. Oracle 是什麼</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eH04VI2FjlI3H_aBTsvsxQ.png" /></figure><p>Oracle 是 <strong>鏈外 (off-chain) 資料與鏈上 (on-chain) 智慧合約之間的中介層</strong>。因為區塊鏈節點必須以確定的方式重播每一筆交易，所以合約本身沒辦法直接去拿外部的資料 — — 不管是 HTTP API、資料庫、感測器還是其他協議都一樣。</p><p>Oracle 的基本流程可以這樣理解：</p><ol><li><strong>離鏈節點（off-chain worker）</strong> 先去抓或計算需要的資料</li><li>再把結果簽名、整理或驗證好，<strong>提交一筆交易或事件</strong>寫進區塊鏈</li><li>智慧合約則用 read-only 函式或 callback 去讀這些資料，然後做後續的處理</li></ol><p>這樣一來，區塊鏈就能在不破壞原本規則的情況下，把「外面的資訊」帶進鏈上應用。</p><h3>2. 為什麼需要 Oracle</h3><p>如果區塊鏈不能取得外部資料，很多重要應用就沒辦法運作。Oracle 就是用來補這個缺，主要解決三種需求：</p><ul><li><strong>資料依賴性<br>- </strong>DeFi 清算與抵押率計算需要即時價格<br>- 保險協議判斷氣象指標決定賠付<br>- GameFi 需要可驗證隨機數確保公平</li><li><strong>安全與可審計</strong><br>- 資料經 Oracle 上鏈後，任何節點皆可重播並驗證來源<br>- 降低單點失真或竄改風險<br>- 提供完整審計軌跡</li><li><strong>自動化執行</strong><br>- Oracle 節點 24 小時監聽鏈上事件<br>- 自動撰寫結果交易，移除人工干預<br>- 縮短延遲並降低操作錯誤</li></ul><p>有了 Oracle，智慧合約才能和現實世界的資訊互動，DeFi、保險、遊戲、跨鏈服務這些應用才能真正落地。</p><h3>3. 一個 Oracle 系統應具備的五個要素</h3><h4><strong>Data source</strong></h4><p>Oracle 的起點是資料來源。這些來源可以是金融市場的即時報價 API、官方天氣平台、感測器回報、甚至經過密碼學證明的 HTTPS 回應。</p><p>資料來源的選擇與信任程度，會直接影響 Oracle 的可用性與可靠性。設計時要考慮怎麼應對 API 異常、停機或惡意干擾等情況，也要定義資料的更新頻率和可信程度。</p><h4><strong>Off-chain worker</strong></h4><p>鏈下的工作節點負責定期擷取與處理資料。這些節點通常是一段跑在伺服器上的程式，會處理重試邏輯、資料清洗、格式轉換、異常排除與簽名等步驟。</p><p>多數 Oracle 系統會支援多節點部署，讓它們可以同時運作。這樣可以避免單點故障，也方便後續做資料聚合。</p><h4><strong>On-chain contract</strong></h4><p>智慧合約負責保存上鏈資料並提供查詢或回呼（callback）功能。以價格 Oracle 為例，常見的合約方法如 latestRoundData() 或 getAnswer() 允許其他合約讀取最新價格。有些系統採用 push 模式主動將資料寫入目標合約，有些則是由消費者發起查詢並觸發資料更新請求。合約亦可實作驗證與授權邏輯，例如只允許白名單節點更新。</p><h4><strong>Aggregation / validation</strong></h4><p>當有多個節點提供資料時，系統必須具備處理與聚合機制。這些聚合與驗證邏輯的實作位置可分為三類：</p><ul><li>鏈下聚合（off-chain aggregation）：如 Chainlink OCR，節點在鏈下簽署報價，由 coordinator 彙整後再一次性上鏈。這能有效降低 gas 成本</li><li>鏈上聚合（on-chain aggregation）：如 UMA、Tellor，每個節點將 observation 上鏈，智慧合約以 median、mean 等方式聚合；具完全可審計性但成本高</li><li>混合型（hybrid）：鏈下聚合但需附帶驗證憑證，如閾值簽名、commit-reveal 或 zk-proof，鏈上合約進行驗證以確保誠信</li></ul><h4><strong>Crypto-economic incentive</strong></h4><p>為防止惡意行為並激勵誠實參與，Oracle 系統多數設計了加密經濟激勵模型。節點須事先質押代幣（staking），若被發現回報錯誤或蓄意作惡，將被處以沒收押金（slashing）。反之，若成功提供正確資料，則可獲得報酬。有些系統還導入聲譽系統，用以追蹤節點的歷史表現，作為後續參與與排序的依據。</p><h3>4. <strong>Oracle 怎麼確保資料正確又安全</strong></h3><p>Oracle 把鏈外的資料帶進區塊鏈，這過程其實有不少風險，像是資料來源不可靠、傳輸有問題、節點不誠實等等。主流的作法通常會結合以下這幾種方法，來降低被攻擊或資料失真的機率：</p><ul><li><strong>Data-source redundancy</strong><br>多來源（multi-feed）與 cross-checking 可避免單一 API 異常或停機即影響結果</li><li><strong>Decentralised aggregation</strong><br>多節點提交，再以 median 或 threshold 策略聚合；單一節點難以操縱最終值</li><li><strong>Crypto-economic incentive</strong><br>透過 staking 與 slashing：節點須質押代幣並承擔被罰沒風險，提交有效資料則獲得 reward</li><li><strong>Dispute / challenge layer</strong><br>在 Optimistic Oracle 模式下，資料先寫鏈上；若於 liveness window 內被質疑則進入仲裁，以確保最終結果經多重檢驗</li><li><strong>Cryptographic attestation</strong><br>協定如 TLSNotary、DECO 可對「資料確實來自原始伺服器且未被竄改」提供密碼學證明</li><li><strong>On-chain sanity checks</strong><br>合約可設定 bounds （例如價格變動上限）或 heartbeat （定期更新訊號），自動過濾異常值或偵測餵價停滯</li><li><strong>Operational monitoring</strong><br>公開節點績效指標（延遲、準確率）並配合自動化 alert，及早發現離線節點或 DDoS 攻擊</li></ul><h3>5. 常見 Oracle 解決方案</h3><ul><li><a href="https://chain.link/"><strong>Chainlink</strong></a><strong><br></strong>現在全球用得最廣的去中心化 Oracle 網路。早期用 FluxAggregator（取 median），現在主打 Off-Chain Reporting (OCR) 批次簽名。還有提供 VRF 隨機數和 CCIP 跨鏈訊息服務</li><li><a href="https://bandprotocol.com/"><strong>Band Protocol</strong></a><br>用 Cosmos-SDK 打造的獨立 L1（BandChain），把多個資料源包成 Oracle Data Packet，再透過 IBC 傳到多條鏈，費用低、更新也很彈性</li><li><a href="https://docs.uma.xyz/"><strong>UMA Optimistic Oracle</strong></a><br>採用「樂觀」模式：節點先把資料寫進鏈上，只要在指定時間內沒人質疑就算有效；有人質疑就仲裁，甚至會罰沒抵押，適合做 KPI、預測市場這種任意斷言</li><li><a href="https://pyth.network/"><strong>Pyth Network</strong></a><br>直接連接專業做市商和交易所節點，提供次秒級報價。資料先發到 Solana，再透過 Wormhole 橋接到其他鏈，適合對延遲很敏感的交易策略</li></ul><h3>6. 參考資料與進階閱讀</h3><p><strong>原始碼</strong></p><ul><li><a href="https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.6/FluxAggregator.sol">Chainlink <em>FluxAggregator.sol</em></a></li><li><a href="https://github.com/smartcontractkit/libocr/blob/master/contract/OffchainAggregator.sol">Chainlink <em>OffchainAggregator.sol</em></a></li><li><a href="https://github.com/UMAprotocol/dev-quickstart-oov3">UMA <em>Optimistic Oracle V3</em></a></li><li><a href="https://github.com/bandprotocol/chain">BandChain 參考實作</a></li></ul><p><strong>Starter kits</strong></p><ul><li><a href="https://github.com/smartcontractkit/functions-hardhat-starter-kit">Chainlink Functions Hardhat</a></li><li><a href="https://github.com/smartcontractkit/foundry-chainlink-toolkit">Foundry × Chainlink sandbox</a></li></ul><p><strong>進階主題</strong></p><ul><li>OCR 網路協調與閾值簽名 (threshold signature)</li><li>Optimistic Oracle 的經濟博弈與仲裁流程</li><li>DECO / TLSNotary：隱私資料證明協議</li><li>CCIP、IBC：跨鏈資料與訊息安全模型</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f3590f81d97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[閱讀心得] 窮查理的普通知識]]></title>
            <link>https://medium.com/@zero5011/%E9%96%B1%E8%AE%80%E5%BF%83%E5%BE%97-%E7%AA%AE%E6%9F%A5%E7%90%86%E7%9A%84%E6%99%AE%E9%80%9A%E7%9F%A5%E8%AD%98-90ea3b5eea22?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/90ea3b5eea22</guid>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 07:56:01 GMT</pubDate>
            <atom:updated>2025-06-15T07:56:01.524Z</atom:updated>
            <content:encoded><![CDATA[<h3>《窮查理的普通常識》用常識打敗愚蠢</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eEmzrSl9Kts-fWb7LkqvrQ.jpeg" /></figure><p>這本《窮查理的普通常識》，不只是談投資，更是一部關於如何思考、如何判斷的經典。書中收錄了蒙格11場經典演講與訪談，深入呈現他對世界運作的理解與行動原則。</p><p>這次閱讀讓我重新審視自己面對資訊與決策的方式。蒙格不像典型財經作家講技巧，而是用跨領域的「思維模型」來拆解世界。他不講求速成，而強調理性、耐心、誠實與常識。</p><p>接下來，我將從幾個我最有感的主題切入，整理並反思這些智慧在我生活與工作的意義。</p><h4>一、跨學科的多元思維：建立你自己的心智模型圖譜</h4><p>在查理蒙格的世界觀中，<strong>理解世界的關鍵不是記住更多資訊，而是建立一套交織互補的「心智模型庫」。</strong></p><p>他主張，世界太複雜了，沒有哪一個學科能提供全部答案。真正的洞察來自於「跨學科的整合」──用數學理解機率、用心理學辨識偏誤、用工程學思考系統與安全邊際、用會計理解資源流動。</p><p>以下是蒙格認為最基礎的幾個思維模型來源：</p><ul><li><strong>數學</strong>：學會用機率思維、排列組合的方式評估風險與報酬，理解複利的力量。</li><li><strong>會計學</strong>：財務報表不是冷冰冰的數字，而是一種描述企業運作的語言；會計素養是商業判斷的基礎。</li><li><strong>心理學</strong>：大多數人不是被別人騙，而是被自己騙。認識我們大腦的錯覺、偏誤與啟發式，是避免愚蠢行為的必要條件。</li><li><strong>工程學</strong>：追求可靠性與「系統思維」，尤其重視錯誤預防、冗餘設計、品質管理。這讓投資決策也更像一種風險控制工程。</li><li><strong>雙軌分析</strong>：每一次判斷，都要有兩種評估：一是「理性」層面的邏輯與利益分析，二是「潛意識」層面的情緒與心理偏差。兩者缺一不可。</li></ul><p>📌 <strong>這段讓我印象深刻的是</strong>：多元模型的建立，提供了我們不同觀點的思考，讓未來遇到問題時，不會只用單一角度看世界，而是有一整套工具箱可以翻出來用。</p><h4>二、逆向思考：問「怎麼搞砸它」，反而更接近成功</h4><p>查理蒙格非常推崇一種古老而有效的思維方式 — — <strong>Invert, always invert.（反過來想，總是反過來想）</strong>。這句話來自十九世紀代數學家雅各比（Carl Gustav Jacobi），他常在解決複雜問題時建議從結果反推原因。</p><p>蒙格將這套方法應用在各種決策情境中，尤其在判斷失敗風險時特別有用。他曾說：「想要擁有幸福人生，不如先問 — — <strong>我要怎麼做才能讓人生悲慘？</strong>」</p><p>以下是他在演講中舉例的「四帖人生毀滅良方」：</p><p>1. 反覆無常，對什麼都三分鐘熱度</p><p>2. 從不吸取他人的經驗教訓</p><p>3. 一遇挫折就崩潰:</p><p>4. 從不使用逆向思維</p><p>📌 <strong>這段我特別有感的是：</strong>除了問「怎麼成功」，但其實也要反過來想：「怎麼做能避免失敗？」這樣反而能提早注意到潛在風險，比如溝通延誤、需求不明、沒考慮使用者真實情境等。</p><h4>三、能力圈理論：知道自己在哪裡「有資格出手」</h4><p><strong>「能力圈」（Circle of Competence）</strong>是蒙格與巴菲特投資哲學的核心。他們只在自己真正理解、熟悉、有能力判斷的領域出手，並樂於承認超出邊界的事「我不知道」。</p><p>蒙格說過：「<strong>真正有能力的人，會清楚自己能力的邊界在哪裡；如果你對某件事感到模糊不清，那它就不在你的能力圈內。</strong>」</p><p>這個原則是他們投資哲學的核心：他不碰自己看不懂的公司，不追逐熱門產業，只在自己「看得懂」的地方下注。他們寧願錯過機會，也不願亂槍打鳥。</p><h4>四、檢查清單思維：降低錯誤，而非追求完美</h4><p>在查理蒙格的邏輯裡，「聰明」並不等於「不會犯錯」，而是<strong>建立一套機制讓自己少犯錯</strong>。他的祕訣之一，就是使用檢查清單（Checklist）──來自飛行員與工程師的思維方式。</p><p>他列出十項關鍵提醒：風險、獨立、準備、謙虛、嚴格分析、資源配置、耐心、決心、改變、專注。</p><ol><li><strong>風險</strong>：所有評估都應該從「最壞情況」出發，而不是從「成功機率」出發。</li><li><strong>獨立思考</strong>：隨波逐流，只會讓你變成「市場的平均值」。</li><li><strong>準備</strong>：每天進步一點點，讓自己在機會出現時準備好。</li><li><strong>謙虛</strong>：真正的高手，反而更容易承認「我不知道」。</li><li><strong>嚴格分析</strong>：運用科學方法與第二層思考，避免膝反射式決策。</li><li><strong>資源配置</strong>：錢與時間一樣，要配置到「期望值最高」的地方。</li><li><strong>耐心</strong>：別急，複利只會給「不動的人」獎賞。</li><li><strong>決心</strong>：等到機會真的出現，要敢於下注。</li><li><strong>適應改變</strong>：世界一直在變，不變的人會被淘汰。</li><li><strong>專注</strong>：別被雜音分心，記得你原本要做什麼。</li></ol><p>📌 做決策前，每個人可能都用過其中幾個原則，本書則用更全面的提醒，來幫助做出更有品質的決策— — 我是不是搞清楚問題本質？有沒有從別人的角度思考過？風險在哪、值不值得？先過這張 checklist，再決定。</p><h4><strong>五、誤判心理學：別以為你總是理性的人</strong></h4><p>查理蒙格在〈人類誤判心理學〉中，提出 25 種常見的錯誤思考模式。以下是特別值得留意的幾項：</p><blockquote><strong>獎勵和懲罰超級反應傾向</strong></blockquote><p>人類對「被獎勵」或「被懲罰」的反應極度強烈，強烈到可以扭曲我們的判斷。這個傾向不只發生在業務績效上，也發生在教養、組織制度、學校升學壓力等情境中。<strong>你用什麼方式獎勵人，就會形塑出什麼樣的行為。</strong></p><blockquote><strong>喜愛與憎恨傾向</strong></blockquote><p>我們會不自覺地放大對所「喜歡」或「討厭」對象的整體評價：喜歡一個人，就會覺得他什麼都好；討厭一個人，就會對他的一切都挑剔。這種二元情感讓我們失去中立分析的能力，也讓評估失真。<strong>工作中這種傾向很常見 — — 對同事的「好感」不應等同於對他專業的信任。</strong></p><blockquote><strong>一致性傾向</strong></blockquote><p>人一旦表態，就傾向持續維持那個立場，即使已經知道那是錯的。這個傾向讓人死守原先的決策，不願修正；讓領導者誤信自己的承諾比修正更重要。<strong>好的決策者，是能夠誠實轉向的人，而不是固執堅持的人。</strong></p><blockquote><strong>聯想與可得性偏誤</strong></blockquote><p>容易想起的資訊，往往被高估其重要性；表面上有關聯的事物，也容易讓人產生誤解。比如「看到紅色＝危險」、「名牌＝品質好」(受簡單聯想影響的傾向) 或是 一場意外讓我們覺得某件事很危險，即使機率極低 (可得性錯誤加權傾向)。</p><blockquote><strong>理由尊重傾向</strong></blockquote><p>人類對「有給出理由」的指令更容易服從，即使這個理由是廢話。這傾向顯示我們更容易接受<strong>包裝過的說服，而不是邏輯真正成立的說服</strong>。</p><p>📌 這些心理偏誤其實早已出現在日常觀察中，只是過去缺乏有系統的整理。這段讓人更有意識地檢查自己：是不是因為對方給了一個「聽起來合理」的理由就接受？是不是只是因為討厭某人就反對他的想法？能提出這些質疑，大概就是避錯的開始了。</p><h4>結語｜查理蒙格的智慧，不在多聰明，而在少犯錯</h4><p>查理蒙格的智慧，一直不是在於提出驚人的答案，而是反覆提醒人們：<strong>真正重要的，是避開那些讓人做出愚蠢決策的陷阱。</strong></p><p>在資訊爆炸、情緒快速傳播的時代，他強調的是冷靜分析、多元視角與對人性的深刻理解。他用跨學科的心智模型，把複雜的世界拆解成一套可以練習的思考系統；他不鼓勵投機，而是鼓勵誠實地面對自己的無知與侷限。</p><p>比起速成與捷徑，他提供的，是一種值得長期練習的思維習慣。</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90ea3b5eea22" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[閱讀筆記] 如何打造長期致富：從納瓦爾寶典學到的核心心法]]></title>
            <link>https://medium.com/@zero5011/%E9%96%B1%E8%AE%80%E7%AD%86%E8%A8%98-%E5%A6%82%E4%BD%95%E6%89%93%E9%80%A0%E9%95%B7%E6%9C%9F%E8%87%B4%E5%AF%8C-%E5%BE%9E%E7%B4%8D%E7%93%A6%E7%88%BE%E5%AF%B6%E5%85%B8%E5%AD%B8%E5%88%B0%E7%9A%84%E6%A0%B8%E5%BF%83%E5%BF%83%E6%B3%95-d820f0afb338?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/d820f0afb338</guid>
            <category><![CDATA[how-to-get-rich]]></category>
            <category><![CDATA[閱讀筆記]]></category>
            <category><![CDATA[naval]]></category>
            <category><![CDATA[納瓦爾寶典]]></category>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Sat, 07 Jun 2025 01:23:50 GMT</pubDate>
            <atom:updated>2025-06-07T01:55:18.498Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TY0gcN8V5YaYGGPEIr81wQ.jpeg" /><figcaption>Naval Ravikant.. Photo: Getty Images</figcaption></figure><p>《納瓦爾寶典》不只在談論如何致富，他是一份關於<strong>自由</strong>、<strong>成長</strong>、<strong>財富</strong>和<strong>快樂</strong>的指南。納瓦爾（Naval Ravikant）用簡單卻深刻的言語，告訴我們如何靠自己實現真正的財富和內心的平靜。</p><h4>一、財富與金錢的本質差異</h4><p><strong>財富是你在睡覺時也會產生收入的資產，金錢只是交換價值的媒介</strong>。真正的財富不是靠賣時間換錢，而是建立一個可以自動運作的價值系統，包括股權、智慧財產等</p><h4>二、致富的核心路徑：不靠運氣的致富法則</h4><ul><li><strong>擁有股權</strong>：你不能靠出賣時間致富，要靠能一直為你產生收入的資產。股權就是其中一個。</li><li><strong>創造會需要但難以獲得的東西，並且規模化</strong></li><li><strong>選擇長期合作的人</strong>：重複賽局勝過單次賽局。信任、誠信和共同成長的夥伴關係，是複利效應的催化劑</li><li><strong>學會「銷售」和「創造」</strong>：你必須技能打造價值，又能將其傳遞給市場</li></ul><h4>三、機會是留給有準備的人：四種運氣</h4><ol><li><strong>盲目的運氣</strong>（出生、彩券）</li><li><strong>拼命而來的運氣</strong>（越努力越幸運）</li><li><strong>准備而來的運氣</strong>（準備好後，抓住機會）</li><li><strong>獨特性創造的運氣</strong>（你的獨特性吸引機會來找你）</li></ol><p>最有價值的運氣是第四種，他不靠偶然，而是你獨特性的自然延伸</p><h4>四、將自己「商品化」的關鍵</h4><ol><li>特定知識（Specific Knowledge）</li><li>槓桿（Leverage）</li><li>獨特性（Uniqueness）</li><li>當責力（accountability）</li></ol><h4>五、培養真正的「判斷力」</h4><p>致富不是靠更多資訊，而是靠更好的判斷力。判斷力來自：</p><ul><li>判斷力是理解自身行動可能產生的長期後果的能力</li><li>最好的心智模式來自演化論、賽局理論，還有查理蒙格</li></ul><h4>六、快樂是一種能力，不是目標</h4><ol><li>快樂來自內在的平靜，不是慾望的滿足</li><li>放下非黑即白的思維</li><li>接受事實，找回平靜</li><li>以最好的方式詮釋一切</li><li>培養快樂的能力，讓快樂變成習慣</li><li>選擇能帶來長期快樂的習慣和人</li></ol><p>人生中遇到的每個情境，你都有三個選擇：「改變它」、「接受它」、「擺脫它」。這是快樂與自由的核心關鍵。慎選你的渴望，選擇一個最強烈渴望，給自己目標和動力去實現。</p><h4>七、總結：你就是最有價值的資產</h4><p>真正的自由與財富，來自於你對自己的投資與了解。將自己「商品化」、提升判斷力、建立槓桿、培養快樂，這些都不需要等待他人給你機會，而是你可以從現在就開始的事。你就是最重要的資產</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d820f0afb338" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[筆記][Podcast][TFT] #11 加油，對自己的時間負責]]></title>
            <link>https://medium.com/@zero5011/%E7%AD%86%E8%A8%98-podcast-tft-11-%E5%8A%A0%E6%B2%B9-%E5%B0%8D%E8%87%AA%E5%B7%B1%E7%9A%84%E6%99%82%E9%96%93%E8%B2%A0%E8%B2%AC-63db3b266e78?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/63db3b266e78</guid>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Sun, 07 Apr 2024 09:54:34 GMT</pubDate>
            <atom:updated>2024-04-07T09:54:34.493Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>領導者的三大管理心法</blockquote><ul><li>帶好班子</li><li>管好時間</li><li>做好決策</li></ul><p>其中佔三強之一就是管理時間</p><blockquote>透過準時來表達對與會者的重視</blockquote><p>小故事，台東陳爸所有的會議都會提早15分鐘到，因為時間對他認為參與的人最大的誠意，因為時間對他來說是最珍貴的事情</p><blockquote>讓可預測的事情變得可預測</blockquote><p>只有讓可預測的事情變得可預測，才有餘裕去回應不可預測的事情。每個新的東西進來都是花能量的，如果沒有反應這個有限的資源，就會一直呈現透支的狀態。</p><blockquote>不斷確保手上時間是有他清楚的目的性</blockquote><ul><li>拒絕開沒有議程的會議 <br>當一個會議沒有議程，代表要開會的人不知道在這個會議要達到什麼目的，也不知道每個人在裡面扮演什麼角色。(沒有想清楚怎麼用別人的時間)</li><li>軟性會議<br>即是是軟性的會議都有它的目的(交流、軟性溝通)，即使是軟性的會議也可以挑戰，這個會議跟我有沒有關，對我有沒有幫助</li></ul><blockquote>紀律帶來自由</blockquote><ul><li>每個人對時間負責<br>每個人自己管理自己的時間，並對自己的時間負責</li><li>聰明的懶人<br>透過紀律和科技(自動化)讓工作更有效率，用最低力氣，達到最好成果</li></ul><blockquote>對時間做預算</blockquote><p>時間就像錢一樣，是最有限的資源。跟做預算一樣，要有預決算的概念。先盤點有多少時間，再來做預算。先做盤點，盤點可以有由下而上和由上而下 兩個視角</p><p>由下而上是盤點要完成多少事情，每間事情需要多少時間，由上而下推起來，看需要多少時間</p><p>由上而下則是回過頭來，去看時間分配和不合理。當把人生分成幾個板塊，哪些板塊所用的時間太多，哪些則太少。</p><p>決算則是幫助你了解你以為你用時間是不是真的如你想像，畢竟執行才是重點！</p><blockquote>斤斤計較</blockquote><p>對自己的時間最吝嗇最在乎，不期待別人對你的時間負責，而是先為自己的時間負責</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=63db3b266e78" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Version and Environment Management]]></title>
            <link>https://medium.com/@zero5011/python-version-and-environment-management-cfa5c0944df2?source=rss-3289760666ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/cfa5c0944df2</guid>
            <dc:creator><![CDATA[yihao]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 06:56:10 GMT</pubDate>
            <atom:updated>2024-03-03T06:57:17.544Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of Python development, managing multiple Python versions and isolating project dependencies are two common challenges. These challenges not only affect developers’ productivity but can also lead to compatibility issues when projects are run in different environments. This article will mention how to use Pyenv and Virtualenv to solve these issues and their basic usage.</p><h3>Pyenv: Managing Python Versions</h3><p>Pyenv is a tool to let you easily install and <strong>switch multiple versions of Python</strong>. It’s useful when you have projects that require different Python versions to run on the same machine.</p><h4>Installation (mac)</h4><ol><li>Install with Homebrew</li></ol><pre>brew install pyenvshe</pre><p>2. <a href="https://github.com/pyenv/pyenv?tab=readme-ov-file#set-up-your-shell-environment-for-pyenv">Set up your shell environment for Pyenv</a></p><h4>Usage</h4><ol><li>List all python versions can be installed</li></ol><pre>pyenv install -l</pre><p>2. Install specific version</p><pre>pyenv install &lt;version&gt;</pre><p>3. Switch between different versions</p><pre>pyenv shell &lt;version&gt; #select just for current shell session<br>pyenv local &lt;version&gt; #automatically select whenever you are in the current directory (or its subdirectories)<br>pyenv global &lt;version&gt; #select globally for your user account</pre><h3>Virtualenv: Isolating Project Dependencies</h3><p>Virtualenv is a tool for creating isolated Python <strong>environments</strong>. Each environment is separate, with its own installation directory, and can have <strong>different versions of third-party libraries</strong> installed.</p><h4>Installation (mac)</h4><ol><li>Install with Homebrew</li></ol><pre>brew install virtualenv</pre><h4>Usage</h4><ol><li>Create an environment in your current directory</li></ol><pre>virtualenv &lt;env_name&gt;</pre><p>2. Activate the new python environment</p><pre>source env_name/bin/activate</pre><p>3. Deactivating the environment</p><pre>deactivate</pre><h3>Conclusion</h3><p>In summary, Pyenv and Virtualenv address two pivotal aspects of Python development. <strong>Pyenv</strong> excels in managing multiple Python versions, allowing developers to easily switch between versions on a per-project or global basis. This ensures compatibility across various projects that may require different Python versions. On the other hand, <strong>Virtualenv</strong> focuses on isolating project dependencies, enabling each project to maintain its own set of third-party libraries without interference. Together, these tools streamline the development process, enhance productivity, and mitigate compatibility issues, making them indispensable in modern Python workflows.</p><h3>Reference</h3><ul><li><a href="https://github.com/pyenv/pyenv">https://github.com/pyenv/pyenv</a></li><li><a href="https://virtualenv.pypa.io/">https://virtualenv.pypa.io/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cfa5c0944df2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>