Web3.py: connecting Python devs to Ethereum

Why is your project important?

web3.py is the standard for interacting with the Ethereum blockchain for Python developers. The open source library garners well over one million downloads per month and underpins many Python developer tools, including the Ape and Brownie development frameworks. web3.py-adjacent libraries, including py-evm, are dependencies in the Vyper/Titanoboa development stack.

More broadly, we value language diversity within Ethereum tooling, and believe the path to mass adoption requires meeting developers where they are. The web3.py API, documentation, blog, and reference repos place high priority on approachability for anyone comfortable with Python.

Milestones Achieved

  • This month, we’ve released the first beta versions of the next major version, v7, which includes vastly improved asynchronous providers, a redesigned middleware API, and a long list of smaller breaking change UX improvements.
  • Well over one million web3.py PyPI downloads per month
  • Over 200 pull requests merged into web3.py in 2023
  • 22 web3.py releases in 2023
  • GitHub reports web3.py is a dependency of over 18k repos and 800 packages
  • Designated as a “critical” project in PyPI - the project is in the top 1% of downloads over the prior 6 months.

Roadmap and Future Goals

  • Work continues on v7 as we iterate towards the stable release in Q2.
  • Benchmarking and performance improvements are a priority this year, particularly within py-evm.
  • Research spikes on UX improvements to support L2 usage, account abstraction, and the Portal Network, as a few examples.
  • Continuing a steady stream of ecosystem support, documentation upgrades, tutorials, hackathon starter kits, and so on.
  • Additional context available in the roadmap.

Funding Sources and Goals

Today, the Ethereum Foundation covers the salaries of those maintaining web3.py and adjacent Python libraries. We’ve also benefitted from Drips including web3.py in their Octant Drip List in previous Epochs.

In the long term, the Ethereum Foundation seeks to gradually eliminate the ecosystem’s reliance on it for sustainability. We believe public goods funding protocols, such as Octant, will play an important role in supporting the continued maintenance of FOSS libraries like web3.py, eth-account, py-evm, and more that are stewarded by our team.

Team Information

Our team of five devs collectively has over 15 years of experience maintaining open source libraries within the Ethereum ecosystem, dating back to the Mist Browser in 2017.

Links

6 Likes

gm :sun_with_face:, since last post:

These things happened:

  • Dev
    • Six web3.py v6 (stable) releases
    • Four web3.py v7 (beta) releases
      • On pace for v7 stable release by early July(!)
    • (Supporting releases of eth-utils, eth-typing, eth-account, eth-tester, py-evm, py-geth, eth-abi, etc.)
    • Work included: introduction of batch requests (v7), stabilizing of WebSocketProvider and eth_subscribe support, blob (EIP-4844) support, full Python 3.12 support, session and request cache configuration, improved error handling, and performance improvements.
  • Education
    • Docs overhaul in v7
    • Guides/tutorials:
      • WebSocketProvider - intro to websockets, the provider, and subscribing to events
      • Blobs - intro to EIP-4844 and “type 3” transactions
      • Bloom Filters - walkthrough of filtering for Ethereum events
  • Funding
    • Octant (Epoch 3): 32.3391 ETH
    • Gitcoin (GG20): $7,519.49

These things are happening next:

  • (Themes still apply from original post’s Roadmap and Future Goals)
  • Prague/Electra network upgrade support
  • UX spike: more powerful contract APIs for executing functions and accessing event data
  • UX spikes: L2s and AA, to identify potential web3.py features
  • Improved type support across libraries
  • Final prep for fresh audits of eth-account and eth-keys
  • Typical maintenance: bug squashing, dependency maintenance, etc.
3 Likes
  • Total Funds Received from Octant so far: 53.1 ETH
  • Funds Spent: 53.1 ETH
  • Detailed Utilization: The web3.py team maintains about a dozen open-source Ethereum Python libraries (e.g., web3py, eth-account, py-evm, eth-utils) and creates educational resources to promote the adoption of those tools. All funds received are distributed to the five full-time developers on the team.

Milestones and Deliverables

Recently updated team goals include: Aiding EIP implementation and testing, Reducing UX friction, and Educating and inspiring builders. Broadly, our priorities are tasks that are in service of those goals.

  • Milestone 1: Aiding EIP implementation and testing
    • Description: Following a team retreat earlier this year, we identified that the biggest opportunity for us to make a meaningful impact in the ecosystem was to aid the EELS (execution specs) team in their pursuit of simplifying EIP implementation and testing.
      • Research spike: Can eth-tester support EELS as a new back-end?
    • Immediate Outcome:
      • After much rabbit-holing, an experimental EELS back-end exists and passes the web3.py test suite. Polish and performance benchmarks remain.
  • Milestone 2: Reducing UX friction
    • Description:
      • Spike: What private utilities within web3.py (and eth-utils) are useful and stable enough to expose publicly?
    • Immediate Outcome:
      • eth-utils received a major investment, exposing many previously private utilities and authoring a couple new ones. All methods are available within web3py, making life easier whenever needing to parse names, values, types, or function signatures from an ABI.
      • Improved type support across many of our libraries. The common denominator, eth-typing, just had its stable v5 release.
  • Milestone 3: Educate and inspire builders
    • Description:
      • Overarching goal is to build an “Ethereum Python Speedrun” workshop for Devcon, designed to help Python devs go from zero to hackathon participant.
    • Immediate Outcome:
      A couple of web3py-powered open source Python tools built in service of that goal:
      • sneko - a clickable terminal application for compiling Vyper and Solidity contracts
      • popupfaucet - an easy and reliable way for workshop hosts to offer testnet ether to attendees
  • Karma Gap: https://gap.karmahq.xyz/project/web3py

Challenges

  • Previous Challenges:
    • Description: In general, prioritization. The industry moves fast and we try to balance bug reports, feature requests, network upgrades, research spikes, maintenance and moonshots. It’s not always obvious what should be next.
    • Updates: During a team retreat, we brought in some additional ecosystem contributors to pick their brains about what they see as most important for the ecosystem and where we could step up.
    • Resolution: It’ll always be a balancing act. We’ve identified some team goals to serve as North Stars, making it easier to evaluate whether a particular task is aligned with them. Another resolution was to explore how we could ease or accelerate the process of implementing and testing EIPs, resulting in the EELS collaboration.
    • Lessons Learned: Its critical to regularly ask diverse ecosystem participants for their read on gaps and opportunities within Ethereum’s tooling and coordination layers. In short, stay connected, and find ways to routinely step back to view the wider picture.

Outputs and Outcomes

Outputs (Last Epoch):

  • Output 1: Aiding EIP implementation and testing
    • An experimental EELS back-end built and passing the web3.py test suite.
    • Short-term Outcome: EELS team excited to collaborate and figure out next value-add for plugging the EELS back-end into web3py tooling, accelerate EIP implementation, and increase stakeholder confidence in changes to the network via improved testing.
  • Output 2: Reduce UX Friction
    • major improvements to ABI utilities
    • lib releases:
      • 3 web3.py v6
      • 3 web3.py v7 (stable release set for 8/21)
      • 1 eth-account
      • 2 eth-utils
      • 7 eth-typing
    • Short-term Outcome: We’ve added 12 public utility methods for working with ABIs. While any metrics would be hand-wavy for this, we expect fewer ABI-related headaches reported in Discord and GitHub.
  • Output 3: Educate and inspire builders
    • A couple open-source Python repos, eventually supporting a Ethereum Python Speedrun workshop:
    • sneko v1 - a clickable terminal application for compiling Vyper and Solidity contracts
    • popupfaucet v1 - an easy and reliable way for workshop hosts to offer testnet ether to attendees
    • Short-term Outcome: sneko included in Week In Ethereum, popupfaucet awarded 3rd place in Optimism’s “Just Improve It” category of the Superhack hackathon. Some buzz on socials.

Long-term Outcomes:

  • A vastly more reliable and performant set of Python libraries over a steady set of releases, culminating in a stable web3py v7 release!
  • While the PyPI downloads were regularly trending up, we’ve seen a …surprisingly large uptick over the last Epoch. For example:
  • Traffic to the docs is down slightly month-to-month (13k visitors in July, down from 17k in March).
  • No recent submissions of our feedback form on the docs.

Plans for Potential Funds Raised in the Next Octant Allocation Window

  • Goal 1: Aiding EIP implementation and testing
    • Description: 1) Research spike: coordinate with EELS team on reducing friction for the execution specs behaving as a dependency to other libraries. 2) Implement the EELS back-end, accessible via eth-tester.
    • Expected Outcome: An EELS back-end enables EIP authors and researchers to gain significantly more confidence in their EIPs by testing against a mature Ethereum JSON-RPC test suite.
  • Goal 2: Reduce UX friction
    • Description: Introduce utilities for common contract and encoding/decoding use cases.
    • Expected Outcome: Similar to the ABI utilities, this effort intends to smooth out common headaches (e.g., subscribing to logs for a contract event) in these additional domains by exposing stable private utilities and/or adding new ones.
  • Goal 3: Educate and inspire builders
    • Description: Build and deliver an Ethereum Python workshop designed to take Python developers from from zero Ethereum experience to hackathon participant.
    • Expected Outcome: Empowering newcomers in the Python ecosystem and getting a better handle on their sticking points. Learnings can be used to update resources to smooth out rough edges and keep the flywheel going.

Other Funding

  • Grant Funding Received Since the Last Epoch: None
  • Other Non-Grant Funding Sources: EF salaries

Future Plans for Financial Sustainability

The web3.py team still has no plan to monetize its tools, create a token, or sell services. The team relies on the Ethereum Foundation for funding today, but that is not guaranteed in perpetuity. We see initiatives like Octant as integral to the long-term sustainability of these Python libraries and are grateful for your support of our work.

2 Likes

@wolovim Thanks for the awesome update and the detail you put in :slight_smile:

You noted that traffic to the docs is down and no recent submissions on the feedback form. Maybe consider looking into why that’s happening. Is there a way to engage users more actively or gather feedback in other ways?

It’s an interesting topic since you also mentioned there being an uptick library downloads.

Anyway just a minor point. Appreciate the update and keep up the awesome work :muscle:

2 Likes

thanks @mat7ias - good question, which prompted a good discussion internally. we’re going to broaden the scope of that feedback form a bit, then start surfacing it more often: blog posts, discord announcements, README, etc. we have done an annual survey the last couple years, but the hope for the indefinite form is to collect desires or frustrations while they’re still burning. we’ll see if those tweaks make a difference.

re: the docs data point, can only make guesses as to that lack of correlation between installs and docs hits. it might suggest one or more big operations coming online or a misconfiguration of some CI processes + resources to burn? we may never know for sure. we’ll keep an eye on the numbers over time.

1 Like
  • Total Funds Received from Octant so far: 58.56 ETH (5.461 ETH in Epoch 5)
  • Funds Spent: 58.56 ETH
  • Detailed Utilization: The web3.py team maintains ~20 open-source Ethereum Python libraries (e.g., web3py, eth-account, py-evm, eth-utils) and creates educational resources to promote the adoption of those tools. All funds received are distributed to the five full-time developers on the team.

Milestones and Deliverables

Team “North Star” goals include: Aiding EIP implementation and testing, Reducing UX friction, and Educating and inspiring builders. Broadly, our priorities are tasks that are in service of those goals.

Catching up on last Epoch’s milestones:

  • Goal 1: Aiding EIP implementation and testing
    • Description: 1) Research spike: coordinate with EELS team on reducing friction for the execution specs behaving as a dependency to other libraries. 2) Implement the EELS back-end, accessible via eth-tester. An EELS back-end enables EIP authors and researchers to gain significantly more confidence in their EIPs by testing against a mature Ethereum JSON-RPC test suite.
    • Immediate Outcome: A proof of concept exists(!), but is slow and relies on a forked repo. See future plans below for next steps.
  • Goal 2: Reduce UX friction
    • Description: Introduce utilities for common contract and encoding/decoding use cases.
      • Immediate Outcome: This epoch was focused on contract events. Eight new methods for contract events were added. Contract events now have parity with contract functions; Users can find events by name, signature, selector, or topic. Error messaging has also been improved significantly.
    • Description: Continued investment in the persistent connection providers (AsyncIPCProvider, WebSocketProvider)
      • Immediate Outcome: Persistent connection providers were introduced earlier this year, and have been consistently employed by users who have performance concerns or real-time use cases. Providers are more robust and accessible now after polishing up caching, adding configuration options, and updating docs.
  • Goal 3: Educate and inspire builders
    • Description: Build and deliver an Ethereum Python workshop designed to take Python developers from from zero Ethereum experience to hackathon participant.
    • Immediate Outcome: An hour-long workshop was presented at Devcon. This is an accessible resource for developers to come away with a game plan for how to do well in hackathons using Ethereum Python tools.
  • Karma Gap: web3.py | Karma GAP

Challenges

  • Previous Challenges:
    • Description: The same as usual: prioritization. The industry moves fast and we try to balance bug reports, feature requests, network upgrades, research spikes, maintenance and moonshots. It’s not always obvious what should come next.
    • Updates: We continue to bring more voices into the prioritization conversation, which Devcon helped facilitate. We’re actively moving closer to protocol development by finding opportunities to aid the EELS and EEST teams in their missions.
    • Resolution: It’ll always be a balancing act. We continue to lean on our North Star goals to make it easier to evaluate whether a particular task is aligned with our stated priorities.
    • Lessons Learned: Its critical to regularly ask diverse ecosystem participants for their read on gaps and opportunities within Ethereum’s tooling and coordination layers. Now that we better know which direction to point in, we now know we need better data to decide how to get there. For starters, we’ll look to do more performance benchmark testing in the near future.

Outputs and Outcomes

Outputs (Last Epoch):

  • Output 1: Aiding EIP implementation and testing
    • Continued experimental EELS back-end exploration.
    • Short-term Outcome: We’re now joining EELS and EEST teams syncs and uncovering how we can collaborate, make EELS work as a back-end within our tools, accelerate EIP implementation, and increase stakeholder confidence in changes to the network via improved testing infrastructure.
  • Output 2: Reduce UX Friction
    • 7 web3.py releases
    • Short-term Outcome: Eight new public utility methods for working with contract events, bug fixes, performance and docs improvements. See release notes for details.
  • Output 3: Educate and inspire builders
    • The Devcon workshop is published on YouTube. The workshop highlights several of our Python repos, including a couple more experimental ones:
      • sneko - a clickable terminal application for compiling Vyper and Solidity contracts, which now has a Remix-like playground for deploying and interacting with a contract locally.
      • popupfaucet - an easy and reliable way for workshop hosts to offer testnet ether to attendees.
    • Short-term Outcome: The workshop is a good entry point for Python devs to Ethereum. It provides a guide to hackathons, a speedrun of web3.py and eth-account, and shows what can be built with the tools via sneko and popupfaucet.

Long-term Outcomes:

  • A vastly more reliable and performant set of Python libraries over a steady set of releases, culminating in a stable web3py v7 release!
  • Sustained growth of PyPI downloads with the exception an unexplained dip in eth-account. A few examples:
  • Traffic to the docs continues a modest downward trend month-to-month (e.g., 10k in November, 13k visitors in July). Best guess at explaining the increase in installs + decrease in docs visits: more CI usage + more LLM usage.
  • No recent submissions of our feedback form on the docs.

Plans for Potential Funds Raised in the Next Octant Allocation Window

  • Goal 1: Aiding EIP implementation and testing
    • Description: 1) Research spike: evaluate web3.py test performance with an EELS backend, and identify opportunities to improve that performance. 2) Ready eth-tester for generic usage by moving validation and normalization logic from web3.py to eth-tester.
    • Expected Outcome: An EELS back-end enables EIP authors and researchers to gain significantly more confidence in their EIPs by testing against a mature Ethereum JSON-RPC test suite. The updates to eth-tester also clear the way to develop an Anvil-like CLI tool using that EELS back-end.
  • Goal 2: Reduce UX friction
    • Description: 1) Extensive benchmarking in web3.py. Users have become more vocal about their use cases requiring greater performance. 2) Pectra (the next Ethereum network upgrade) support in py-evm and web3.py.
    • Expected Outcome: Better benchmarks will enable us to identify bottlenecks and plot a course for improving performance in web3.py. We expect some low hanging fruit that can be knocked out quickly. Petra support is important for direct web3.py users, and also the Ape and Vyper communities.
  • Goal 3: Educate and inspire builders
    • Description: Fine-tune and deploy an LLM to better answer questions for Ethereum Python users. Following the release of web3py v7, public models very often provide low-quality and stale results.
    • Expected Outcome: The MVP will be an admin-tool for our team to input user questions and manually correct results, helping users and improving the model along the way. Answers will also result in updates to documentation and blog posts as appropriate.

Other Funding

  • Grant Funding Received Since the Last Epoch: Gitcoin GG22: $4,696.10
  • Other Non-Grant Funding Sources: EF salaries

Future Plans for Financial Sustainability

The web3.py team has no plan to monetize its tools, create a token, or sell services. The team relies on the Ethereum Foundation for funding today, but that is not guaranteed in perpetuity. We see initiatives like Octant as integral to the long-term sustainability of these Python libraries and are grateful for your support of our work.