kormir
A DLC oracle implementation for creating announcements and signing attestations.
Kormir supports both enumeration and numeric events, with optional Nostr protocol integration for publishing oracle data.
Usage
use ;
// Create oracle from extended private key
let oracle = from_xpriv?;
// Create an enumeration event
let announcement = oracle.create_enum_event.await?;
// Sign the outcome
let attestation = oracle.sign_enum_event.await?;
Numeric Events
// Create a numeric event (base 2)
let announcement = oracle.create_numeric_event.await?;
// Sign with numeric outcome
let attestation = oracle.sign_numeric_event.await?;
Storage Trait
Implement the Storage trait for your backend:
A MemoryStorage implementation is provided for testing.
Nostr Integration
With the nostr feature, publish announcements and attestations to Nostr:
use ;
// Get Nostr keys from oracle
let keys = oracle.nostr_keys;
// Create Nostr event for announcement (Kind 88)
let event = create_announcement_event?;
// Create Nostr event for attestation (Kind 89)
let event = create_attestation_event?;
Features
| Feature | Description |
|---|---|
nostr |
Nostr protocol integration for publishing oracle data |
Running a Kormir Server
See the kormir repository for the HTTP server implementation.
License
This project is licensed under the MIT License.