Gloria Zhao And Brink Are Set To Give Bitcoin Mempools An Upgrade

Bitcoin development nonprofit Brink has awarded its first fellowship to Gloria Zhao, who will work on package relay for Bitcoin mempools.
Bitcoin development nonprofit Brink has awarded its first fellowship to Gloria Zhao, who will work on package relay for Bitcoin mempools.
Bitcoin development nonprofit Brink has awarded its first fellowship to Gloria Zhao, who will work on package relay for Bitcoin mempools.

Bitcoin development nonprofit Brink has awarded its first fellowship to Gloria Zhao, who will work on package relay for Bitcoin mempools.

Brink, the new nonprofit founded by John Newbery and Mike Schmidt to train and support Bitcoin developers, today announced Gloria Zhao as its first fellow. After graduating from Berkeley with a degree in computer science this month, Zhao will familiarize herself with contributing to Bitcoin Core and related open-source projects under mentorship of Newbery. Her year-long fellowship is funded by donations from Square Crypto and the Human Rights Foundation.

“I want to be a serious and long-term Bitcoin Core developer, which I don’t imagine is an extremely rare interest or anything, but there are a ton of technical and psychological barriers to overcome,” Zhao told Bitcoin Magazine. “Having a supportive community has been extremely important in my personal journey and, in general, John's demonstrated a strong interest and ability to foster new contributors into long-term contributors. My main reason for joining the Brink fellowship instead of grants is the mentorship he's offering.”

Zhao will in particular focus on package relay, a proposed upgrade to Bitcoin’s handling of unconfirmed transactions which could improve Bitcoin’s user experience, optimize fee market dynamics, and — perhaps most importantly — make Layer 2 protocols like the Lightning Network more robust.

Package Relay

A Bitcoin node’s mempool (memory pool) is the collection of transactions it has received but that have not yet been confirmed in a block. Nodes forward transactions from their mempool to peers on the network, and miners select transactions from their mempool to include in a new block.

Mempools have a size limit. This limit can be configured for each node (the default for Bitcoin Core nodes is 300 megabytes) but when it is full, some transactions must be dropped from the mempool before new transactions can be added. Currently, this selection is based on fees: transactions that include the lowest fees are dropped from mempools in favor of transactions that include higher fees.

This may seem like the obvious solution, because miners normally apply the same policy when selecting which transactions they include in blocks: the transactions that pay them the most fees. Yet, there is a subtle — but important — difference. To maximize their income, miners don’t just select on the basis of fees included in individual transactions, they also select based on the combined fees of transactions that depend on each other.

If, in technical terms, the “parent” transaction sends coins from address A to address B, and the “child” transaction sends the coins from address B to address C, the child can’t confirm if the parent doesn’t also confirm. So, a miner might choose to include a parent in a block even if it includes a very low fee, as long as the child includes a high enough fee to compensate.

It sometimes comes in handy that miners base their selection on clusters of transactions instead of just individual transactions. If a transaction with a low fee which is taking long to confirm, the recipient can opt to spend the coins from the unconfirmed transaction to themselves in a new transaction with a high fee to get both confirmed. This trick is called Child Pays For Parent (CPFP).

CPFP can be especially important in scenarios where a transaction requires a confirmation before a time-lock expires. The most obvious example is a “justice transaction” (also known as a “penalty transaction”), which is key to the security of the Lightning Network. These transactions require timely confirmation to prevent a malicious Lightning channel partner from claiming more funds than they have the right to.

While CPFP can be used to prevent such scenarios, it doesn’t always work.

“The danger comes when, in a CPFP scenario, the child is fine, but the parent doesn't meet the mempool minimum policy,” Zhao explained. “Say the mempool is so full that the parent's fee is lower than the lowest-fee transaction in the mempool. Then, your hands are tied. As of right now, the validation logic doesn't consider CPFP for such a transaction.”

In other words, if nodes drop the parent transaction from the mempool because it doesn’t have enough fees, they won’t accept the child transaction either: it spends coins that the nodes aren’t aware of. In the context of Lightning, this means the justice transaction wouldn’t confirm in time, and the malicious channel partner gets away with their theft.

Package relay would solve this problem by introducing a change to a node’s mempool and transaction relay policies that lets it apply CPFP-type logic. Although implementation details are yet to be worked out, it would essentially allow for the bundling of dependent transactions. Bitcoin nodes would accept and relay transaction packages, protecting transactions that don’t meet mempool policy individually.

Zhao:

“Package Relay will strengthen Bitcoin's base-layer security guarantees, enabling Bitcoin's ecosystem to safely expand in functionality and usability through protocols like the Lightning Network.”

The Fellowship

Brink’s year-long fellowship program, which is unique in the Bitcoin industry, will help more developers contribute to Bitcoin projects. Fellowships will be funded by donations, with Zhao’s program to be funded by gifts from Square Crypto ($100,000) and the Human Rights Foundation’s Bitcoin Development Fund ($50,000).

Square Crypto is the Bitcoin development arm of Square, the payments company founded and run by Jack Dorsey (also the co-founder and CEO of Twitter). Besides employing a small team of Bitcoin developers, whose main focus is the Lightning Development Kit, Square Crypto has so far issued 19 grants to different Bitcoin projects and developers. Zhao’s Brink fellowship will be the 20th.

"Brink is creating the first bitcoin mentorship program of its kind, and we want to support it," Square Crypto lead Steve Lee told Bitcoin Magazine. "We are thrilled Gloria was chosen as the first fellowship recipient, and we are happy our funding will go to her. The package relay project is very valuable for bitcoin, crucial for security and very aligned with Square Crypto's goals."

The Human Rights Foundation (HFR) is a New York-based nonprofit that promotes and protects human rights globally. Earlier this year, the foundation launched its Bitcoin Development Fund, a donation-based fund to support Bitcoin developers who make the Bitcoin network more private, decentralized and resilient. Zhao’s fellowship represents the fourth grant awarded by the Human Rights Foundation.

”HRF is delighted to support Gloria through our Bitcoin Development Fund,” said HFR Chief Strategy Officer Alex Gladstein. “The focus of her work is on critical infrastructure that paves the way for Bitcoin to become more private at scale, and is very much aligned with our mission.” 

He added: “This gift will be amplified by the fact that it is helping support Gloria’s fellowship at Brink, where she will receive world-class mentorship and guidance, making her work as effective and efficient as possible.”