API Specification
Legacy API
RISE supports a fully backwards-compatible Legacy API endpoint. Simply call the RPC as usually and shreds will be completely ignored.
Shred API
The Shred API is simply a slight modification and extension of the Ethereum JSON-RPC API 2.0. It has been designed in a non-intrusive manner so existing clients will benefit from faster transaction confirmations without needing a complete shred integration.
API Extension Summary
RPC Method | Type | Description |
---|---|---|
eth_sendRawTransactionSync | HTTP | Sends a signed transaction and waits for instant confirmation, returning the complete transaction receipt. |
eth_subscribe with "shred" | WSS | Subscribe to new shreds in real-time for instant transaction visibility. |
eth_subscribe with "logs" | WSS | Subscribe to contract event logs with shred-speed delivery. Events are delivered from shreds instead of blocks for faster event processing. |
Core Methods
eth_sendRawTransactionSync
Sends a signed transaction and waits for instant confirmation, returning the complete transaction receipt.
Key Benefits:- Instant confirmation: No waiting for block inclusion
- Complete receipt: All transaction details immediately available
- Synchronous flow: Simplifies application logic
- Error handling: Failed transactions return immediately with status
0x0
WebSocket Subscriptions
shred Subscription
Subscribe to new shreds in real-time for instant transaction visibility. Each shred contains:
- Block timestamp and number
- Shred index within the block
- Complete transaction data with receipts
- State changes caused by transactions
logs Subscription (Enhanced)
Subscribe to contract event logs with shred-speed delivery. On RISE Chain:
- Events delivered immediately when transactions are processed in shreds
- No waiting for block confirmation
- Standard Ethereum log format maintained for compatibility
- Filters work exactly like standard Ethereum
Performance Characteristics
RTT (Round-Trip Time) Targets
- Shred Confirmation: 3-5ms (p50), 10ms (p99)
- Event Delivery: < 10ms from transaction execution
- State Updates: Immediate upon shred confirmation
Throughput
- Transactions per Shred: 1-100
- Shreds per Second: 1000+
- Total TPS: 10,000+
Usage Patterns
Synchronous Transaction Flow
import { sendTransactionSync } from 'shreds/viem'
// RISE synchronous pattern
const receipt = await sendTransactionSync(client, tx)
// Transaction already confirmed with receipt!
Real-Time Event Monitoring
import { watchShreds } from 'shreds/viem'
// Monitor all shreds
const unwatch = watchShreds(client, {
onShred: (shred) => {
console.log(`Shred ${shred.shredIndex} confirmed`)
}
})
// Monitor specific contract events
client.watchContractEvent({
address: contractAddress,
abi: contractAbi,
onLogs: (logs) => {
// Process events in real-time
}
})
Best Practices
-
Use Synchronous Methods for Critical Operations
// Preferred for payments and time-sensitive operations const receipt = await sendTransactionSync(client, tx)
-
Subscribe to Events for Real-Time Updates
// More efficient than polling client.watchContractEvent({ ... })
-
Handle Errors Immediately
// No need to wait for confirmation if (receipt.status === '0x0') { // Handle failure }
Standards Compliance
RISE Chain implements and extends Ethereum standards:
- EIP-7966 - Synchronous Transaction Confirmation (
eth_sendRawTransactionSync
) - Full Ethereum JSON-RPC 2.0 compatibility
- WebSocket subscription enhancements for real-time data
References
- API Methods - Complete method documentation
- Interactive API Documentation - Full API reference
- Examples - Practical usage patterns
- shreds npm module - TypeScript integration