You learn by comparing to what you already know. I was recently bitten by assuming Rust worked as Java regarding transitive dependency version resolution. In this post, I want to compare the two.You learn by comparing to what you already know. I was recently bitten by assuming Rust worked as Java regarding transitive dependency version resolution. In this post, I want to compare the two.

Transitive Dependency Version Resolution in Rust and Java: Comparing the Two

2025/09/21 23:00
7 min read
For feedback or concerns regarding this content, please contact us at [email protected]

You learn by comparing to what you already know. I was recently bitten by assuming Rust worked as Java regarding transitive dependency version resolution. In this post, I want to compare the two.

Dependencies, Transitivity, and Version Resolution

Before diving into the specifics of each stack, let's describe the domain and the problems that come with it.

\ When developing any project above Hello World level, chances are you'll face problems that others have faced before. If the problem is widespread, the probability is high that somebody was kind and civic-minded enough to have packaged the code that solves it, for others to re-use. Now, you can use the package and focus on solving your core problem. It's how industry builds most projects today, even if it brings other problems: you sit on the shoulders of giants.

\ Languages come with build tools that can add such packages to your project. Most of them refer to packages you add to your project as dependencies. In turn, projects' dependencies can have their own dependencies: the latter are called transitive dependencies.

Transitive dependencies

In the above diagram, C and D are transitive dependencies.

\ Transitive dependencies have issues on their own. The biggest one is when a transitive dependency is required from different paths, but in different versions. In the diagram below, A and B both depend on C, but on different versions of it.

Which version of C should the build tool include in your project? Java and Rust have different answers. Let's describe them in turn.

Java Transitive Dependency Version Resolution

Reminder: Java code compiles to bytecode, which is then interpreted at runtime (and sometimes compiled to native code, but this is outside of our current problem space). I'll first describe runtime dependency resolution and build-time dependency resolution.

\ At runtime, the Java Virtual Machine offers the concept of a classpath. When having to load a class, the runtime searches through the configured classpath in order. Imagine the following class:

public static Main {     public static void main(String[] args) {         Class.forName("ch.frankel.Dep");     } } 

\ Let's compile it and execute it:

java -cp ./foo.jar:./bar.jar Main 

\ The above will first look in the foo.jar for the ch.frankel.Dep class. If found, it stops there and loads the class, regardless of whether it might also be present in the bar.jar; if not, it looks further in the bar.jar class. If still not found, it fails with a ClassNotFoundException.

\ Java's runtime dependency resolution mechanism is ordered and has a per-class granularity. It applies whether you run a Java class and define the classpath on the command line as above, or whether you run a JAR that defines the classpath in its manifest.

\ Let's change the above code to the following:

public static Main {     public static void main(String[] args) {         var dep = new ch.frankel.Dep();     } } 

\ Because the new code references Dep directly, new code requires class resolution at compile-time. Classpath resolution works in the same way:

javac -cp ./foo.jar:./bar.jar Main 

\ The compiler looks for Dep in foo.jar, then in bar.jar if not found. The above is what you learn at the beginning of your Java learning journey.

\ Afterwards, your unit of work is the Java Archive, known as the JAR, instead of the class. A JAR is a glorified ZIP archive, with an internal manifest that specifies its version.

\ Now, imagine that you're a user of foo.jar. Developers of foo.jar set a specific classpath when compiling, possibly including other JARs. You'll need this information to run your own command. How does a library developer pass this knowledge to downstream users?

\ The community came up with a few ideas to answer this question: The first response that stuck was Maven. Maven has the concept of Project Object Model, where you set your project's metadata, as well as dependencies. Maven can easily resolve transitive dependencies because they also publish their POM, with their own dependencies. Hence, Maven can trace each dependency's dependencies down to the leaf dependencies.

\ Now, back to the problem statement: how does Maven resolve version conflicts? Which dependency version will Maven resolve for C, 1.0 or 2.0?

\ The documentation is clear: the nearest.

Dependency resolution with the same dependency in different versions

In the above diagram, the path to v1 has a distance of two, one to B, then one to C; meanwhile, the path to v2 has a distance of three, one to A, then one to D, then finally one to C. Thus, the shortest path points to v1.

\ However, in the initial diagram, both C versions are at the same distance from the root artifact. The documentation provides no answer. If you're interested in it, it depends on the order of declaration of A and B in the POM! In summary, Maven returns a single version of a duplicated dependency to include it on the compile classpath.

\ If A can work with C v2.0 or B with C 1.0, great! If not, you'll probably need to upgrade your version of A or downgrade your version of B, so that the resolved C version works with both. It's a manual process that is painful–ask me how I know. Worse, you might find out there's no C version that works with both A and B. Time to replace A or B.

Rust Transitive Dependency Version Resolution

