-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
taiga data format and api #222
Conversation
XuyangSong
commented
Sep 29, 2023
- basic taiga data format and layout
- simplified Taiga APIs for external
- add hints to the partial transaction
- add a new partial transaction creation API to support concrete circuit presentation instead of dynamic one.
ValidityPredicateRepresentation::VampIR(circuit) => { | ||
// TDDO: use the file_name api atm, | ||
// request vamp_ir to provide a api to generate circuit from bytes. | ||
let vamp_ir_circuit_file = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we are unlikely to use files per se in the normal operation of Anoma
} | ||
|
||
impl ShieldedPartialTransaction { | ||
#[cfg(feature = "borsh")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like this might be ok to have even if borsh feature is not enabled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't compile. TrivialValidityPredicateCircuit
uses the borsh to generate the ValidityPredicateByteCode
.
Should we set a default serialization feature(serde or borsh) inside Taiga? Adding the feature flag everywhere is annoying if I want to use a serialization underlying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. I'm not sure if having borsh and/or serde on by default is a better choice than having them behind a feature flag.
@@ -66,12 +69,48 @@ struct ShieldedPartialTransactionProxy { | |||
inputs: Vec<NoteVPVerifyingInfoSet>, | |||
outputs: Vec<NoteVPVerifyingInfoSet>, | |||
binding_sig_r: pallas::Scalar, | |||
hints: Vec<u8>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is hints
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's Jeremy's requirement.
hints
describes intents or partial tx to help the solver match. It will be handled outside of Taiga.
06e3493
to
9b0032f
Compare
@@ -42,6 +42,7 @@ pub struct ShieldedPartialTxBundle(Vec<ShieldedPartialTransaction>); | |||
#[derive(Debug, Clone, PartialEq, Eq)] | |||
#[cfg_attr(feature = "nif", derive(NifStruct))] | |||
#[cfg_attr(feature = "nif", module = "Taiga.Transaction.Result")] | |||
#[cfg_attr(feature = "borsh", derive(BorshSerialize, BorshDeserialize))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably also should have
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9b0032f
to
ab5dd61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
3448aef
to
bde6cf5
Compare