Stdlib: Digital signature builtins (Ed25519) #251

Closed
opened 2026-01-12 02:39:35 +00:00 by navicore · 1 comment
navicore commented 2026-01-12 02:39:35 +00:00 (Migrated from github.com)

Summary

Add Ed25519 digital signature builtins for signing and verifying messages.

Proposed API

# Generate keypair
crypto.ed25519-keypair
# ( -- public-key private-key ) both as hex strings

# Sign a message
message private-key crypto.ed25519-sign
# ( String String -- String ) returns hex signature

# Verify signature
message signature public-key crypto.ed25519-verify
# ( String String String -- Bool )

Implementation

FFI wrapper around ed25519-dalek crate:

  • Widely used, audited implementation
  • Pure Rust, no system dependencies

Estimated effort: 2 days

Deliverables Checklist

  • Runtime builtins in crates/runtime/src/crypto.rs
  • Unit tests for each function
  • Integration tests in tests/integration/src/test-signatures.seq
  • LSP support: signatures in BUILTIN_SIGNATURES, docs in BUILTIN_DOCS
  • Example: examples/crypto/sign-verify.seq
  • Update docs/BATTERIES_INCLUDED.md status

Use Cases Unlocked

  • Message authentication
  • Software signing
  • Blockchain/crypto applications
  • License key verification
  • Secure audit logs

Priority

LOW - Advanced feature, most apps use HMAC instead.

Dependencies

Requires #246 (Hex encoding) for key/signature format.

References

## Summary Add Ed25519 digital signature builtins for signing and verifying messages. ## Proposed API ```seq # Generate keypair crypto.ed25519-keypair # ( -- public-key private-key ) both as hex strings # Sign a message message private-key crypto.ed25519-sign # ( String String -- String ) returns hex signature # Verify signature message signature public-key crypto.ed25519-verify # ( String String String -- Bool ) ``` ## Implementation FFI wrapper around `ed25519-dalek` crate: - Widely used, audited implementation - Pure Rust, no system dependencies Estimated effort: 2 days ## Deliverables Checklist - [ ] Runtime builtins in `crates/runtime/src/crypto.rs` - [ ] Unit tests for each function - [ ] Integration tests in `tests/integration/src/test-signatures.seq` - [ ] LSP support: signatures in `BUILTIN_SIGNATURES`, docs in `BUILTIN_DOCS` - [ ] Example: `examples/crypto/sign-verify.seq` - [ ] Update `docs/BATTERIES_INCLUDED.md` status ## Use Cases Unlocked - Message authentication - Software signing - Blockchain/crypto applications - License key verification - Secure audit logs ## Priority LOW - Advanced feature, most apps use HMAC instead. ## Dependencies Requires #246 (Hex encoding) for key/signature format. ## References - See `docs/BATTERIES_INCLUDED.md` Priority 4: Cryptography, Tier 3 - ed25519-dalek: https://github.com/dalek-cryptography/curve25519-dalek
navicore commented 2026-01-14 21:39:14 +00:00 (Migrated from github.com)
https://github.com/navicore/patch-seq/pull/261
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
navicore/patch-seq#251
No description provided.