A cryptographic signature can be completely valid, but the spending authorization may be designed incorrectly. There is no contradiction here. Verifying a signature establishes the association of a key with a specific message; it does not infer all the intentions of the author of the wallet. If a program asked you to sign one thing and then allowed you to freely change another, the strength of the cryptography would not create the missing constraint. For Chia, this is especially clear when comparing the AGG_SIG_ME message with the conditions that the puzzle returns for the coin being spent.
Let us formulate the required invariant. If the signer has approved a specific destination and amount of XCH, a valid spend should not allow replacing these conditions while maintaining the previous approval. The invariant concerns the coin program and its signed message together. It is not enough to write the name of a good signature mechanism in code. You need to determine how the selected conditions affect the message or other required checks. The reasoning below is educational: the editorial team did not create spendable coins, did not sign real transactions and did not send funds.
The Chia coin has a puzzle hash. When spent, the corresponding program is revealed, puzzle reveal, and a solution is provided. The program calculates conditions, which the system then checks. Chia’s official coin set model security documentation highlights the difference: the puzzle is anchored by its hash, but the solution values cannot be considered trustworthy merely because they were supplied. If they control payouts, explicit permission binding is required. The fact that the wallet interface once showed the desired recipient does not in itself limit the subsequent execution of the program by other participants.
A verified message and unconstrained conditions
Let’s look at the first fragment as pseudo-code for the reasoning. This is not a ready-made Chialisp contract and not instructions for deploying funds. The public key and fixed message are fixed in advance by the program, and the list of conditions comes through the solution:
conditions = solution
return [AGG_SIG_ME(public_key, fixed_message)] + conditions
In such a design, changing conditions is not required to change fixed_message. Let’s imagine two lists with the same acceptable output amount: one creates a coin using the agreed puzzle hash of the recipient, the other creates a coin based on a different puzzle hash. If the remaining spending requirements are met, the signature check is presented with the same key and the same message for the same input coin. The signature itself does not know which list the user saw. The strength of the algorithm tests a given relationship, and the specified relationship here does not include variable output conditions. This is a logical flaw in the authorization model, not a statement of a defect in Chia.
AGG_SIG_ME adds important context automatically, but not the one the example is missing. According to the Chia conditions reference, the provided message is appended with the identifier of the coin being spent and the network domain string. In the verified form, the condition has code 50 and accepts a public key and a byte message. An identifier associates a permission with a specific object. However, both alternatives in our example attempt to spend exactly the same object, so the automatic binding does not distinguish between their conditions.
This is a short proof of insufficiency. The coin, network, key and fixed_message remain unchanged. Only the list changes, on which the signed message does not depend. Then the data required to verify the signature remain unchanged. To state that substitution is not possible would require another mandatory condition prohibiting the second list, or the association of the list with the message being signed. The first educational structure did not specify either one or the other. You don’t have to assume key forgery, hash cracking, or unusual consensus moves to see a missing dependency.
The corrected principle can be expressed in a second pseudocode:
conditions = solution
message = tree_hash(conditions)
return [AGG_SIG_ME(public_key, message)] + conditions
Now changing the structure of the conditions changes the message under the usual assumption of the strength of the hashing used. The signer approves exactly the hash of the agreed upon structure. The order of definition is important: here the original list of output conditions is hashed, and the signature requirement is added separately. One cannot quietly insert into a calculation a message that is itself determined by that calculation and call the resulting cyclic construction the same example. The tutorial snippet specifies a specific data dependency rather than simply asking you to add the word hash next to the signature name.
This approach is illustrated by Chia’s official course on signatures. Its example signs the tree hash of the selected conditions. It is important not to extend this particular method to the false general statement that AGG_SIG_ME always independently calculates the hash of all outputs. The puzzle selects the message. It can be a hash of conditions, a hash of a delegated program, or other bytes according to design. That is why the conditions reference and a specific code are needed at the same time: the first explains the mechanism, the second establishes which authorization the mechanism checks for this spend.

