Skip to content

Releases: sig-net/midnight-integration

v0.25.0

Choose a tag to compare

@BRBussy BRBussy released this 14 Oct 13:32
b62e67e

Highlights

  • An attestation verifies from the event alone. The MPC signs a digest over the output's length and hash, and RespondBidirectionalEventV1 carries outputHash after serializedOutputLength, so a node or a client checks a post without the output (sig-net/mpc#1423, Section 7.4.2) (#138).
  • executionDest is 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/midnight publishes d2a2419b5f296dae40c5681840b660f5ebab6cbd21c107e05e0464045b589517 for stagenet, in place of 5ecbb10ce05c9e55d1990048aec4c0a5669036fb1c1f5922b900880047d8e2bf, the 0.24 singleton (#141).

Changes

  • Signet.compact: calculateAttestedOutputHashV1<N> hashes the output under the new HashDomain.attestedOutput (6). verifyRespondBidirectionalAttestationV1 checks an event's signature without the output, verifyAttestedOutputV1<N> checks an output against an attested length and hash, and verifyRespondBidirectionalEventV1 does both (#138).
  • @sig-net/midnight exports the TypeScript twins calculateAttestedOutputHash, verifyRespondBidirectionalAttestation, verifyAttestedOutput and verifyRespondBidirectionalEvent (#138).
  • SignetRequestResponseReader checks 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. calculateSignetAttestationDigestV1 is no longer generic: it takes the request id, height, kind, output length and output hash. executionDest, EXECUTION_DEST_BYTES and ethereumCaip2Id() move from 32 to 64 bytes (#138).
  • Renamed in @sig-net/midnight. verifyRespondBidirectionalSignature is verifyRespondBidirectionalEvent, after its Compact circuit (#138).
  • Responder. Run the fakenet 0.35.0, built on these packages: 0.34.0 speaks 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

v0.25.0-rc.3 Pre-release
Pre-release

Choose a tag to compare

@Pessina Pessina released this 13 Oct 16:21
v0.25.0-rc.3
c931f79

⚠️ Warning: the Sig Network MPC is not yet monitoring or responding to requests made with this version of the protocol. Develop locally against the fakenet 0.35.0.

Highlights

  • Stagenet has a new Signet singleton for the 0.25 wire format. @sig-net/midnight publishes d2a2419b5f296dae40c5681840b660f5ebab6cbd21c107e05e0464045b589517 for stagenet, in place of 5ecbb10ce05c9e55d1990048aec4c0a5669036fb1c1f5922b900880047d8e2bf, 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

v0.25.0-rc.2 Pre-release
Pre-release

Choose a tag to compare

@Pessina Pessina released this 13 Oct 15:21
v0.25.0-rc.2
449543f

⚠️ 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/midnight publishes is still the 0.24 singleton. Develop locally against the fakenet 0.35.0.

Highlights

  • An attestation verifies from the event alone. The MPC signs a digest over the output's length and hash, and RespondBidirectionalEventV1 carries outputHash after serializedOutputLength, so a node or a client checks a post without the output (sig-net/mpc#1423, Section 7.4.2) (#138).
  • executionDest is 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 new HashDomain.attestedOutput (6). verifyRespondBidirectionalAttestationV1 checks an event's signature without the output, verifyAttestedOutputV1<N> checks an output against an attested length and hash, and verifyRespondBidirectionalEventV1 does both (#138).
  • @sig-net/midnight exports the TypeScript twins calculateAttestedOutputHash, verifyRespondBidirectionalAttestation, verifyAttestedOutput and verifyRespondBidirectionalEvent (#138).
  • SignetRequestResponseReader checks 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 and redeploy it (#138).
  • Signet.compact. calculateSignetAttestationDigestV1 is no longer generic: it takes the request id, height, kind, output length and output hash. executionDest, EXECUTION_DEST_BYTES and ethereumCaip2Id() move from 32 to 64 bytes (#138).
  • Renamed in @sig-net/midnight. verifyRespondBidirectionalSignature is verifyRespondBidirectionalEvent, after its Compact circuit (#138).
  • Responder. Run the fakenet 0.35.0, built on these packages: 0.34.0 speaks 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

Choose a tag to compare

@BRBussy BRBussy released this 06 Oct 21:26
a80e98e

⚠️ 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

Choose a tag to compare

@BRBussy BRBussy released this 05 Oct 12:53
2a45ce2

⚠️ 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 V1 suffix, SignBidirectionalEventV1 takes the spec's field order, and the request id hashes RequestIdPreimageV1, whose txParamsDigest covers 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. RespondBidirectionalEventV1 carries 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 as failed or unviable, in place of the 5-byte deadbeef payload (#126, #127).
  • One schema per request, serialised with Borsh. The MPC derives the response layout from the ABI output schema, so respondSerializationSchema is reserved. The supported output types are bool, uint256, address and bytes1 to bytes32, and the MPC drops a request that names any other (#58).
  • The SDK owns the MPC's output rules. isEvmContractCall, evmTraceOutputFromCallFrame and executedEvmRespondOutput rebuild the exact bytes the MPC attests from a debug_traceTransaction call frame, including a plain ETH transfer and a call that returns nothing (#129).
  • Stagenet has a new Signet singleton. @sig-net/midnight publishes 5ecbb10ce05c9e55d1990048aec4c0a5669036fb1c1f5922b900880047d8e2bf for stagenet, in place of 1df4ce25fc9f9c03dc6f4d0eb12ddf3d0db094995d4c70aca1142eebb3b77a5d (#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/midnight exports the OutputKind and HashDomain enums of the compiled protocol module, and the TypeScript twins calculateEvmType2TxParamsDigest and RequestIdPreimage (#127).
  • @sig-net/midnight exports the schema helpers deriveRespondSchema, respondOutputWidth, canonicalSchemaText and unsupportedEvmOutputFields (#58).
  • A uint256 output is attested whole as 32 little-endian bytes and narrowed in-circuit with the new checkedTruncationU128, which aborts unless the high 16 bytes are zero. An empty schema attests an empty output under executed (#58).
  • @sig-net/midnight-serde is a thin wrapper over native Borsh: compactSerialize, compactDeserialize and BorshValue. Its Rust twin, the signet-midnight-serde crate, joins it, and both are pinned to one shared conformance corpus (#58).
  • deploySignetContract in @sig-net/midnight-contract-deploy opens 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 exports deployEnvironmentTable, MIDNIGHT_NODE_CONFIG_ENV_VARS and FAUCET_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-protocol to midnight-integration, yarn compile:zk runs the full compile before generating keys, and the deploy scripts load the repo-root .env when it exists (#130). The local anvil mines every second, so the fakenet sees blocks finalise on a quiet chain (#129).

Dependencies

  • @sig-net/midnight-serde depends on borsh 2.0.0, and the signet-midnight-serde crate pins borsh 1.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, constructSignBidirectionalEvent and verifyRespondBidirectionalEvent each gain the V1 suffix. The record's caip2Id field is executionDest, and CAIP2_ID_BYTES is EXECUTION_DEST_BYTES (#127).
  • Failure handling. MPC_FAILURE_OUTPUT and isMpcFailureOutput are removed. Route settlement on the event's OutputKind (executed, failed or unviable), never on the output bytes (#127).
  • Response schema. respondSerializationSchema is reserved: constructSignBidirectionalEventV1 pins it to Bytes<0>, and a request built by hand must do the same. MAX_RESPOND_PACKED_BYTES, the Abi* schema types and evmType2TxParamsDescriptorOf are removed (#58, #127).
  • Serde. The Compact type descriptors of @sig-net/midnight-serde (CompactType and its family, compactSerializedSize, packedSize) are removed in favour of native Borsh schemas (#58).
  • Responder. The 0.23.0 stack's fakenet 0.25.0 cannot decode the reordered request record: run 0.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

Choose a tag to compare

@BRBussy BRBussy released this 22 Sep 13:52
43b74e4

Highlights

  • The stagenet MPC output cache moved buckets. getMpcOutputCacheUrl(MidnightNetwork.Stagenet) publishes https://storage.googleapis.com/midnight-cache-storage-testnet/v1/stagenet, in place of the midnight-cache-storage-dev bucket (#121).

Changes

  • MpcOutputCacheReader constructed without an explicit cacheUrl reads stagenet's attested output bytes from the new bucket. The object prefix and layout are untouched: <prefix>/<networkId>/<signetContractAddress>/<requestId>.bin, and fetchSerializedOutput(requestId) still returns undefined until 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-zip 0.6.0 → 0.6.1, resolved through hardhat in packages/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 cacheUrl explicitly 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

Choose a tag to compare

@BRBussy BRBussy released this 19 Sep 16:39
64328e2

Highlights

  • The request signing key is derivable as a key, not only as its EVM address: deriveMidnightRequestSigningKey returns 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 sender and path into the derivation string, which every consumer did by hand until now (#119).

New features

  • deriveMidnightRequestSigningKey(mpcSecp256k1PublicKey, contractAddress, path): the request signing public key as a Secp256k1Point, the request-side twin of deriveMidnightResponseKey. Format it with formatSecp256k1PublicKey (#119).
  • deriveSignBidirectionalEventSigningKey(mpcSecp256k1PublicKey, request) and deriveSignBidirectionalEventSignerEvmAddress(mpcSecp256k1PublicKey, request): the same key, and its EVM address, from a request record. The requester is the record's sender, and the path is the lowercase hex of its full 32 path bytes, exactly as the MPC renders it. The address is the expectedSigner that verifySignatureRespondedEvent takes (#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 of asciiPadded, 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

  • deriveEvmAddress is defined as the address of deriveMidnightRequestSigningKey, so the key and its address cannot drift apart. Its golden vectors pass unchanged (#119).
  • decodeSignetEventName goes through asciiUnpadded, 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

Choose a tag to compare

@BRBussy BRBussy released this 19 Sep 11:01
0ecde74

What's Changed

  • Export EVM Type 2 Sign Bidirectional Event Decoder by @BRBussy in #115

Full Changelog: v0.22.0...v0.22.1

v0.22.0

Choose a tag to compare

@BRBussy BRBussy released this 17 Sep 11:31
50d1920

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).
  • MpcOutputCacheReader fetches a request's attested output bytes from the MPC's public output cache, an alternative to an EVM RPC with full debug_traceTransaction (#103).

New features

  • MpcOutputCacheReader and getMpcOutputCacheUrl, with the stagenet cache as the published default. Cached bytes are untrusted until the attestation signature verifies over them (#103).
  • SignetEventSource.streamSignetEvents(contractAddress): an AsyncIterable that yields each page of 100 before requesting the next, pins the walk to the first page's maxId, and issues no further requests once the consumer leaves the loop (#107).
  • signetEventSourceFromIndexer({ queryUrl }) yields IndexedSignetMiscEvent: the event plus id, maxId, transactionId, transactionHash, blockHeight, blockHash and blockTimestamp (#110).
  • Decoded events: decodeSignetEvent, tryDecodeSignetEvent (non-throwing, for live streams) and decodeSignetEventNamed, returning a DecodedSignetEvent union discriminated on name that keeps its source event (#110).
  • Verification over events already in hand, with no history walk per request id: reader.verifySignatureRespondedEvents and findVerifiedRespondBidirectionalEvent (#110).

Bug fixes

  • The attestation preimage is [requestId, width, output]. transientHash packs trailing zero bytes away, so without the width a failure attestation could be replayed as a success at another width (#96).

Refactoring

  • SignetRequestResponseReader is built on decodeSignetEventNamed: 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, signetEventSourceFromPublicDataProvider and SignetContractEventQuerySource. Construct the source with signetEventSourceFromIndexer({ queryUrl }) and collect with for await (#107, #110).
  • SignBidirectionalNotification.version is the literal 1, no longer number (#110).
  • The stagenet MPC root public key is the signet.js TESTNET key, replacing TESTNET_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

Choose a tag to compare

@BRBussy BRBussy released this 12 Sep 13:49
d72a55c

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 SignBidirectionalEvent and cross-contract call the singleton's signBidirectional. 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 fixed eip155:1 key with the transaction chainId selecting the network.
  • Key derivation aligned with the MPC. deriveEvmAddress / deriveEpsilon use the midnight:mainnet chain id on every network (MIDNIGHT_CAIP2_ID). MPC root keys accepted as NEAR secp256k1: 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: WalletRegistry wallet 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.