Rust differs from Java in several aspects, but I think the following are the most relevant for the sake of our discussion:

  • Rust has the same dependency tree at compile-time and at runtime
  • It provides a build tool out of the box, Cargo
  • Dependencies are resolved from source

\ Let's examine them one by one.

\ Java compiles to bytecode, then you run the latter. You need to set the classpath both at compilation time and at runtime. Compiling with a specific classpath and running with a different one can lead to errors. For example, imagine you compile with a class you depend on, but the class is absent at runtime. Or alternatively, it's present, but in an incompatible version.

\ Contrary to this modular approach, Rust compiles to a unique native package the crate's code and every dependency. Moreover, Rust provides its own build too, thus avoiding having to remember the quirks of different tools. I mentioned Maven, but other build tools likely have different rules to resolve the version in the use case above.

\ Finally, Java resolves dependencies from binaries: JARs. On the contrary, Rust resolves dependencies from sources. At build time, Cargo resolves the entire dependency tree, downloads all required sources, and compiles them in the correct order.

\ With this in mind, how does Rust resolve the version of the C dependency in the initial problem? The answer may seem strange if you come from a Java background, but Rust includes both. Indeed, in the above diagram, Rust will compile A with C v1.0 and compile B with C v2.0. Problem solved.

Conclusion

JVM languages, and Java in particular, offer both a compile-time classpath and a runtime classpath. It allows modularity and reusability, but opens the door to issues regarding classpath resolution. On the other hand, Rust builds your crate into a single self-contained binary, whether a library or an executable.

\ To go further:

  • Maven - Introduction to the Dependency Mechanism
  • Effective Rust - Item 25: Manage your dependency graph

Originally published at A Java Geek on September 14th, 2025

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact [email protected] for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

UNI Price Prediction: Testing $4.17 Upper Band Resistance, Targets $4.50 by April 2026

UNI Price Prediction: Testing $4.17 Upper Band Resistance, Targets $4.50 by April 2026

Uniswap trades at $3.88 with neutral RSI at 51.98. Technical analysis suggests potential breakout to $4.17 upper Bollinger Band, with bullish targets reaching $
Share
BlockChain News2026/03/12 17:21
Speed, Cost, and Intelligence: How Kie.ai’s Gemini 3 Flash API Balances Performance and Budget for Developers

Speed, Cost, and Intelligence: How Kie.ai’s Gemini 3 Flash API Balances Performance and Budget for Developers

Integrating AI into applications is a balancing act between performance, cost, and intelligence. Traditionally, high-performance AI models come with steep costs
Share
Techbullion2026/03/12 16:55
Cash Flow Valuation HyperLiquid: Could $HYPE Reach $385 in Five Years?

Cash Flow Valuation HyperLiquid: Could $HYPE Reach $385 in Five Years?

