0xMiden / 0xMiden/docs

Example and Tutorial for end to end signature flow - for intent based applications.

オープン
#314 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
10
フォーク
50
平均マージ
22日 23時間
マージ済み PR(30日)
1

説明

### Feature description

A complete, canonical example of the signature flow.

The goal of this tutorial should be to provide a complete, executable example that can be followed by a third-party developer from start to finish.

## Scope

- Message construction.
- Message serialization.
- Message hashing.
- Signature generation:
- in the frontend / wallet.
- in rust client
- Signature transport and submission.
- Signature verification
- in rust client
- inside the vm.
- Handling invalid signatures.
- Using successful verification to authorize an action.

## Requirements
### Canonical Message Format

Provide a simple but realistic message structure that can be used throughout the tutorial.

The purpose is not to define a standard intent format, but to establish a reproducible example for demonstrating signing and verification.

The exact fields are less important than ensuring the entire flow is deterministic and reproducible.

### Canonical Serialization Format

Explicitly define:

- field ordering
- encoding format
- integer representation
- byte ordering
- array handling
- serialization boundaries

### Message Hashing

Demonstrate:

- how the message is transformed into a signing payload
- which hash function is used
- how the digest is represented
- how the digest is passed into signing and verification logic

The exact intermediate values should be shown.

### Frontend Signing Example

Provide a complete frontend example showing:

- message construction
- serialization
- hashing
- signature generation
- extraction of the public key
- resulting signature output

The example should be executable with minimal modification.

## Contract Verification Example

Provide a complete MASM example showing:

- receiving a message or digest
- receiving a signature
- receiving a public key
- performing signature verification
- handling success and failure cases
- execute a simple action based on message content

The example should compile and execute without modification.

End-to-End Integration Test

Provide a runnable integration example demonstrating:

- Construct message.
- Serialize message.
- Hash message.
- Sign message.
- Submit signature and payload.
- Verify signature inside a contract.
- Execute an authorized action.

The entire flow should be executable by a third-party developer without requiring protocol-level knowledge.

Security Considerations

The tutorial should explain:

- what exactly is being signed
- replay risks
- message uniqueness requirements
- recommended signing patterns
- common implementation mistakes

The tutorial should serve as the canonical reference for signature-based authorization on Miden.

### Why is this feature needed?

Currently, there is no end-to-end reference showing such a flow would be implemented in a realistic application.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The issue describes creating a comprehensive tutorial. Start by examining existing documentation in the repository for signature flows and examples. Look for any existing frontend examples (likely TypeScript/JavaScript) and contract examples (likely Rust/MASM). The tutorial must cover message construction, serialization, hashing, signing in frontend/wallet and Rust, verification in Rust and VM, and integration. 'Done' means producing a complete, runnable end-to-end example with all intermediate values shown and security considerations explained.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust, typescript
領域
blockchain, documentation
issue の種類
ドキュメント
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。