Skip to content

HIP-23: Istanbul DeFi Application Patterns v1.1 (spec, tests, audit package)#8

Closed
Moskyera wants to merge 13 commits into
hacash:mainfrom
Moskyera:hip-23-draft
Closed

HIP-23: Istanbul DeFi Application Patterns v1.1 (spec, tests, audit package)#8
Moskyera wants to merge 13 commits into
hacash:mainfrom
Moskyera:hip-23-draft

Conversation

@Moskyera

@Moskyera Moskyera commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Proposes HIP-23 a post-Istanbul application / integration standard for reusable DeFi composition patterns on Hacash.

No consensus fork. No new action kinds, fork heights, or protocol rule changes. This PR adds normative documentation, JSON templates, an audit package, integration tests, and CI all against existing Istanbul machinery (Type3, TexCellAct, guards, AST, AssetCreate).

Status: v1.1 Ready
Activation context: Istanbul @ mainnet height 765432 (ONLINE_OPEN_HEIGHT)

Patterns (P1–P5)

| ID | Pattern |

| P1 | Atomic multi-asset TEX swap |
| P2 | Time-boxed guarded payment (HeightScope) |
| P3 | BalanceFloor protected transfer |
| P4 | HIP20 issuance + TEX distribution (two-tx) |
| P5 | AST conditional settlement |

What's included

Specification

  • doc/HIP23.md normative MUST/SHOULD rules
  • doc/HIP23_templates.md copy-paste-safe JSON templates

Audit / integrator package

  • doc/HIP23_threat_model.md, HIP23_invariants.md, HIP23_requirements_traceability.md (26/26 MUST traced)
  • doc/HIP23_wallet_checklist.md, HIP23_indexer_dictionary.md
  • doc/HIP23_audit_scope.md, HIP23_audit_findings.md, HIP23_external_audit_brief.md
  • SECURITY.md

Tests & tooling

  • Regression, adversarial, stress, production-path, audit-strict, chain integration, TEX wire replay, guard error codes
  • Cross-implementation vectors: tests/fixtures/hip23_test_vectors.json
  • Stable error classifier: tests/common/hip23_errors.rs
  • Property tests (proptest, 9 properties × 64 cases)
  • Optional fuzz target: fuzz/fuzz_targets/tex_cell_act_parse.rs
  • CI: .github/workflows/hip23.yml

Test gate

cargo test hip23_ -- --nocapture
cargo test --workspace

87 named tests + 9 proptest properties. CI green on fork.

Explicitly out of scope

  • Consensus / fork changes
  • HIP-25 (separate work)
  • HVM companion contracts (future v2)

Reviewer notes

  • Most tests use fast_sync=true for pattern semantics; hip23_production_path and hip23_audit_strict use fast_sync=false for signature / duplicate-tx checks.
  • TEX signatures are replayable by design wallets MUST pin the full composed Type3 tx (documented in threat model + wallet checklist).
  • P4 protocol_cost MUST equal genesis::block_reward(height) at inclusion height (not a fixed literal).

Commits

10 commits on hip-23-draft (spec → adversarial/stress → audit package → production-path/proptest → accepted-limitations closure).

Happy to split into doc-only + tests/CI if maintainers prefer smaller review chunks.

@jojoin

jojoin commented Jun 23, 2026

Copy link
Copy Markdown
Member

We do not recommend placing too many scattered documents and tests directly into the main development code repository. Documentation should be stored in the github.com/hacash/doc repository, with each document focusing on a single goal or topic. Integration tests should be kept in a separate project repository, while the dev repository should only contain necessary unit tests, avoiding comprehensive functional testing. Documents can be split into individual topic-based files and then submitted to the doc repository.

@jojoin

jojoin commented Jun 23, 2026

Copy link
Copy Markdown
Member

Once the content stabilizes, the existing dev/doc documentation will also be moved into the hacash/doc repository.

@Moskyera

Copy link
Copy Markdown
Author

Closing: content relocated to hacash/doc and hip23-integration per maintainer feedback.

@Moskyera

Moskyera commented Jun 24, 2026

Copy link
Copy Markdown
Author

Thanks @jojoin restructuring per your guidance.

Documentation hacash/doc#5 (\HIP/protocol/hip-23/, one topic per file)

Integration tests Moskyera/hip23-integration (87 tests + proptest, separate from fullnodedev)

This PR is closed; HIP-23 content has been removed from \hip-23-draft\ on fullnodedev. No consensus or dev-repo changes needed.

@Moskyera Moskyera closed this Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants