Midnight.js v4.0.2 release notes
For the complete documentation index, see llms.txt
- Version: v4.0.2
- Date: March 24, 2026
- Node.js requirement: >=22
High-level summary
This release stabilizes the v4.0.x line by preserving core v4 capabilities while reverting a transaction construction path that caused failures in shielded coin flows.
It also improves proving provider configuration, contract error typing, security hardening, and operational reliability across transaction handling.
Audience
This release note is most relevant for developers who:
- Upgraded to v4.0.1 and adopted the
addCalls-based call transaction flow. - Build contracts that use shielded coin operations.
- Run HTTP proof providers requiring authentication headers.
- Maintain custom error handling for Effect-based contract errors.
Summary of updates
- Added custom headers support in
httpClientProvingProvider - Added
isEffectContractErrortype guard for safe error narrowing - Reverted
createUnprovenLedgerCallTxinternals to restore shielded-call reliability - Fixed Merkle-tree rehash handling before contract-owned spend validation
- Improved compact error propagation for deploy flows
- Fixed fallible transaction error construction and reporting
New features
This release adds focused developer ergonomics for proving-provider configuration and safer error handling.
Headers support in httpClientProvingProvider
The HTTP client proving provider now supports custom headers for all requests to the proof server. This enables authentication tokens, API keys, or other custom headers to be forwarded with proof generation and verification requests.
Usage:
import { httpClientProvingProvider } from '@midnight-ntwrk/http-client-proof-provider';
const provider = httpClientProvingProvider(zkConfigProvider, proofServerUrl, {
timeout: 60_000,
headers: {
'Authorization': 'Bearer <token>',
'X-Custom-Header': 'value'
}
});
API interface:
export interface ProvingProviderConfig {
readonly timeout?: number;
readonly headers?: Record<string, string>; // NEW
}
Headers are merged with { 'Content-Type': 'application/octet-stream' } as the base, so custom headers take precedence over defaults.