Fufuture
Back to Research

Protocol composability: how one application connects to another

Let’s start with a button

When opening an on-chain application, what users usually see is to connect the wallet, enter the amount and confirm the operation. The interface is very simple, but the work behind it may be completed by multiple programs: one module reads the account, another module calculates the exchange result, and another module is responsible for receiving assets, updating balances and recording status. We can understand this collaboration as protocol composability: existing functions are connected through interfaces and become part of another application.

To understand this concept, you don't need to read all the code first. You can first ask a specific question: When I press this button, what objects are involved? By taking apart an action on the interface and distinguishing who makes the request, who executes the rules, and who records the results, you can gradually see the relationship between applications. This article uses hypothetical scenarios to illustrate the reading method and does not correspond to the actual operation process of a certain product.

During the reading process, you can also temporarily ignore the grand narrative in the product promotion and start with the smallest observable actions. First explain a query, then explain a state change, and finally discuss how multiple modules cooperate. This order reduces the burden of unfamiliar terms appearing at the same time and allows each new concept to be based on previously understood examples.

The ability of one application to use another application

Consider an application for managing assets. It wanted users to exchange asset A for asset B, but the team did not re-develop the exchange mechanism. Instead, it called the exchange function through the interface provided by the existing agreement. The user starts the operation from one page, but the actual exchange may be a contract of another agreement. This division of labor allows applications to focus on their own experience and allows mature basic capabilities to be reused.

Two relationships need to be distinguished here. Taking the user to another website is just a connection between the portals; the program directly calls another program, which involves execution-level combination. The two may look similar in interface, but they have different responsibilities. When reading the product introduction, you might as well break down "Integrated" into specific actions such as jumps, data reading, and transaction calls.

The interface is a common language, the rules still exist individually

Whether modules can be connected first depends on whether both parties understand each other's input and output. The interface stipulates what functions can be called, what parameters need to be provided, and what results will be returned. For example, reading a balance and requesting a transfer are different actions, and they cannot be confused even if they revolve around the same asset. The unified interface reduces communication costs, but does not automatically unify all product rules.

Assets that also use a certain token standard may still have different issuance arrangements and restrictions. The accessing party needs to confirm whether the actual behavior is consistent with its assumptions, and cannot end the check just after seeing a familiar name. Therefore, the interface can be used as the starting point for research, and the specific implementation, permission settings, and exception handling determine whether the connection is suitable for the current scenario.

Unpack the process along the asset's path

Continuing with the asset management example. You can write down three nodes on paper: user account, exchange module, and receiving account, and then record the asset type, quantity, and controlling party at each step in turn. Does the asset enter the intermediate contract first? Who is the receiving address after redemption? Does the page show expected results or already executed results? These questions are more helpful than simply remembering the product name.

If the process also includes depositing into another protocol, add another node instead of combining all actions into "complete investment". What you get after depositing may be a balance record or another kind of voucher. The specific meaning needs to be confirmed separately. The purpose of disassembly is to provide a corresponding explanation for each status change and avoid using one interface word to cover multiple different actions.

Separate data dependencies from execution dependencies

Connections between applications do not necessarily accompany asset movement. Some connections are only responsible for reading data, such as balances, prices, or a certain status; other connections change status, such as transferring assets or updating positions. By separating the two types of dependencies when reading, you can more quickly determine whether a change in an external module will affect the display, judgment conditions, or actual execution.

A page may use multiple data sources at the same time. The source of the displayed price is not necessarily consistent with the price used when the contract is executed; the page update speed is not equal to the speed of the state change on the chain. It is best to indicate in the research records where the data was generated, who updated it, and in which link it was used. If you encounter an unexplained part, you should leave it as an item to be verified instead of completing it yourself.

One confirmation does not mean only one action

When a user confirms a transaction, multiple contract calls may occur internally. In certain execution environments, multiple steps can be scheduled within the same transaction, but whether this is the case requires looking at the specific implementation. Just because there is only one button on the page, it cannot be assumed that all links have the same completion conditions, nor can cross-network and cross-service processes be understood as synchronous execution.

It is more practical for readers to distinguish between "request submitted" and "goal state formed". The interface prompts, transaction records and final balance each answer different questions. You should also consider a situation where the program may catch the failure of an internal step and then continue with other logic. Therefore, after seeing that the transaction was successful, you still need to verify what actually happened against the expected results.

Permissions are part of a composite relationship

Just because functions can be connected does not mean that any account can call them in any way. Certain entries may require authorization, and certain management actions may only be performed by specific roles. When studying a combined application, in addition to looking at the normal process, it is also necessary to record which subjects can adjust parameters, suspend functions, change dependent addresses, or upgrade implementations. These abilities will affect subsequent behavior.

