├── .pre-commit-config.yaml ├── LICENSE ├── README.md └── explained.md /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | fail_fast: true 2 | 3 | repos: 4 | - repo: https://github.com/pre-commit/pre-commit-hooks 5 | rev: v4.1.0 6 | hooks: 7 | - id: trailing-whitespace 8 | - id: end-of-file-fixer 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Gregor Pogačnik 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # awesome-ark 2 | A curated list of ARK resources 3 | 4 | ## What is it 5 | 6 | ARK is a second-layer solution designed to scale Bitcoin transactions. It uses a shared UTXO model for off-chain payments through an intermediary server that cannot access your funds. 7 | 8 | To avoid confusion: "token" used here is BTC not an altcoin with the name [ARK](https://ark.io). If you are looking for the list of resources for that one it is available in a different [repo](https://github.com/Guppster/awesome-ark) and beside the common name the two things are totally unrelated. 9 | 10 | The full non-interactive ARK version requires covenants (which can be achieved using [CTV](https://github.com/bitcoin/bips/blob/master/bip-0119.mediawiki) or [APO](https://github.com/bitcoin/bips/blob/master/bip-0118.mediawiki)). 11 | 12 | However using n-of-n multisig you can have a simplified version requiring all participants to be online or using the [Ruben shortcut](https://gist.github.com/RubenSomsen/a394beb1dea9e47e981216768e007454?permalink_comment_id=4633382#gistcomment-4633382) that reduces of 50% the interactivity required without a soft-fork. Which means ARK can be rolled out on bitcoin immediately. 13 | 14 | It is complementary to lightning in a sense that you can still use lightning with ARK but most transactions will be done 15 | directly off-chain (and off-channel). ARK service providers (ASPs) providing liquidity are usually also lightning service providers (LSPs). 16 | 17 | ## List 18 | 19 | * [👶🏼 ELI5: Ark in Simple Terms](https://arkdev.info/docs/learn/intro) 20 | * [Arkdev.info](https://arkdev.info) 21 | * [ARK network github](https://github.com/ark-network) - all the Ark code on GitHub 22 | * [Bitcoin TapScript contract defintion](https://github.com/ark-network/tapscripts) 23 | * [ARK Network Community Telegram](https://t.me/ark_network_community) 24 | * [Ark Labs Discord Community](https://discord.com/invite/5XwckYtXAG) 25 | * [ARK video from Bitcoin Miami 2023](https://bitcointv.com/w/pVk3bPfKZ7YqDzsNZjz9tf?start=4h9m28s) 26 | * [ARK presentation from Bitcoin Miami 2023](https://docs.google.com/presentation/d/1xKIJt4CnUCFfxhIwDj_kW0Ecr0NcvN5bZ4SQexGJfmk/edit?usp=sharing) 27 | * [[bitcoin-dev] Ark: An Alternative Privacy-preserving Second Layer Solution](https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2023-May/021694.html) 28 | * [Introducing Ark Blog Post](https://burakkeceli.medium.com/introducing-ark-6f87ae45e272) 29 | * [Rijndael's write up on how Ark works](https://primal.net/thread/note1cuv7mg7z0w7jvwp9mlsu0zt6acnw54avaj5r5zgdkxlpjnqp3g0s5c0yht) 30 | * [RubenSomsen's Simplest Ark Explanation](https://gist.github.com/RubenSomsen/a394beb1dea9e47e981216768e007454) 31 | * [Ark Whiteboard Masterclass with Burak & Robin](https://youtu.be/EocWax43QgQ) 32 | * [Bitcoin magazine: Introducing Ark](https://bitcoinmagazine.com/technical/how-ark-plans-to-scale-private-bitcoin-payments) 33 | * [BitGo blog: Will Burak’s Ark Solve Bitcoin Scaling?](https://blog.bitgo.com/will-buraks-ark-solve-bitcoin-scaling-f31e65535c3f) 34 | * [pippellia's Video Ark Explained - Bitcoin Layer 2 Protocol](https://rumble.com/v3nf9vd-ark-explained-bitcoin-layer-2-protocol.html) 35 | * [Bitcoin Ljubljana September 2023 Meetup Notes - Ark presentation](https://www.bitcoin-ljubljana.si/meetup-notes/202309.html) [[PDF]](https://github.com/bitcoin-ljubljana/meetup/blob/main/presentations/Ark.pdf) 36 | * [My silly ARK explaination with analogies](./explained.md) 37 | * [Bitcoin Startup All-In On New Layer 2 Scaling Protocol](https://bitcoinmagazine.com/business/bitcoin-startup-allin-new-layer2) 38 | * [Understanding Ark's liquidity requirments](https://arkdev.info/blog/liquidity-requirements) 39 | * [Reducing Ark Interactivity Without Soft Fork](https://gist.github.com/RubenSomsen/a394beb1dea9e47e981216768e007454?permalink_comment_id=4633382) 40 | * [Neha Narula's Ark Explainer](https://nehanarula.org/2025/05/20/ark.html) 41 | 42 | ## Twitter threads 43 | 44 | * [Yuya's twitter thread with diagrams](https://twitter.com/ogw_yuya/status/1664497186703568896) 45 | * [Alex Lewin's twitter thread with diagrams and explanations](https://twitter.com/_AlexLewin/status/1667185028768452611) 46 | * [How Ark works - visualized](https://x.com/ArkLabsHQ/status/1801479718958678290) 47 | 48 | ## Podcasts 49 | 50 | * [Stephan Livera Podcast SLP482 Burak – Ark: A new L2 protocol for Bitcoin](https://stephanlivera.com/episode/482/) 51 | * [Bitcoin Takeover Podcast S14 E1: Burak Keceli on Ark & Bitcoin 2nd Layers](https://www.youtube.com/watch?v=iQ7TLBhh9r4) 52 | * [The Kevin Rooke Show E109: Burak on Building Ark, Scaling Bitcoin, and Improving Privacy](https://www.stacksats.how/podcasts/e109-burak-on-building-ark-scaling-bitcoin-and-improving-privacy) 53 | * [The ark-hashed podcast, episode 16](https://youtu.be/p3TzBci2CyI) 54 | * [Updates on Ark development - one year later](https://stephanlivera.com/episode/584/) 55 | 56 | ## Related 57 | 58 | * [TumbleBit: An Untrusted Bitcoin-Compatible Anonymous Payment Hub Paper](https://eprint.iacr.org/2016/575) 59 | -------------------------------------------------------------------------------- /explained.md: -------------------------------------------------------------------------------- 1 | # ARK protocol explained 2 | 3 | ## Intro 4 | 5 | This is based on my (very limited) understanding of the ARK Bitcoin L2 protocol. So naturally there will be mistakes and I want to apologize 6 | for them upfront. My hope is that instead of blaming you can come up with some good PRs to improve the document. 7 | (This also exploits a psychological fact: rather than answering questions, people are more vocal when somebody is wrong on the internet :p) 8 | 9 | Goals are that this becomes factually correct but on the other hand also as simple as possible so a newcomer can easily understand what is going on. 10 | 11 | Analogies usually make things easier to understand so I'm starting this way, but perhaps we will need to change that in the future. 12 | 13 | ## ARK protocol analogy 14 | 15 | ARK is like an amusement park. An ARK service provider (ASP) is the actual amusement park down the road. There can be many instances of them but since one doesn't need to interact with the other ones we will focus only on one. 16 | The only ride offered is a "lightning train". More on this later. But before you can use it you need to buy chips (vTXOs). 17 | 18 | So people come to the entrance and every 5 seconds they put money (BTC) on the table (offer some bitcoin UTXOs) and get chips (vTXOs). Or rather people also bring their own plastic, park just adds a stamp and makes the chips valid (convenant construction so the on-chain footprint is minimal). There is a green chip worth 1000 sats, a blue one worth 10k sats and so on. The cashier has no clue who got which particular blue chip, he just knows that the same amount of chips were approved as there was money (actually even bit less since there is a service fee). Each time a new round of chips were "sold" cashier runs to the bank and puts the money into a time-locked safe (a bitcoin transaction is created). This way the amusement park cannot touch the money for 4 weeks. 19 | 20 | Chips have an expiration time. Think of it like the park changing all the stamps. But the neat part is that during the validity of the chips user A can directly trade them with user B. It still works like bitcoin transactions, so A doesn't directly give B the chips but instead creates another vTXO which has an input from the previous vTXO (and thereby destroying the old vTXO). However this is all off-chain. 21 | 22 | Only when the amusement park is non-cooperative and you still have valid chips you can get money (BTC) back but this is costly. You need to run to your local court (bitcoin blockchain) with the picture of the entrance (pool transaction id) and history of coin changing hands. Then the court says ok seems the park was FDIC insured afterall, go on place your chips into this locker then you can create a new transaction. 23 | 24 | Else there is no way to convert chips back to money again. You might be wondering what to do to prevent a chip from expiring. Well you again come to the entrance and instead of money offer the old chip. Remember this is a local thing, nobody else 25 | accepts those chips (beside people trusting the ASP). So if also the cashier plays dumb you can take it to the court (like explained in the previous paragraph). Usually that will not be the case and amusement park will honor the face value of the chip (that was once rubber stamped by them). 26 | 27 | Problem is just the "official requirement" that all chips must be backed by real-money (which comes from the fact vTXO cannot be used as an UTXO input for a new transaction). So if you put a blue chip on the table amusement park will come up with real 10k sats and put them into the box with the other money collected. So in essence park provides liquidity. They know that after the 4 weeks all the chips will be worthless and the bank safe time-lock will expire so they can get back the loaned money. And the service fee compensates them for their time. Afterall also the collected money is locked. Exchanging old chips for newer ones does not accure a service fee (but you alredy paid once for the initial exchange). TODO: is this correct?! There is still the possibility of user cheating and double spending the vTXO but in that case park has to involve the court. 28 | 29 | Now we learned that people come to this amusement park only for the side-effects i.e., to get cool easily tradable chips. But instead of trading with each other they can also use the chips to pay for the "lightning train". This basically means park is paying your lightning invoice in off-chain exchange for your chips (in a similar way as if this was a custodial lightning service provider just without the need to fully trust the ASP). 30 | 31 | ## Tradeoff 32 | 33 | The ARK tradeoff is basically that ASPs do lots of bitcoin transactions (with some upper bound independent of usage), but all users can transact without the need to hit the blockchain (unless there is some cheating). 34 | So eventhough there are a lot of transactions it is still O(1). According to [Stacker.News thread](https://stacker.news/items/181441) ~15k vB is commited to mempool every 10 minutes (which limits number of ASPs to around 256). 35 | 36 | The only time users need to utilize the bitcoin blockchain is to acquire vTXOs but even that will be a batch transaction with multiple users (which like a coinjoin ensures anonymity). The other way is to acquire chips (vTXO inputs to your newly created vTXO) on the secondary market (possibly even directly for fiat). 37 | TODO: or by lifting an UTXO in a trustless way? I suppose lifting is the pool transaction already. 38 | 39 | ## FAQ 40 | ### Connectors 41 | 42 | This is nicely explained already in https://www.arkpill.me/deep-dive. What I did not understand however was if you had a hypothetical `OP_CHECKTXIDFROMUTXOSETVERIFY` it would work with any transaction ID. The "connector hack" works just 43 | for special transactions. The transactions are special in a sense that they contain an additional output that another transaction can use as input. It is just 450 sats so it is above dust limit. I suppose anyone could spend that but it does not make sense since the reward is minimal in comparison to transaction fee to actually sweep the funds. By commiting to this input your tx can be put on-chain only if the connected one already exists (and thus form the "txlock"). 44 | 45 | ### DoS issue 46 | 47 | How does the ASP make sure a user doesn't DoS it? In a sense that user A doesn't transfer his vTXO to A' and then to A'' and so on. 48 | ASP always needs to "cough up" a new ("real") UTXO for a transfer to happen so 1 BTC vTXO could soon mean a lot of BTC locked on the ASP side. 49 | 50 | The missing point I did not understand was that despite designed to save blockspace transfers on Ark are not totally free from an end-user perspective. There is always a cost attached and it could even be dynamically adjusted depending on how much capital ASP has to spare. 51 | So it's still asymmetrical (ASP uses more bitcoin than user), but at least user can't execute the attack free of charge. This brings 52 | the next question how does the user refresh their vTXO before expiration then. Or are his sats dimishing this way despite doing transactions. 53 | The trick here is that from the vTXO (that is not published) it is not evident 54 | how old it is. But ASP of course knows the age since he had to construct the covenants. So it is trivial for the ASP to offer a discount or more likely even free transfer some short period before old vTXO expires. In that time window you either refresh the vTXO by transfering it to yourself or to somebody else (and those two are not distinguishable). But that is all an implementation detail of ASP (not a problem that needs to be dealt on Ark protocol). 55 | --------------------------------------------------------------------------------