Repository navigation
Releases: sig-net/midnight-integration
Release list
v0.25.0
Highlights
- An attestation verifies from the event alone. The MPC signs a digest over the output's length and hash, and
RespondBidirectionalEventV1carriesoutputHashafterserializedOutputLength, so a node or a client checks a post without the output (sig-net/mpc#1423, Section 7.4.2) (#138). executionDestis 64 bytes, wide enough for any CAIP-2 id, Solana's included (sig-net/mpc#1442) (#138).- Stagenet has a new Signet singleton for the 0.25 wire format.
@sig-net/midnightpublishesd2a2419b5f296dae40c5681840b660f5ebab6cbd21c107e05e0464045b589517for stagenet, in place of5ecbb10ce05c9e55d1990048aec4c0a5669036fb1c1f5922b900880047d8e2bf, the 0.24 singleton (#141).
Changes
Signet.compact:calculateAttestedOutputHashV1<N>hashes the output under the newHashDomain.attestedOutput(6).verifyRespondBidirectionalAttestationV1checks an event's signature without the output,verifyAttestedOutputV1<N>checks an output against an attested length and hash, andverifyRespondBidirectionalEventV1does both (#138).@sig-net/midnightexports the TypeScript twinscalculateAttestedOutputHash,verifyRespondBidirectionalAttestation,verifyAttestedOutputandverifyRespondBidirectionalEvent(#138).SignetRequestResponseReaderchecks each post's signature and hashes the output once, against the post it picks (#138).
Breaking changes
- Wire format. Request ids, the attestation digest and the event layout change, so nothing written under 0.24 is readable under 0.25. Recompile every requester contract against this release's
Signet.compact, redeploy it, and point it at the new singleton (#138, #141). Signet.compact.calculateSignetAttestationDigestV1is no longer generic: it takes the request id, height, kind, output length and output hash.executionDest,EXECUTION_DEST_BYTESandethereumCaip2Id()move from 32 to 64 bytes (#138).- Renamed in
@sig-net/midnight.verifyRespondBidirectionalSignatureisverifyRespondBidirectionalEvent, after its Compact circuit (#138). - Responder. Run the fakenet
0.35.0, built on these packages:0.34.0speaks the 0.24 wire format.
Matched set
All four @sig-net/* packages ship at 0.25.0: midnight, midnight-contract, midnight-contract-deploy and midnight-serde, alongside the signet-midnight-serde crate at 0.25.0. The fakenet moves from 0.34.0 to 0.35.0. The rest of the stack is unchanged from 0.24.1: Compact compiler 0.33.0-rc.2 (--feature-zkir-v3), node 2.0.0-rc.4, indexer 4.4.0-pre-alpha.16, proof server 9.0.0-rc.5_experimental, @midnightntwrk/ledger-v9 1.0.0-rc.3.
Full Changelog: v0.24.1...v0.25.0
v0.25.0-rc.3
⚠️ Warning: the Sig Network MPC is not yet monitoring or responding to requests made with this version of the protocol. Develop locally against the fakenet0.35.0.
Highlights
- Stagenet has a new Signet singleton for the 0.25 wire format.
@sig-net/midnightpublishesd2a2419b5f296dae40c5681840b660f5ebab6cbd21c107e05e0464045b589517for stagenet, in place of5ecbb10ce05c9e55d1990048aec4c0a5669036fb1c1f5922b900880047d8e2bf, the 0.24 singleton (#141).
Changes
- None beyond the address: no circuit, type, export or dependency changes since 0.25.0-rc.2. See the 0.25.0-rc.2 notes for the protocol changes since 0.24.
Breaking changes
- Stagenet. Requester contracts on stagenet redeploy against the new singleton address.
Matched set
All four @sig-net/* packages ship at 0.25.0-rc.3: midnight, midnight-contract, midnight-contract-deploy and midnight-serde, alongside the signet-midnight-serde crate at 0.25.0-rc.3. The rest of the stack is unchanged from 0.25.0-rc.2, fakenet 0.35.0 included.
Full Changelog: v0.25.0-rc.2...v0.25.0-rc.3
v0.25.0-rc.2
⚠️ Warning: the Sig Network MPC is not yet monitoring or responding to requests made with this version of the protocol, and no Signet singleton is deployed for it yet: the stagenet address@sig-net/midnightpublishes is still the 0.24 singleton. Develop locally against the fakenet0.35.0.
Highlights
- An attestation verifies from the event alone. The MPC signs a digest over the output's length and hash, and
RespondBidirectionalEventV1carriesoutputHashafterserializedOutputLength, so a node or a client checks a post without the output (sig-net/mpc#1423, Section 7.4.2) (#138). executionDestis 64 bytes, wide enough for any CAIP-2 id, Solana's included (sig-net/mpc#1442) (#138).
Changes
Signet.compact:calculateAttestedOutputHashV1<N>hashes the output under the newHashDomain.attestedOutput(6).verifyRespondBidirectionalAttestationV1checks an event's signature without the output,verifyAttestedOutputV1<N>checks an output against an attested length and hash, andverifyRespondBidirectionalEventV1does both (#138).@sig-net/midnightexports the TypeScript twinscalculateAttestedOutputHash,verifyRespondBidirectionalAttestation,verifyAttestedOutputandverifyRespondBidirectionalEvent(#138).SignetRequestResponseReaderchecks each post's signature and hashes the output once, against the post it picks (#138).
Breaking changes
- Wire format. Request ids, the attestation digest and the event layout change, so nothing written under 0.24 is readable under 0.25. Recompile every requester contract against this release's
Signet.compactand redeploy it (#138). Signet.compact.calculateSignetAttestationDigestV1is no longer generic: it takes the request id, height, kind, output length and output hash.executionDest,EXECUTION_DEST_BYTESandethereumCaip2Id()move from 32 to 64 bytes (#138).- Renamed in
@sig-net/midnight.verifyRespondBidirectionalSignatureisverifyRespondBidirectionalEvent, after its Compact circuit (#138). - Responder. Run the fakenet
0.35.0, built on these packages:0.34.0speaks the 0.24 wire format.
Matched set
All four @sig-net/* packages ship at 0.25.0-rc.2: midnight, midnight-contract, midnight-contract-deploy and midnight-serde, alongside the signet-midnight-serde crate at 0.25.0-rc.2. The fakenet moves from 0.34.0 to 0.35.0. The rest of the stack is unchanged from 0.24.1.
Full Changelog: v0.24.1...v0.25.0-rc.2
v0.24.1
⚠️ Warning: the Sig Network MPC is not yet monitoring or responding to requests made with this version of the protocol on Midnight Stagenet. Develop locally or use use v0.23.0.
Highlights
- A documentation release. No circuit, type, export or dependency changes since 0.24.0: the READMEs, the protocol diagram and the shipped comments and JSDoc are brought in line with the serialisation changes of 0.24.0 and the design doc's vocabulary (#133).
Breaking changes
- None.
Matched set
All four @sig-net/* packages ship at 0.24.1: midnight, midnight-contract, midnight-contract-deploy and midnight-serde, alongside the signet-midnight-serde crate at 0.24.1. The rest of the stack is unchanged from 0.24.0.
Full Changelog: v0.24.0...v0.24.1
v0.24.0
⚠️ Warning: the Sig Network MPC is not yet monitoring or responding to requests made with this version of the protocol.
Highlights
- The protocol follows the MPC bidirectional spec. Wire and hash-domain artefacts carry a
V1suffix,SignBidirectionalEventV1takes the spec's field order, and the request id hashesRequestIdPreimageV1, whosetxParamsDigestcovers only the entries a transaction uses. One transaction has one request id, whatever capacities and padding the requester's struct carries (#127). - Every attestation names its request, its destination block and its outcome.
RespondBidirectionalEventV1carries the request id, block height, output kind and output width, and the MPC signs them into the attestation digest. A failure is attested over an empty output asfailedorunviable, in place of the 5-bytedeadbeefpayload (#126, #127). - One schema per request, serialised with Borsh. The MPC derives the response layout from the ABI output schema, so
respondSerializationSchemais reserved. The supported output types arebool,uint256,addressandbytes1tobytes32, and the MPC drops a request that names any other (#58). - The SDK owns the MPC's output rules.
isEvmContractCall,evmTraceOutputFromCallFrameandexecutedEvmRespondOutputrebuild the exact bytes the MPC attests from adebug_traceTransactioncall frame, including a plain ETH transfer and a call that returns nothing (#129). - Stagenet has a new Signet singleton.
@sig-net/midnightpublishes5ecbb10ce05c9e55d1990048aec4c0a5669036fb1c1f5922b900880047d8e2bffor stagenet, in place of1df4ce25fc9f9c03dc6f4d0eb12ddf3d0db094995d4c70aca1142eebb3b77a5d(#130).
Changes
- The request nonce is gone. Two identical requests are the same request, and a second one is refused while the first is outstanding. The signed block height lets a contract refuse an attestation from a block at or below the one it knew when it made the request, which closes the replay of an old attestation onto a re-issued request (#126).
@sig-net/midnightexports theOutputKindandHashDomainenums of the compiled protocol module, and the TypeScript twinscalculateEvmType2TxParamsDigestandRequestIdPreimage(#127).@sig-net/midnightexports the schema helpersderiveRespondSchema,respondOutputWidth,canonicalSchemaTextandunsupportedEvmOutputFields(#58).- A
uint256output is attested whole as 32 little-endian bytes and narrowed in-circuit with the newcheckedTruncationU128, which aborts unless the high 16 bytes are zero. An empty schema attests an empty output underexecuted(#58). @sig-net/midnight-serdeis a thin wrapper over native Borsh:compactSerialize,compactDeserializeandBorshValue. Its Rust twin, thesignet-midnight-serdecrate, joins it, and both are pinned to one shared conformance corpus (#58).deploySignetContractin@sig-net/midnight-contract-deployopens with a table of every environment variable it reads (the seed excluded), each with its effective value and whether the environment or a built-in default supplied it. The package exportsdeployEnvironmentTable,MIDNIGHT_NODE_CONFIG_ENV_VARSandFAUCET_URL_ENV_VAR(#130).- The README states that the MPC reads notifications only from transactions Midnight applied in full (
TxApplied), so a request made in a partially successful transaction is never signed (#130). - In the repository: the workspace and its private scope are renamed from
midnight-protocoltomidnight-integration,yarn compile:zkruns the full compile before generating keys, and the deploy scripts load the repo-root.envwhen it exists (#130). The local anvil mines every second, so the fakenet sees blocks finalise on a quiet chain (#129).
Dependencies
@sig-net/midnight-serdedepends onborsh2.0.0, and thesignet-midnight-serdecrate pinsborsh1.8.1 (#58).
Breaking changes
- Wire format. The request record, the request id and the attestation digest all change, so nothing written under 0.23.0 is readable under 0.24.0. Recompile every requester contract against this release's
Signet.compact, redeploy it, and point it at the new singleton (#126, #127). - Renamed in
Signet.compact.SignBidirectionalEvent,RespondBidirectionalEvent,SignatureRespondedEvent,calculateRequestId,calculateSignetAttestationDigest,constructSignBidirectionalEventandverifyRespondBidirectionalEventeach gain theV1suffix. The record'scaip2Idfield isexecutionDest, andCAIP2_ID_BYTESisEXECUTION_DEST_BYTES(#127). - Failure handling.
MPC_FAILURE_OUTPUTandisMpcFailureOutputare removed. Route settlement on the event'sOutputKind(executed,failedorunviable), never on the output bytes (#127). - Response schema.
respondSerializationSchemais reserved:constructSignBidirectionalEventV1pins it toBytes<0>, and a request built by hand must do the same.MAX_RESPOND_PACKED_BYTES, theAbi*schema types andevmType2TxParamsDescriptorOfare removed (#58, #127). - Serde. The Compact type descriptors of
@sig-net/midnight-serde(CompactTypeand its family,compactSerializedSize,packedSize) are removed in favour of native Borsh schemas (#58). - Responder. The 0.23.0 stack's fakenet
0.25.0cannot decode the reordered request record: run0.34.0.
Matched set
All four @sig-net/* packages ship at 0.24.0: midnight, midnight-contract, midnight-contract-deploy and midnight-serde, alongside the signet-midnight-serde crate at 0.24.0. The fakenet moves from 0.25.0 to 0.34.0. The rest of the stack is unchanged from 0.23.0: Compact compiler 0.33.0-rc.2 (--feature-zkir-v3), node 2.0.0-rc.4, indexer 4.4.0-pre-alpha.16, proof server 9.0.0-rc.5_experimental, @midnightntwrk/ledger-v9 1.0.0-rc.3.
Full Changelog: v0.23.0...v0.24.0
v0.23.0
Highlights
- The stagenet MPC output cache moved buckets.
getMpcOutputCacheUrl(MidnightNetwork.Stagenet)publisheshttps://storage.googleapis.com/midnight-cache-storage-testnet/v1/stagenet, in place of themidnight-cache-storage-devbucket (#121).
Changes
MpcOutputCacheReaderconstructed without an explicitcacheUrlreads stagenet's attested output bytes from the new bucket. The object prefix and layout are untouched:<prefix>/<networkId>/<signetContractAddress>/<requestId>.bin, andfetchSerializedOutput(requestId)still returnsundefineduntil the MPC has written the object (#121).- The README's Output Recovery section and Matched Set table quote the new URL and 0.23.0 (#121).
Dependencies
adm-zip0.6.0 → 0.6.1, resolved throughhardhatinpackages/integration-tests. Development only: it reaches no published@sig-net/*package (#114).
Breaking changes
- Stagenet cache default. An application on the default cache URL picks up the new bucket by upgrading. One that passes
cacheUrlexplicitly owns the string and must update it. No export changes its signature or its output (#121).
Matched set
All four @sig-net/* packages ship at 0.23.0: midnight, midnight-contract, midnight-contract-deploy and midnight-serde. The rest of the stack is unchanged from 0.22.x: fakenet 0.25.0, Compact compiler 0.33.0-rc.2 (--feature-zkir-v3), node 2.0.0-rc.4, indexer 4.4.0-pre-alpha.16, proof server 9.0.0-rc.5_experimental, @midnightntwrk/ledger-v9 1.0.0-rc.3.
Full Changelog: v0.22.2...v0.23.0
v0.22.2
Highlights
- The request signing key is derivable as a key, not only as its EVM address:
deriveMidnightRequestSigningKeyreturns the public key the MPC signs a contract's requests with (#119). - Request records derive their own signer: two functions take an on-ledger request record and own the MPC's rendering of its
senderandpathinto the derivation string, which every consumer did by hand until now (#119).
New features
deriveMidnightRequestSigningKey(mpcSecp256k1PublicKey, contractAddress, path): the request signing public key as aSecp256k1Point, the request-side twin ofderiveMidnightResponseKey. Format it withformatSecp256k1PublicKey(#119).deriveSignBidirectionalEventSigningKey(mpcSecp256k1PublicKey, request)andderiveSignBidirectionalEventSignerEvmAddress(mpcSecp256k1PublicKey, request): the same key, and its EVM address, from a request record. The requester is the record'ssender, and the path is the lowercase hex of its full 32pathbytes, exactly as the MPC renders it. The address is theexpectedSignerthatverifySignatureRespondedEventtakes (#119).SignBidirectionalEventKeySelector: the two record fields (sender,path) that select a request signing key, so a caller can pass a whole record or just those two (#119).asciiUnpadded(bytes): the inverse ofasciiPadded, for the zero-padded text fields of a request record (caip2Id, the two schemas). Only trailing zero bytes are padding: a zero byte inside the text is kept (#119).
Refactoring
deriveEvmAddressis defined as the address ofderiveMidnightRequestSigningKey, so the key and its address cannot drift apart. Its golden vectors pass unchanged (#119).decodeSignetEventNamegoes throughasciiUnpadded, leaving the package one implementation of the unpadding (#119).- The new key functions are pinned to the existing independent golden addresses: a key whose EVM address matches a golden vector is the key that vector was constructed from, so no vector was generated from the code under test (#119).
Breaking changes
- None. The release is additive: no existing export changes its signature or its output.
Full Changelog: v0.22.1...v0.22.2
v0.22.1
v0.22.0
Highlights
- Attestation digests bind the output width, closing a replay where one MPC signature verified the same bytes at two widths (#96).
- Signet events are streamed, decoded and located: one direct indexer route yields typed events carrying their transaction hash, block height and block time (#107, #110).
MpcOutputCacheReaderfetches a request's attested output bytes from the MPC's public output cache, an alternative to an EVM RPC with fulldebug_traceTransaction(#103).
New features
MpcOutputCacheReaderandgetMpcOutputCacheUrl, with the stagenet cache as the published default. Cached bytes are untrusted until the attestation signature verifies over them (#103).SignetEventSource.streamSignetEvents(contractAddress): anAsyncIterablethat yields each page of 100 before requesting the next, pins the walk to the first page'smaxId, and issues no further requests once the consumer leaves the loop (#107).signetEventSourceFromIndexer({ queryUrl })yieldsIndexedSignetMiscEvent: the event plusid,maxId,transactionId,transactionHash,blockHeight,blockHashandblockTimestamp(#110).- Decoded events:
decodeSignetEvent,tryDecodeSignetEvent(non-throwing, for live streams) anddecodeSignetEventNamed, returning aDecodedSignetEventunion discriminated onnamethat keeps itssourceevent (#110). - Verification over events already in hand, with no history walk per request id:
reader.verifySignatureRespondedEventsandfindVerifiedRespondBidirectionalEvent(#110).
Bug fixes
- The attestation preimage is
[requestId, width, output].transientHashpacks trailing zero bytes away, so without the width a failure attestation could be replayed as a success at another width (#96).
Refactoring
SignetRequestResponseReaderis built ondecodeSignetEventNamed: it filters and decodes as events arrive, and an undecodable event of another kind cannot fail a read that never asked for it (#107, #110).- ABI word tests are typed case tables pinning both the compiled circuits and their TS twins to golden big-endian bytes, including the 2^64 boundaries (#106).
Breaking changes
- Attestation digest: signatures over the 0.21.0 preimage no longer verify. Recompile verifying contracts and upgrade the responder together (the matched fakenet release is
0.25.0) (#96). - Removed
SignetEventSource.querySignetEvents,signetEventSourceFromPublicDataProviderandSignetContractEventQuerySource. Construct the source withsignetEventSourceFromIndexer({ queryUrl })and collect withfor await(#107, #110). SignBidirectionalNotification.versionis the literal1, no longernumber(#110).- The stagenet MPC root public key is the signet.js
TESTNETkey, replacingTESTNET_DEV(#103). - Default indexer URLs for every network use
/api/v4/graphql(#104).
Closes
- #63: compiled ABI word circuits with golden vectors to test the TS twins against (#106).
- #105: stream signet contract events with an async generator (#107).
- #109: decoded signet event union and a name-dispatching decoder (#110).
- #111: indexer event source yielding transaction hash, block height and block time (#110).
- Also closed during this cycle, outside any pull request: #40 (README section on recovering foreign transaction output), #49, #67, #80, #81, #82.
Full Changelog: v0.21.0...v0.22.0
v0.21.0
v0.21.0
Four @sig-net/* packages ship at 0.21.0: midnight (Compact module + TS SDK), midnight-contract (the signet singleton), midnight-contract-deploy and midnight-serde.
Highlights
- Sign bidirectional flow on Midnight. Integrating contracts store a
SignBidirectionalEventand cross-contract call the singleton'ssignBidirectional. The MPC signs and responds on chain, and the SDK reads, decodes and verifies the response (verifyRespondBidirectionalSignature). - EVM type 2 transaction support. ABI calldata word helpers,
signBidirectionalEventToUnsignedEvmTransaction/...ToSignedEvmTransaction, and Ethereum requests routed through the MPC's fixedeip155:1key with the transactionchainIdselecting the network. - Key derivation aligned with the MPC.
deriveEvmAddress/deriveEpsilonuse themidnight:mainnetchain id on every network (MIDNIGHT_CAIP2_ID). MPC root keys accepted as NEARsecp256k1:or SEC1 hex. Derived addresses change for every contract. - Poseidon (
transientHash) for every in-circuit hash, cutting proving cost by orders of magnitude versus SHA-256/keccak. - Chunked ledger state reading: raw-state parsing handles contracts past 15 ledger fields, pinned by a 20-field fixture contract, and signet event reads are paginated.
- Deploy tooling:
WalletRegistrywallet reuse, DUST-aware fee readiness and NIGHT/DUST funding shares, network defaults for contract address and MPC root key, plus a manual GitHub deploy workflow per Midnight network. - Documentation: consolidated protocol README with the sign bidirectional flow diagram, integrator guide and matched-set table.
- Supply chain and CI hardening: install scripts disabled, SHA-pinned actions, Dependabot, CodeQL, strict typescript-eslint and prettier enforced in CI, stable tags publish only from
main.
Matched set: fakenet 0.22.0, Compact compiler 0.33.0-rc.2 (--feature-zkir-v3), node 2.0.0-rc.4, proof server 9.0.0-rc.5_experimental, @midnightntwrk/ledger-v9 1.0.0-rc.3.