Typefully

Avalanche Warp Messaging

Avatar

Share

 • 

3 years ago

 • 

View on X

At 6:42:29 AM UTC (1:42:29 AM ET) this morning, December 22nd, 2022, the first native Cross-Subnet Message was sent on #Avalanche Mainnet using **Avalanche Warp Messaging**.
1/ Avalanche Warp Messaging (AWM) is the Native #Avalanche Subnet-to-Subnet communication protocol that allows ANY 2 blockchains running on different Subnets to send/verify arbitrary messages to/from each other.
2/ While AWM is now live as of Banff 5 (AvalancheGo@v1.9.5), the foundations for this new mechanism were being laid since the launch of #Avalanche Mainnet.
3/ It all starts with the #Avalanche design. Since the launch of the network, all validators have had to validate the Primary Network AND all Subnets they are participating in. This is VERY important because the P-Chain (in the Primary Network) contains all Subnet staking info.
4/ Between AvalancheGo@v1.3-1.8, the P-Chain was rewritten and optimized a number of times to enable the efficient storage and lookup of staking info about any Subnet or Avalanche Validator on demand.
5/ The Banff Release (AvalancheGo@v1.9.0) augmented the Subnet staking info on the P-Chain with new validator BLS keys that could be used to produce Multi-Signatures: crypto.stanford.edu/~dabo/pubs/papers/BLSmultisig.html (HUGE thanks to @danboneh, @manudrijvers, and @gregoryneven for their work here)
6/ Banff 1-4 added a number of tweaks to the P-Chain and VM interfaces to make it possible for any Subnet running on #Avalanche to access the staking info and BLS Public Keys associated with any Subnet. (check out my previous tweets for a full accounting of this progress 🤓)
7/ Banff 5 adds the final pieces to the VM Interface to make native Cross-Subnet messaging possible: 1) BLS Signature Generation via gRPC interface (so that BLS secret key is not exposed to any VM) 2) BLS Multi-Signature Verification using stake weights
8/ So how does this all work? Lucky for you, I crafted 🎨 this simple diagram to explain how AWMs are generated and verified:
9/ First, any #Avalanche Validator that wants to generate BLS signatures must register their BLS Public Key and BLS Proof-of-Possession on the P-Chain when starting their staking period. This BLS key is recorded in the P-Chain database so that any VM can quickly query its value.
10/ Next, that validator must join a Subnet (or Elastic Subnet) of their own creation or one that already exists. (yes, AWM works for both Subnets AND Elastic Subnets 👀 )
11/ At any point, the VM running on the Subnet can trigger the generation of a BLS signature over an arbitrary payload. It is up to the VM to determine both the fee on the blockchain for triggering a generation and for determining what to put in this payload (any byte array).
12/ Once each validator has generated a BLS signature over the payload, anyone wishing to broadcast the message to another Subnet can collect the validator signatures and form a BLS Multi-Signature that can be processed by any other #Avalanche Subnet. (more on this later)
13/ Now for the fun part. It is up to each Subnet to determine if it wants to accept messages from another Subnet and, if so, how much stake must have signed a message for it to be considered valid and/or safe. TL;DR each Subnet defines its own AWM security level. 👀
14/ If a Subnet chooses to process another Subnet's message, it will look up both BLS Public Keys and stake of the origin Subnet from the P-Chain. This means there is no "per connection" overhead to maintain communication between Subnets, making any-to-any comms practical.
15/ The "stake" here is the Subnet's native unit of weight, not the amount of AVAX its validators' have staked. In a Subnet this is the "weight" assigned by the Subnet operator or the amount of "user-specified custom tokens" staked by each Elastic Subnet participant.
16/ If a Subnet wishes to broadcast data to any Subnet willing to listen, it can send an "Anycast Message". This enables an "oracle" Subnet to emit a periodic heartbeat that can be utilized by any other Subnet (it does not need to send a direct message to every other Subnet).
17/ To make AWM as scalable as possible, messages do not pass through the Primary Network at all. It is up to Subnets and their users to determine how they want to ferry data from source to destination and what sort of guarantees they want to provide around transport.
18/ AWM is a primitive that any VM developer can use how they see fit. They get to determine what messages look like and how their VM will interact with these messages. You can even overlay messaging formats from other teams on top of AWM if they work with your VM.
19/ So what happened at 6:42:29 AM UTC on 12/22/2022? @stephenbuttolph sent the FIRST Avalanche Warp Message using a new Proof-of-Concept VM he made called XSVM (github.com/ava-labs/xsvm). This VM allows for simple AWM transfers between any 2 Subnets running it out-of-the-box.
20/ This AWM payload sent 1 schmeckle (49463 units) between the "let there" and the "be messaging" chains on #Avalanche Mainnet. You can find these chains here: * avascan.info/blockchain/TvcBK7xMEHuqKCs8bmuuuEYk82Yo84dA5TFPU1NQdpVzdspNV * avascan.info/blockchain/zxgvYNGgZ8SzRF9F12eYCBYrSzVQT4nKYecoba8p3hXxojsxE
21/ Because AWM communications are not recorded on any chain in the Primary Network, the only way for you to view this historic moment is to join either of these Subnets on your node. Or better yet, create your own Subnets and try it out yourself: github.com/ava-labs/avalanchego/tree/master/wallet/subnet/primary/examples
22/ In the coming weeks, we'll share a more technical write-up of how all this works but we couldn't wait to share all of this AWESOME news with the #Avalanche community ASAP!
23/ Avalanche Warp Messaging (AWM) is the catalyst that will spark a Cambrian explosion of Avalanche Subnet development. With this release, Avalanche provides a best-in-class toolkit for blockchain developers.
24/ You can launch your own Golang or Rust-based blockchain and reward any node that stakes your own token for validating it, all while natively interoperating with the entire ecosystem. This is the result of years of work and I couldn't be more proud of how it turned out. ❤️
25/ To take advantage of AWM, update to Banff 5 (AvalancheGo@v1.9.5) today! github.com/ava-labs/avalanchego/releases/tag/v1.9.5 🚧 This release introduces VM@v21 to support generating BLS signatures. If you run a Custom VM, you will need to update it to run with v1.9.5. 🚧
You can read the unrolled version of this thread here: typefully.com/_patrickogrady/bo39clG
You can also read more about Avalanche Warp Messaging on @TheBlock__: theblock.co/post/197476/avalanche-upgrade-banff-5
Or on the @avalancheavax blog: medium.com/avalancheavax/avalanche-warp-messaging-awm-launches-with-the-first-native-subnet-to-subnet-message-on-avalanche-c0ceec32144a
Avatar

patrickogrady.xyz

@_patrickogrady

founder @commonwarexyz || previously @avalabs @coinbase @stanford || opinions are my own and will probably change