Skip to content

Align CLI, API, and schema with anchor_ref field#44

Merged
steven-tomlinson merged 1 commit into
core-implementationfrom
codex/review-refactor-plan-checklist
Oct 11, 2025
Merged

Align CLI, API, and schema with anchor_ref field#44
steven-tomlinson merged 1 commit into
core-implementationfrom
codex/review-refactor-plan-checklist

Conversation

@steven-tomlinson

Copy link
Copy Markdown
Contributor

Summary

  • replace legacy tx_hash usage with the new anchor_ref field across core models, validators, signing/verifier flows, and specs
  • add schema-aligned CLI create/validate commands plus refreshed documentation and project wiring
  • expose Codex API endpoints for create/validate/template responses with canonical hashes and update supporting docs/examples

Testing

  • dotnet test (fails: dotnet SDK not available in execution environment)

https://chatgpt.com/codex/tasks/task_e_68e9dbf10558832d99a2d78590bdd9e8

@steven-tomlinson steven-tomlinson merged commit d40b879 into core-implementation Oct 11, 2025
0 of 2 checks passed
@steven-tomlinson steven-tomlinson deleted the codex/review-refactor-plan-checklist branch October 11, 2025 04:52

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines 264 to +275
errors.Add(new("core.anchor.network_mismatch", $"anchor.chain '{anchor.Chain}' does not match configured network '{context!.Network}'", "anchor.chain"));
}

if (anchor.Chain.StartsWith("stellar:", StringComparison.OrdinalIgnoreCase) && !anchor.HashAlgorithm.Equals("sha-256", StringComparison.OrdinalIgnoreCase))
if (anchor.Chain.StartsWith("stellar:", StringComparison.OrdinalIgnoreCase) && !StellarHashPattern.IsMatch(anchor.Reference))
{
errors.Add(new("core.anchor.invalid_hash_algorithm", "Stellar anchors must use SHA-256", "anchor.hash_alg"));
errors.Add(new("core.anchor.invalid_anchor_ref", "stellar anchors must supply a 64-character hexadecimal anchor_ref", "anchor.anchor_ref"));
}
}

if (string.IsNullOrWhiteSpace(anchor.TransactionHash) || !HexPattern.IsMatch(anchor.TransactionHash))
if (string.IsNullOrWhiteSpace(anchor.Reference))
{
errors.Add(new("core.anchor.invalid_tx_hash", "anchor.tx_hash must be a hexadecimal transaction hash", "anchor.tx_hash"));
errors.Add(new("core.anchor.missing_anchor_ref", "anchor.anchor_ref is required", "anchor.anchor_ref"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Continue validating blockchain anchor_ref as hexadecimal

The anchor validator no longer enforces any format on anchor_ref for CAIP‑2 blockchain anchors. The previous implementation required anchor.tx_hash to match a hexadecimal pattern, but after the rename to anchor_ref the check was narrowed to Stellar only and other chains are allowed to pass with arbitrary strings. Entries anchored to Ethereum or other blockchains can now be marked valid even though the reference is not a transaction hash, which will later cause verification/lookups to fail. Consider keeping the hex validation for all CAIP‑2 chains while still permitting free‑form identifiers for the new non‑blockchain anchor types.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant