text stringlengths 0 1.43k |
|---|
Engineering Security Through Coordination Problems |
Recently, there was a small spat between the Core and Unlimited factions of the Bitcoin community, a spat which represents perhaps the fiftieth time the same theme was debated, but which is nonetheless interesting because of how it highlights a very subtle philosophical point about how blockchains work. |
ViaBTC, a mining pool that favors Unlimited, tweeted \"hashpower is law\", a usual talking point for the Unlimited side, which believes that miners have, and should have, a very large role in the governance of Bitcoin, the usual argument for this being that miners are the one category of users that has a large and illi... |
These constraints are enforced by full nodes run by users - if miners start producing blocks according to a set of rules different than the rules that users' nodes enforce, then the users' nodes will simply reject the blocks, regardless of whether 10% or 60% or 99% of the hashpower is behind them. To this, Unlimited of... |
Many people often argue against the use of public blockchains for applications that involve real-world assets or anything with counterparty risk. The critiques are either total, saying that there is no point in implementing such use cases on public blockchains, or partial, saying that while there may be advantages to s... |
While it is theoretically possible for miners to switch 99% of their hashpower to a chain with new rules (to make an example where this is uncontroversially bad, suppose that they are increasing the block reward), and even spawn-camp the old chain to make it permanently useless, and it is also theoretically possible fo... |
In the middle of all this, opponents of the switch can create a fear-uncertainty-and-doubt campaign to try to convince people that maybe they shouldn't update their clients after all, or update their client to some third set of rules (eg. changing proof of work), and this makes implementing the switch even more difficu... |
With blockchain applications, however, we are doing something different: we are using coordination problems to our advantage , using the friction that coordination problems create as a bulwark against malfeasance by centralized actors. We can build systems that have property X, and we can guarantee that they will prese... |
In the latter case, the operator can choose to arbitrarily change the rules, freeze people's money, offer bad service, jack up their fees or do a whole host of other things, and the coordination problems are in the operator's favor, as such systems have substantial network effects and so very many users would have to a... |
Note that the arguments above do NOT, by themselves, imply that it is a bad idea for miners to be the principal actors coordinating and deciding the block size (or in Ethereum's case, the gas limit). It may well be the case that, in the specific case of the block size/gas limit , \"government by coordinated miners with... |
There generally are at least some gains to be made by running more business logic on a blockchain, but they are often much smaller than the losses to efficiency or privacy. And this ok; the blockchain is not the best tool for every task. What the arguments above do imply, though, is that if you are building a blockchai... |
There are two ways out here. The first is that we can realize that while it is optimal from the point of view of the above arguments that everyone runs a full node, it is certainly not required . Arguably, any major blockchain running at full capacity will have already reached the point where it will not make sense for... |
There are two levels of \"light clients\" that are generally possible in blockchain systems. The first, weaker, kind of light client simply convinces the user, with some degree of economic assurance, that they are on the chain that is supported by the majority of the network. This can be done much more cheaply than ver... |
This is done by a combination of strategies; the simplest to explain is that a light client can work together with specialized nodes (credit to Gavin Wood for coming up with the name \"fishermen\") whose purpose is to look for blocks that are invalid and generate \"fraud proofs\", short messages that essentially say \"... |
Note that in order for a light client to be able to efficiently validate a set of application rules, those rules must be executed inside of consensus - that is, they must be either part of the protocol or part of a mechanism executing inside the protocol (like a smart contract). This is a key argument in favor of using... |
These light client techniques are imperfect, in that they do rely on assumptions about network connectivity and the number of other light clients and fishermen that are in the network. But it is actually not crucial for them to work 100% of the time for 100% of validators. Rather, all that we want is to create a situat... |
Over the past week, an article has been floating around about a company that lost $25 million when a finance worker was convinced to send a bank wire to a scammer pretending to be the CFO... over what appears to have been a very convincing deepfaked video call. Deepfakes (ie. AI-generated fake audio and video) are a... |
Someone who knows me well could still identify the recent video of me shilling a dog coin as a fake because it has me saying \"let's f***ing go\" whereas I've only ever used \"LFG\" to mean \"looking for group\" , but people who have only heard my voice a few times could easily be convinced. Security experts to whom... |
But even still, the fact remains that as of 2024, an audio or even video stream of a person is no longer a secure way of authenticating who they are. This raises the question: what is? Cryptographic methods alone are not the answer. Being able to securely authenticate people is valuable to all kinds of people in all... |
Suppose that you are an individual with a personal multisig wallet, and you are sending off a transaction that you want some co-signers to approve. Under what circumstances would they approve it? If they're confident that you're the one who actually wants the transfer to happen. If it's a hacker who stole your key, or... |
Suppose that someone texts you claiming to be a particular person who is your friend. They are texting from an account you have never seen before, and they are claiming to have lost all of their devices. How do you determine if they are who they say they are? There's an obvious answer: ask them things that only they ... |
The more unique your question is, the better. Questions that are right on the edge where someone has to think for a few seconds and might even forget the answer are good: but if the person you're asking does claim to have forgotten, make sure to ask them three more questions. Asking about \"micro\" details (what so... |
No single security strategy is perfect, and so it's always best to stack together multiple techniques. Pre-agreed code words : when you're together, intentionally agree on a shared code word that you can later use to authenticate each other. Perhaps even agree on a duress key : a word that you can innocently inser... |
A potential sophisticated attack where an attacker impersonates an executive and a grantee at multiple steps of an approval process.Security questions and delays can both guard against this; it's probably better to use both. Security questions are nice because, unlike so many other techniques that fail because they are... |
Each person's situation is unique, and so the kinds of unique shared information that you have with the people you might need to authenticate with differs for different people. It's generally better to adapt the technique to the people, and not the people to the technique. A technique does not need to be perfect to wor... |
The promise and challenges of crypto + AI applications |
Many people over the years have asked me a similar question: what are the intersections between crypto and AI that I consider to be the most fruitful? It's a reasonable question: crypto and AI are the two main deep (software) technology trends of the past decade, and it just feels like there must be some kind of connec... |
In the last three years, with the rise of much more powerful AI in the form of modern LLMs , and the rise of much more powerful crypto in the form of not just blockchain scaling solutions but also ZKPs , FHE , (two-party and N-party) MPC , I am starting to see this change. There are indeed some promising applications o... |
The four major categories AI is a very broad concept: you can think of \"AI\" as being the set of algorithms that you create not by specifying them explicitly, but rather by stirring a big computational soup and putting in some kind of optimization pressure that nudges the soup toward producing algorithms with the prop... |
There are many ways to categorize AI; for the purposes of this post, which talks about interactions between AI and blockchains (which have been described as a platform for creating \"games\" ), I will categorize it as follows: AI as a player in a game [highest viability]: AIs participating in mechanisms where the ultim... |
AI as a player in a game. This is actually a category that has existed for nearly a decade, at least since on-chain decentralized exchanges (DEXes) started to see significant use. Any time there is an exchange, there is an opportunity to make money through arbitrage, and bots can do arbitrage much better than humans ca... |
But so far prediction markets have not taken off too much in practice, and there is a series of commonly given reasons why: the largest participants are often irrational, people with the right knowledge are not willing to take the time and bet unless a lot of money is involved, markets are often thin, etc. One response... |
And so a different response is to point to one specific feature of prediction market ecosystems that we can expect to see in the 2020s that we did not see in the 2010s: the possibility of ubiquitous participation by AIs. AIs are willing to work for less than $1 per hour, and have the knowledge of an encyclopedia - and ... |
Note that potentially, you don't even need the humans to adjudicate most questions : you can use a multi-round dispute system similar to Augur or Kleros, where AIs would also be the ones participating in earlier rounds. Humans would only need to respond in those few cases where a series of escalations have taken place ... |
This is a powerful primitive, because once a \"prediction market\" can be made to work on such a microscopic scale, you can reuse the \"prediction market\" primitive for many other kinds of questions: Is this social media post acceptable under [terms of use]? What will happen to the price of stock X? Is this account th... |
But at a macro level, the question is: who builds the AI? AI is a reflection of the process that created it, and so cannot avoid having biases. Hence, there is a need for a higher-level game which adjudicates how well the different AIs are doing, where AIs can participate as players in the game . This usage of AI, wher... |
AI as an interface to the game. |
One idea that I brought up in my writings on is the idea that there is a market opportunity to write user-facing software that would protect users' interests by interpreting and identifying dangers in the online world that the user is navigating. One already-existing example of this is Metamask's scam detection feature... |
Edit 2024.02.02: an earlier version of this post referred to this token as a scam trying to impersonate bitcoin. It is not; it is a memecoin. Apologies for the confusion. Potentially, these kinds of tools could be super-charged with AI. AI could give a much richer human-friendly explanation of what kind of dapp you are... |
There is one particular risk worth mentioning. I will get into this more in the section on \"AI as rules of the game\" below, but the general issue is adversarial machine learning: if a user has access to an AI assistant inside an open-source wallet, the bad guys will have access to that AI assistant too, and so they w... |
Summary: AI can help users understand what's going on in plain language, it can serve as a real-time tutor, it can protect users from mistakes, but be warned when trying to use it directly against malicious misinformers and scammers. AI as the rules of the game Now, we get to the application that a lot of people are ex... |
The basic two-sentence argument why is as follows: If an AI model that plays a key role in a mechanism is closed, you can't verify its inner workings, and so it's no better than a centralized application. If the AI model is open, then an attacker can download and simulate it locally, and design heavily optimized attack... |
But in the case of AI-related computation, there are two major objections: Cryptographic overhead : it's much less efficient to do something inside a SNARK (or MPC or...) than it is to do it \"in the clear\". Given that AI is very computationally-intensive already, is doing AI inside of cryptographic black boxes even c... |
AI computation is expensive already: the most powerful LLMs can output individual words only a little bit faster than human beings can read them, not to mention the often multimillion-dollar computational costs of training the models. The difference in quality between top-tier models and the models that try to economiz... |
Let us examine the basic structure of an AI model: Usually, an AI model mostly consists of a series of matrix multiplications interspersed with per-element non-linear operations such as the ReLU function ( y = max(x, 0) ). Asymptotically, matrix multiplications take up most of the work: multiplying two N*N matrices tak... |
But there is hope that this can be greatly decreased through further research; see this presentation from Ryan Cao for a recent approach based on GKR, and my own simplified explanation of how the main component of GKR works . But for many applications, we don't just want to prove that an AI output was computed correctl... |
In both cases, the moral of the story is the same: the greatest part of an AI computation is matrix multiplications, for which it is possible to make very efficient ZK-SNARKs or MPCs (or even FHE), and so the total overhead of putting AI inside cryptographic boxes is surprisingly low. Generally, it's the non-linear lay... |
Use black-box access to a \"target classifier\" to train and refine your own locally stored \"inferred classifier\". Then, locally generate optimized attacks against the inferred classfier. It turns out these attacks will often also work against the original target classifier. Diagram source . Potentially, you can even... |
The project that has done the most on the former is perhaps Worldcoin, of which I analyze an earlier version (among other protocols) at length here. Worldcoin uses AI models extensively at protocol level, to (i) convert iris scans into short \"iris codes\" that are easy to compare for similarity, and (ii) verify that t... |
But the hope is that if you combine all the defenses together , hiding the AI model itself, greatly limiting the number of queries, and requiring each query to somehow be authenticated, you can adversarial attacks difficult enough that the system could be secure. In the case of Worldcoin, increasing these other defence... |
This is where \"DAOs to democratically govern AI\" might actually make sense : we can create an on-chain DAO that governs the process of who is allowed to submit training data (and what attestations are required on the data itself), who is allowed to make queries, and how many, and use cryptographic techniques like MPC... |
One reason why I didn't start this section with more big red warning labels saying \"DON'T DO AI JUDGES, THAT'S DYSTOPIAN\", is that our society is highly dependent on unaccountable centralized AI judges already: the algorithms that determine which kinds of posts and political opinions get boosted and deboosted, or eve... |
End of preview. Expand in Data Studio
Prepare Qdrant:
mkdir qdrant_storage
mkdir qdrant_snapshots
Start Qdrant:
docker run -d -p 6333:6333 -p 6334:6334 \
-v $(pwd)/qdrant_storage:/qdrant/storage:z \
-v $(pwd)/qdrant_snapshots:/qdrant/snapshots:z \
qdrant/qdrant
Create collection:
curl -X PUT 'http://localhost:6333/collections/vitalik.eth' \
-H 'Content-Type: application/json' \
--data-raw '{
"vectors": {
"size": 384,
"distance": "Cosine",
"on_disk": true
}
}'
Query collection:
curl 'http://localhost:6333/collections/vitalik.eth'
Optional: delete collection
curl -X DELETE 'http://localhost:6333/collections/vitalik.eth'
Get embedding model:
curl -LO https://huggingface.co/second-state/All-MiniLM-L6-v2-Embedding-GGUF/resolve/main/all-MiniLM-L6-v2-ggml-model-f16.gguf
Get the embedding app:
curl -LO https://raw.githubusercontent.com/YuanTony/chemistry-assistant/main/rag-embeddings/create_embeddings.wasm
Create and save the generated embeddings:
wasmedge --dir .:. --nn-preload default:GGML:AUTO:all-MiniLM-L6-v2-ggml-model-f16.gguf create_embeddings.wasm default vitalik.eth 384 vitalik-eth.txt
Check the results:
curl 'http://localhost:6333/collections/vitalik.eth'
Create snapshot:
curl -X POST 'http://localhost:6333/collections/vitalik.eth/snapshots'
Access the snapshots:
ls qdrant_snapshots/vitalik.eth/
- Downloads last month
- 6,976