Coin and network are bound into the authorization for different reasons
The coin identifier distinguishes between objects with the same amounts and similar conditions. If a signature is tied to one coin ID, it cannot simply be used as permission for another coin ID with the same message. This is protection against transfer between objects. It does not replace the previous proof of destination binding: changes to the output within a single coin spend attempt leave the input coin ID the same. Both properties are needed for different possible replacements. Reducing them to the general word “protected” hides what kind of substitution is actually excluded by this mechanism.
The domain string separates network contexts. Identical user bytes should not automatically become a portable permission where a different signature domain is in effect. In the official explanation, Chia AGG_SIG_ME is associated with the genesis context of the network. The implementation must use actual network constants rather than a random "mainnet" string from the interface. The domain is not a decorative comment on the signature: it is included in the bytes against which the cryptographic connection is verified. Mixing the display name and the protocol-defined string gives a different subject to check.
Mention of the network does not turn the signature into evidence of inclusion. It is possible to prepare a valid authorization, but not get the specific spend bundle included in the chain. An already spent coin, a failed timing condition, or other error renders the spend invalid regardless of whether one component of the signature is correct. The system checks a set of requirements. For the user interface, this difference is significant: the result “signature verified” refers to an authorization, while “payment confirmed” requires evidence of a completed valid spend in the corresponding chain.
AGG_SIG_UNSAFE has a different contract and does not add the same automatic binding to the coin. Conditions reference source describes message restrictions and differences in options. Therefore, replacing one name with another without revising the design is not a neutral refactoring. There are applications with intentionally portable signatures, but they require their own justification for context, timing, and reuse. It does not follow from the existence of such a tool that it is suitable for ordinary spend authorization just because the test once returned success.
This argument does not require every newer signature-condition variant. Some variants bind authorization to individual coin components rather than the full identifier, and use separate domains. Their presence in the current reference does not establish identical purposes or interchangeability. This article concerns XCH and AGG_SIG_ME; it announces no new activation. Sources were checked on October 30, 2026. Selecting a condition depends on the intended scope of permitted reuse, rather than on putting the shortest name in the code.
What does a standard delegated program sign?
In the source of the standard puzzle Chia a different organization is visible: in the usual delegated branch, AGG_SIG_ME receives a the tree hash of the delegated puzzle. This is not a literal copy of the second tutorial fragment. A program is signed that produces the required conditions. This way of binding authorization is useful if the signed program actually limits results relevant to authorization. Reading a specific branch allows you to distinguish this mechanism from the erroneous assumption of signing an arbitrary external JSON representation of the entire transaction.
However, signing a delegated puzzle does not automatically sign all possible solutions for it. If a program accepts a free parameter that can change the payoff without further verification, one unchanged program does not by itself establish a fixed destination. It is necessary to investigate which solution values affect the output and how they are limited. A program that returns fixed in advance conditions has one proof; for more complex logic it is different. Cryptographic binding to code is the basis for analyzing its behavior, and not an exemption from such analysis.
Structure and text must also be distinguished. Tree hash refers to the program or condition tree according to the function used. Spaces in a human-readable record are not the same as nodes and atoms in an executable representation. If the interface hashes a nice text string, and the puzzle checks a hash of a different structure, the parties sign and verify different messages. A good system displays clear meaning to the user while maintaining an accurate connection to the canonical data that actually participates in the spend. The coincidence of the visible title on two screens does not prove this property.
Signature aggregation solves the problem of compact joint verification, but does not itself create new dependencies between arbitrary spends. It is important which pairs of keys and messages are required by each program and what conditions bind the parts of the operation. If the author expects the obligatory joint presence of several actions, this expectation must be expressed by a construction. One aggregated signature field in a container does not automatically sign every byte of the container with any future interpretation. The composition of the messages being verified remains the basis of authorization even when the cryptographic result is aggregated into a single object.
A practical review therefore establishes the dependency. If the recipient changes, which signed value or mandatory check must change? If the amount changes, what prevents the previous authorization from remaining sufficient? If the input coin or network changes, where does automatic binding apply? Each question tests the stated invariant. The answer may lie in a signed hash, fixed code or a verified linking condition. If the only answer is confidence that nobody will change the solution, the invariant has not yet been enforced.
In both educational fragments, the public key was considered to be bound in advance. This is an essential prerequisite. If an unverified solution can also replace the key, verification can confirm the signature of the person who chose this key, instead of the authority of the expected owner. Currying the required parameter in the puzzle or another proven constraint associates the allowed key with the coin. A correct signature under an incorrect key does not solve the authorization problem, even if the message includes all the necessary conditions. Therefore, the review considers both the origin of the key and the origin of the message, maintaining both connections to the rules of the coin.
Finally, public verifiability of a spend is different from disclosing a private key. A correct signature scheme allows you to display the signature and verify the message without publishing the private key. But it does not promise to hide the meaning of the published conditions and program themselves. Once revealed, spends provide observers with the information required by the protocol. There are no real keys or signed operational messages in this article: pseudocode is needed to check data dependency. The explanation of authorization does not imply a promise of confidentiality of all details of the payment or anonymity of its participants.
For Chia, permission arises from a coordinated system: the coin’s program defines the restrictions, the message expresses what was approved, the signature confirms the required connection, and consensus verifies the remaining conditions of allowable spending. Each element does its own job. The cryptographic strength of the signature preserves exactly the message that was given to it; it does not add unexpressed intentions. Therefore, the proof of authorization ends with the specific dependence of the conditions on the approval. The more precise this dependency, the less the human interface has to promise beyond what the program will actually check.