Author: G3ronimo Compiled by: TechFlow HyperLiquid has grown into a mature crypto-native exchange, with the majority of its net fees programmatically distributed directly to token holders through an "Assistance Fund" (AF). This design makes $HYPE one of the few tokens capable of being valued based on cash flow. To date, most valuations of HyperLiquid have relied on traditional multiples, comparing it to established financial platforms like Coinbase and Robinhood, using EBITDA or revenue multiples as a reference. Unlike traditional corporate stocks, where management typically retains and reinvests earnings at their discretion, HyperLiquid systematically returns 93% of transaction fees directly to token holders through a support fund. This model creates predictable and quantifiable cash flows, making it well-suited for detailed discounted cash flow (DCF) analysis rather than static multiple comparisons. Our methodology begins by determining $HYPE's cost of capital. We then invert the current market price to determine the market-implied future earnings. Finally, we apply growth projections to these earnings streams and compare the resulting intrinsic value to today's market price, revealing the valuation gap between current pricing and fundamental value. Why choose discounted cash flow (DCF) over a multiple? While other valuation methods compare HyperLiquid to Coinbase and Robinhood via EBITDA multiples, these methods have the following limitations: The difference between the corporate and token structures: Coinbase and Robinhood are corporate stocks, whose capital allocation is guided by the board of directors, and profits are retained and reinvested by management; while HyperLiquid systematically returns 93% of trading fees directly to token holders through a relief fund. Direct Cash Flow: HyperLiquid's design generates predictable cash flows that are well-suited to DCF models, rather than static multiples. Growth and risk characteristics: DCFs are able to explicitly model different growth scenarios and risk adjustments, whereas multiples may not adequately capture growth and risk dynamics. Determining an appropriate discount rate To determine our cost of equity, we start with reference data from the public market and adjust for cryptocurrency-specific risks: Cost of equity (r) ≈ Risk-free rate + β × Market risk premium + Crypto/illiquidity premium Beta Analysis Based on regression analysis with the S&P 500: Robinhood (HOOD): Beta of 2.5, implied cost of equity of 15.6%; Coinbase (COIN): Beta of 2.0, implied cost of equity of 13.6%; HyperLiquid (HYPE): Beta is 1.38 and the implied cost of equity is 10.5%. At first glance, $HYPE appears to have a lower beta, and therefore a lower cost of equity than Robinhood and Coinbase. However, the R² value reveals an important limitation: HOOD: The S&P 500 explains 50% of its returns; COIN: The S&P 500 explains 34% of its return; HYPE: The S&P 500 only explains 5% of its returns. $HYPE’s low R² suggests that traditional stock market factors are insufficient to explain its price fluctuations, and crypto-native risk factors need to be considered. risk assessment Despite $HYPE’s lower beta, we still adjust its discount rate from 10.5% to 13% (which is more conservative compared to COIN’s 13.6% and HOOD’s 15.6%) for the following reasons: Lower governance risk: Direct programmatic distribution of 93% of fees reduces concerns about corporate governance. In contrast, COIN and HOOD do not return any earnings to shareholders, and their capital allocation is determined by management. Higher Market Risk: $HYPE is a crypto-native asset and is subject to additional regulatory and technological uncertainties. Liquidity considerations: Token markets are generally less liquid than established stock markets. Get the Market Implied Price (MIP) Using our 13% discount rate, we can reverse engineer the market’s implied earnings expectations at the current $HYPE token price of approximately $54: Current market expectations: 2025: Total revenue of $700 million 2026: Total revenue of $1.4 billion Terminal growth: 3% annual growth thereafter These assumptions yield an intrinsic value of approximately $54, which is consistent with current market prices. This suggests that the market is pricing in modest growth based on current fee levels. At this point we need to ask a question: Does the market-implied price (MIP) reflect future cash flows? Alternative growth scenarios @Keisan_Crypto presents an attractive 2-year and 5-year bull market scenario. Original tweet link: Click here Two-year bull market forecast According to @Keisan_Crypto’s analysis, if HyperLiquid achieves the following goals: Annualized fees: $3.6 billion Aid fund income: $3.35 billion (93% of fees) Result: HYPE's intrinsic value is $128 (140% undervalued at current price) Related links Five-year bull market scenario Under a five-year bull market scenario (link), he predicts that transaction fees will reach $10 billion annually, with $9.3 billion accruing to $HYPE. He assumes HyperLiquid's global market share will grow from its current 5% to 50% by 2030. Even if it doesn't reach 50% market share, these figures are still achievable with a smaller market share as global trading volumes continue to grow. Five-year bull market forecast Annualized fees: $10 billion Aid fund income: $9.3 billion Result: HYPE's intrinsic value is $385 (600% undervalued at current price) Related links While this valuation is lower than Keisan's $1,000 target, the difference stems from our assumption of normalized earnings growth at 3% annually thereafter, while Keisan's model uses a cash flow multiple. We believe using cash flow multiples to project long-term value is problematic, as market multiples are volatile and can vary significantly over time. Furthermore, the multiples themselves incorporate earnings growth assumptions, while using the same cash flow multiple five years from now as one or two years later implies that growth levels from 2030 onward will be consistent with those in 2026/2027. Therefore, the multiples are more appropriate for short-term asset pricing. However, regardless of which model is used, $HYPE remains undervalued; this is a subtle difference. Additional Value Driver: USDH Under the Native Market model, USDH will use 50% of its stablecoin revenue for buybacks similar to a bailout fund. As a result, $HYPE can increase its free cash flow by $100 million (50% of $200 million) annually. Looking ahead five years, if USDH's market capitalization reaches $25 billion (currently still one-third of USDC's, and an even smaller portion of the total stablecoin market five years from now), its annual revenue could reach $1 billion. Following the same 50% distribution model, this would generate an additional $500 million in free cash flow per year for the aid fund. This would value each token at over $400. Excluding Value Drivers: HIP-3 and HyperEVM This DCF analysis intentionally excludes two important potential value drivers that are not amenable to cash flow modeling. Clearly, these would provide additional incremental value and could therefore be evaluated separately using different valuation methodologies and then added to this valuation. Summarize Our DCF analysis indicates that if HyperLiquid can maintain its growth trajectory and market position, the $HYPE token is significantly undervalued. The token's unique feature of programmatic fee distribution makes it particularly suitable for cash flow-based valuation methodologies. Methodological Notes This analysis builds on research by @Keisan_Crypto and @GLC_Research. The DCF model is open source and can be modified at the following link: https://valypto.xyz/project/hyperliquid/oNQraQIg Market data and forecasts are subject to change, and models should be updated promptly based on the latest information.
Share
PANews2025/09/19 08:00