Alephium Profile picture
Jun 28, 2022 27 tweets 11 min read Read on X
Hi @Twitter! Today is TTT (tech-thread tuesday).

We’ll explain how Blockflow prevents double-spending using #UTXO, #PoW and #DAG!

We are going deep-nerdy, so strap-on!

This 🧵is inspired from a convo between @wachmc & @programmargorp in our Discord discord.com/channels/74774…
This started well, but while writing it, it took on a life of its own as we went further down the rabbit-hole, so it’s a bit of a monster thread! Please bear with us! Image
First, some definitions! You can skip that if you’re already an expert!
Double-spending is the risk that a digital currency can be spent twice or more. It’s a big problem that you have when you remove the central authority (think:bank) that ensures that you don’t spend more than you have.
An Unspent Transaction Output (UTXO) is the technical term to describe the ownership of an amount of digital currency (like #Bitcoin or Alephium). It’s one of the two main record keeping models of blockchains, the other one being the account model (used by #Ethereum & Co). Image
PoW is a consensus mechanism allowing the #Bitcoin and other blockchains to propose blocks grouping, ordering and timestamping transactions without a central authority. In Alephium’s case it’s a variant called #PoLW (Proof of Less Work), but that is a story for another day!
DAG (for “Directed Acyclic Graph”) is a method to organize the complexity of multiple parallel nodes (in our case each node represents a block) in a directional coherent flow of data.

Think about it as a way to optimize a complicated tree-like structure into a simpler flow. Image
So, let’s get to our question! Starting with how does Bitcoin prevent double-spending?

In Bitcoin, double-spending is prevented by the combination of two technologies: #UTXO & #PoW.
The UTXOs are ordered into chained & timestamped blocks (eg. block-chain) rendering them nearly impossible to change/double-spend without controlling 51% of the energy spent by the entire Bitcoin network (PoW)...
And the more blocks are added (~ every 10 minutes), the harder it gets. That is why finality in #Bitcoin takes a few blocks: the more blocks are mined, the more energy it would take to rewrite history.

Transactions are usually considered final after 6 blocks (~60min).
If you think managing UTXOs securely on one chain (ie #Bitcoin) is complicated, think how hard it becomes when you have multiple, parallel chains, all producing blocks at the same time and trying to maintain that in a coherent ledger!
To be able to manage more transactions per second than #Bitcoin, Alephium is a sharded blockchain.

As of today, it runs on 4 groups of 4 shards each, meaning 16 shards running in parallel (shards ~ internal chains).
Blockflow, our consensus & sharding algorithm, defines the rules on how, on each shard, transactions get mined into blocks every 64 seconds.

16 simultaneous blocks every minute or so!

How do we maintain coherence among those blocks? We create dependencies!
A dependency describes the relationship of UTXOs across blocks and specifies the particular relationships between inputs and outputs across these blocks.

For example in #Bitcoin, a block contains a hash of the previous block, that’s a dependency across time!
In Alephium, on top of the time dependency (like in #Bitcoin), each block includes the hash of the latest blocks of all the other shards from its group, and the blocks from the intra-shards of all the other groups!
E.g. for a block in shard (0,0), there are dependencies to shards (0,0) (0,1) (0,2) (0,3) and to the other groups 1, 2, 3! Image
And if we generalize, if we have G groups, each block in a shard will include the hash of the blocks from 2G - 1 shards.

Wanna read more about the math stuff, reach out to our whitepaper!

github.com/alephium/white…
This is awesome, because first it means that effectively the security is accumulated across all shards.

The more mining on any shards, the more security on the whole network: what an elegant mechanism!
But this is also precisely what gives us scalability, which is the point of having sharding in the first place!

More shards, more blocks, more transactions!
But there’s a complication!

How do the miners know which transactions to include in which block and when?

And how do they know which dependency needs to come first, to where and in general maintain a single path forward across so many shards?
And here #Blockflow algorithm comes in!

It is the mechanism allowing only the correct dependencies to be mined, in the correct order, so that there’s only one legitimate version of events!

It allows miners to know which are the good dependencies and pack valid transactions.
A new block is mined when this block together with its dependencies has the heaviest accumulated weight (intuitively most accumulated difficulties). Image
With the 2G-1 dependencies for each of the blocks described above, the #BlockFlow algorithm knows just enough information to ensure that no UTXO can be double spent even across shards.
And this is how you ensure double-spending prevention in a sharded #PoW blockchain like Alephium! Image
If you’re a dev, join us on GitHub, discover our code, and contribute! github.com/alephium
Join us also on Discord and ask questions! The team is there to answer almost all of the time.
discord.gg/JErgRBfRSB
If you went through that complete thread, thank you! Let us know if you have subjects you’d be interested about in the comments! And please retweet the first post to help us spread the nerdiness!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Alephium

Alephium Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @alephium

Mar 22
🏆 Hackathon Winners Announced!

We want to thank all participants for their amazing efforts & enthusiasm.

As well as @BITMAINtech, @Blockflow_DAO @CetaceanCapital, and @dappnode for their support.

What en extraordinary event!
The whole Alephium core-team has been blown away by the energy of participants and the quality of the submissions.

It wishes to express to all participants its immense pleasure to see @Alephium’s tools, languages & protocol used with so much creativity & dedication.
The jury has taken its time to evaluate each submission on its own merit.

Two weeks of intense building have ended up with 26 submissions from the 105 participants registered all around the world. Image
Read 18 tweets
Jan 30
Rhône Network Upgrade 🧵#2

@alephium will enable Programmable Gasless Transactions!

Why?
What does this mean?
Why is it important?

⬇️ Image
Imagine you're a new user wanting to interact with a dApp on Alephium, for example, a Decentralized Exchange.

Even if you are swapping other tokens, you need $ALPH to interact with the blockchain and get your desired item.

It's inconvenient if you don't have $ALPH on hand.
That's where gasless transactions come in.

A different address (or smart contract) pays the gas for you on the gasless transaction.

And how can this work?

There are two possible ways.

gate.io/learn/articles…
Read 12 tweets
Jan 16
Sharding is a term we often hear in the blockchain space, but what does it really mean?

Especially in the context of UTXO and PoW based systems, @alephium sharding takes a very unique approach.

Let's dive in! 🧵 Image
Technically, sharding simply means partitioning.

And there are numerous ways to implement it.

We've talked about it quite a lot in the past already!

medium.com/@alephium/shar…
In @Alephium's case, we leverage sharding at 2 levels:

1️⃣ The addresses are partitioned into groups
2️⃣ The transactions are partitioned even further into 16 chains

But how does that work?
Read 11 tweets
Nov 9, 2023
The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! The bridge is live! Image
After months of hard work, intense testing and lots of operational/legal considerations & efforts, @alephium's core contributors are very proud to announce the bridge is live on mainnet.
Start using it today to bridge @alephium ↔️ @ethereum!

You can use any of @alephium's wallets - browser extension, desktop, or mobile!

bridge.alephium.org
Read 7 tweets
Nov 7, 2023
Bridge Thread #1

Bridge is getting closer... Did you know tokens never leave their "home" chain when you cross the bridge?

Here's why👇 Image
Let's assume Alice wants to trade 100 $ALPH on a DEX on Ethereum.

She visits the bridge site, connects her @Alephium wallet, and sends 100 $ALPH to Ethereum.

Here's what happens under the hood:
1️⃣ The 100 $ALPH are transferred to the core contract on the native @Alephium chain and are locked.

2️⃣ The Core Contract emits a confirmation message indicating the token locking event. Image
Read 10 tweets
Jun 30, 2023
June was a busy month!🏗️

Let's look at what happened on @alephium 👀
The Core devs deployed a Proof of Concept NFT Marketplace on testnet.
A tech article about how Alephium's Asset Permission System increase smart contract security was published!

medium.com/@alephium/alep…
Read 13 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(