Authorization on the user side should also be understood separately. Connecting a wallet, signing messages, and authorizing assets are different behaviors. For processes that require authorization, you should check the authorized objects, amounts and purposes, and understand how to revoke them later. The point here is not to treat all authorizations as exceptions, but to match permissions to actual needs and allow users to explain what they are agreeing to.

Combination brings convenience and increases dependency chain

Reusing existing functions can reduce the work of building from scratch, allowing the team to focus on new usage scenarios. For users, tasks that originally need to be completed across multiple pages may also be organized into a more continuous process. However, fewer entrances does not mean that there are fewer underlying relationships. Complexity is often simply contained by the interface.

Therefore, when evaluating a combined product, it is not advisable to just look at how many protocols are connected. What deserves more attention is: whether the connection is necessary, whether the dependencies are clear, whether the exception can be explained, and whether exit is still feasible. If an external link is temporarily unavailable, how affected will other functions be? Being able to answer these questions is a much closer approximation to actual operations than displaying a long list of collaboration logos.

Version and network determine which object you are studying

Under the same product name, there may be deployments on different networks, or multiple versions may be maintained at the same time. Simply recording the brand name is not enough when researching. It is best to put the network, version, contract address, document link and review date together, so that later people can know which object the conclusion refers to, and can re-check after changes.

When the documentation is inconsistent with the interface description, don't rush to believe one or the other. You can first confirm whether the two point to the same version, and then look for release records and on-chain records. For relationships that cannot be confirmed, clearly write down doubts and missing evidence. This recording method will make it easier to continue research and avoid transferring experience from old versions directly to new implementations.

Verify your understanding with a complete record

Choosing an example from the public record that has occurred that is relevant to the research question is often more effective than reading over and over again from a blurb. First record the originating address, target contract and time, and then observe asset changes and related events. Compare the records with the previously drawn process item by item to see if there are any unidentified intermediate links and whether the actual results are consistent with your own interpretation.

However, a single example can only illustrate the situation at that time and cannot prove that all inputs will produce the same results. Also read about constraints and exception paths. For example, after a change in quantity, liquidity, or authority, the process may branch into different branches. Research notes should clearly describe observed facts, explanations based on documents, and personal inferences.

It is more important to write down specific questions than to give general conclusions.

A common expression in research notes is "This protocol depends on another protocol." This sentence is in the right direction, but it doesn’t help readers understand the impact. It can be rewritten to be more specific: which function depends on each other, what information is read, which step is called, and what judgment the return value is used for. If the other party stops responding, will the current operation terminate, wait, or enter another path? The more specific the question, the more directed the follow-up investigation will be.

Likewise, "supporting an asset" also needs to be unpacked. Supporting the display of balances, supporting transfers, supporting exchanges and supporting as some kind of voucher are capabilities at different levels. An application may only accomplish part of this. When reading, first define the capabilities you are concerned about, and then check the corresponding evidence. This can avoid interpreting a name appearing in the interface as supporting all operations surrounding it.

You can also invite another reader to just look at the notes and try to retell the entire process. If the other party still doesn't know where the assets end up, or can't distinguish the responsibilities of the page and the contract, it means there are gaps in the record. This process does not require the pursuit of professional vocabulary quantity, but rather tests whether the expression can help others establish the same clear understanding.

The exit path deserves its own page

Many presentations detail how to enter a process, but less detail how to end it. For applications involving changes in asset status, paths for retrieving, repaying, deauthorizing, or redeeming vouchers can be organized separately. What conditions each step depends on, whether additional transactions are required, and whether there are other parties involved are all indispensable parts of understanding the product.

Here you can do a simple reverse reading: start from the final desired state, and gradually ask what needs to be done in the previous step. If a certain link can only rely on manual processing, or needs to wait for external status updates, it should be recorded truthfully. Putting normal entry and normal exit together can give you a complete understanding of the process, not just understanding the start button.

Create a research note that can be continuously updated

Finally, you can wrap up your research with a page of notes: what problems does the application solve, which capabilities come from itself and which come from outside; how assets and data flow; who has adjustment authority; where are the results verified; and what conditions are required for exit. Try to include records that can be reviewed for each conclusion, and mark unresolved issues so that the next update has a clear starting point.

The most worthwhile thing to understand about protocol composability is that new collaborative relationships can be formed between functions. To understand this relationship, you need to see both the convenience of the interface and the boundaries retained by each module. When we can break an application into explainable and verifiable links and then connect them, we have moved from watching the interface to understanding the operation behind the interface.