Skip to content

Conversation

@kmillikin
Copy link

This is a first revision of a proposal to move the Compact programming language into LFDT. We have already received some feedback which we are still to address.

@kmillikin kmillikin requested a review from a team as a code owner July 17, 2025 12:36
@@ -1 +1 @@
* @LF-Decentralized-Trust/tac
* @midnightntwrk/mn-codeowners-project-proposals
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously we don't intend to merge this :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please undo the changes and update this PR so that we can merge when appropriate.

Copy link
Contributor

@tkuhrt tkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the proposal. As we discussed today, we will be formally reviewing this at the July 24 TAC meeting. Here are some initial comments.

version.
</mark>

# Sponsor(s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any sponsors outside of Shielded? See Project Incubation Entry Considerations for sponsorship expectations and who might be a sponsor.

- the Midnight Network's blockchain is used to verify ZK proofs and execute the public part of the contract on chain.

However, this is merely the specific implementation of Compact in the Midnight Network.
The language itself is designed to be generically used in any privacy-preserving smart contract system that is sufficiently similar,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide characteristics that would define what a "sufficiently similar" smart contract system would be?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's the characteristics described just above (off-chain code has access to private data, on-chain code does not, a ZK proof is constructed off chain and verified on chain).

I'll try to make that clear.

Compact is a language that is designed to support a range of privacy-preserving smart contract systems.
It has both an informal language reference and a formal specification in Agda.
Both of these specifications are in progress and evolving as the language changes.
There is also an official implementation in the form of the Compact compiler, and a suite of developer tools forming a Compact software development kit (SDK).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are both of these implementations (compiler and SDK) being proposed for inclusion in this project?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. They are both part of the Compact open-source (not yet public) repository that we are preparing.

@kmillikin kmillikin changed the title Initial version of the Compact proposal Proposal to move the Compact programming language under LFDT Jul 23, 2025
Copy link

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmillikin Quick question: Is there any sort of interoperability/transpilation possible between EVM chains and Compact compiled contracts? For example if I wanted to use Compact to develop more secure contracts deployed on the Ethereum mainnet, would there be a path for that? Totally fine if the answer is no, I'm just trying to get a handle of the scope of the project. In general the proposal looks good to me so far.
One more quick question: what project lifecycle are you targeting? Incubation or ?

@kmillikin
Copy link
Author

@petermetz that's an interesting question about EVM!

Much of the work in the Compact programming model happens off chain. On chain there is "only" verfication of a proof (a zkSNARK on Midnight) and execution of public state updates. So that suggests to me that the answer is "possibly yes". You would have to implement the proof verification at the contract level rather than in the blockchain itself.

We're proposing incubation, I've added some more text to the proposal about that.

Copy link
Member

@arsulegai arsulegai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing the majority of open questions during the recent TAC meeting. I’d like to capture and reiterate a few key points here for continued clarity and action:

  1. Could you specify which components of the project will be open sourced? Additionally, how do you plan to position each open-sourced repository—as a code contribution, a specification contribution, or otherwise? This clarification will help the community understand the intended scope and encourage the right type of engagement.
  2. Please outline the “lego” or modular components that will enable adaptation of compact programming languages to various blockchain protocols.
  3. I encourage the team to define clear, strategic goals for the project, including both a 3-year and a 5-year plan. Taking a longer-term perspective will help ensure sustained progress, effective tracking, and alignment of the community’s expectations regarding project milestones and future development.
  4. Providing example implementations and reference cases will help guide contributors and kickstart development.
  5. Sharing real-world examples and past success stories will help build credibility and increase engagement.
  6. Consider organizing technology sessions or workshops to deepen knowledge sharing and foster a stronger sense of community.

## Major Areas of Focus
- Cross-blockchain abstraction layer
- Multi-target compiler backends
- Cross-chain security
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide additional context, what does cross-chain security mean per the project proposal?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not proposing anything specific because we don't know the details of the multiple chains and how they will interact. We will consider if there are cross-chain security issues and what they are and if there are mitigations we can implement.

@arsulegai arsulegai requested a review from a team July 31, 2025 06:39
@kmillikin
Copy link
Author

Thanks for the questions and suggestions, @arsulegai. I'll work on addressing them in the proposal but in the mean time, here are some responses:

  1. We are proposing to open source the "Compact" repository except for the very small amount of third party code and a small amount of code that we intend to upstream to various projects. This includes: the Compact compiler, the tests, the Visual Studio Code extension for Compact, the compact command line developer tools, the Compact language reference, and the formal specification. It also includes some Midnight-specific components like the Compact runtime JavaScript package. It does not include the definitions or implementations of either the Impact VM or the ZKIR intermediate representation (these are in separate project Midnight repositories and they are Midnight-specific. They will be open sourced but separately from the Compact language.)
  2. I will attempt to make it more clear in the proposal. The Midnight-specific components are (a) two backend passes that generate JavaScript, and (b) one that generates ZKIR (proof representations). There is (c) a Midnight-specific "Compact runtime" JavaScript package that's used by the generated JavaScript code. There is (d) a Midnight-specific implementation of the ledger data types. You would have to provide replacements for these components, but there's a lot of flexibility to how those are implemented.
  3. Yes. As incubation progresses one of the deliverables will be a long-term roadmap.
  4. The implementation of Compact for Midnight is the example implementation. There is an active Midnight testnet to help contributors understand how the language interacts with the blockchain.
  5. We already have some real world examples of Compact (such as the Open Zeppelin token implementations at https://github.com/OpenZeppelin/compact-contracts, we have partners building more examples like these) and if the project succeeds there will be more.
  6. Yes. We will engage with the community to help build it. We are currently doing irregular but frequent "dev diary" blog posts and community calls on the Midnight Discord server and we'd expect to establish a more regular structure for those.

@ryjones
Copy link
Member

ryjones commented Jul 31, 2025

please rebase on the tip of gh_pages

bobblessinghartley and others added 18 commits August 14, 2025 14:46
Update and rename birkhoffproposal.md to TBNproposal.md
move to TBN

Signed-off-by: Bob Blessing-Hartley <[email protected]>
Signed-off-by: Bob Blessing-Hartley <[email protected]>
Signed-off-by: Bob Blessing-Hartley <[email protected]>
Signed-off-by: Bob Blessing-Hartley <[email protected]>
Changed naming to NightStream

Signed-off-by: Bob Blessing-Hartley <[email protected]>
Signed-off-by: Aggelos Kiayias <[email protected]>
some edits and adjustments
adjustments to contributors.

Signed-off-by: Bob Blessing-Hartley <[email protected]>
@ryjones
Copy link
Member

ryjones commented Sep 4, 2025

@kmillikin @bobblessinghartley please rebase and squash to important commits and rebase that on the tip of gh-pages. please combine the contents of #36 with this PR and have @djetchev close it

solegga and others added 8 commits September 5, 2025 11:51
Signed-off-by: Aggelos Kiayias <[email protected]>
edits in the performance section
aligned committer descriptons

Signed-off-by: Bob Blessing-Hartley <[email protected]>
added Nicolas

Signed-off-by: Bob Blessing-Hartley <[email protected]>
adding DJ github / affiliation + arithmetization information
Copy link

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'll wait for final review once the rebase has been done, please re-request review once that's finished!

@ryjones ryjones force-pushed the gh-pages branch 2 times, most recently from ab64683 to 6c2f28e Compare October 24, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants