@@ -167,7 +167,60 @@ impl NetworkProver {
167167 NetworkProveBuilder {
168168 prover : self ,
169169 mode : SP1ProofMode :: Core ,
170- pk,
170+ vk : & pk. vk ,
171+ elf : & pk. elf ,
172+ stdin : stdin. clone ( ) ,
173+ timeout : None ,
174+ strategy : self . default_fulfillment_strategy ( ) ,
175+ skip_simulation : false ,
176+ cycle_limit : None ,
177+ gas_limit : None ,
178+ tee_2fa : false ,
179+ min_auction_period : 1 ,
180+ whitelist : None ,
181+ auctioneer : None ,
182+ executor : None ,
183+ verifier : None ,
184+ treasury : None ,
185+ max_price_per_pgu : None ,
186+ auction_timeout : None ,
187+ }
188+ }
189+
190+ /// A request to generate a proof for a given verifying key, ELF and input.
191+ ///
192+ /// This allow to send proof requests to the network without having to run
193+ /// `setup()`. You just need the verifying key that is cheap to
194+ /// deserialize.
195+ ///
196+ /// # Details
197+ /// * `vk`: The verifying key to use for the proof.
198+ /// * `elf`: The ELF to use for the proof.
199+ /// * `stdin`: The input to use for the proof.
200+ ///
201+ /// # Example
202+ /// ```rust,no_run
203+ /// use sp1_sdk::{Prover, ProverClient, SP1Stdin};
204+ ///
205+ /// let elf = &[1, 2, 3];
206+ /// let vk_bytes = &[4, 5, 6];
207+ /// let stdin = SP1Stdin::new();
208+ ///
209+ /// let client = ProverClient::builder().network().build();
210+ /// let vk = bincode::deserialize(vk_bytes).unwrap();
211+ /// let proof = client.prove_from_vk(&vk, elf, &stdin).run();
212+ /// ```
213+ pub fn prove_from_vk < ' a > (
214+ & ' a self ,
215+ vk : & ' a SP1VerifyingKey ,
216+ elf : & ' a [ u8 ] ,
217+ stdin : & ' a SP1Stdin ,
218+ ) -> NetworkProveBuilder < ' a > {
219+ NetworkProveBuilder {
220+ prover : self ,
221+ mode : SP1ProofMode :: Core ,
222+ vk,
223+ elf,
171224 stdin : stdin. clone ( ) ,
172225 timeout : None ,
173226 strategy : self . default_fulfillment_strategy ( ) ,
@@ -555,7 +608,8 @@ impl NetworkProver {
555608 #[ allow( clippy:: too_many_arguments) ]
556609 pub ( crate ) async fn request_proof_impl (
557610 & self ,
558- pk : & SP1ProvingKey ,
611+ vk : & SP1VerifyingKey ,
612+ elf : & [ u8 ] ,
559613 stdin : & SP1Stdin ,
560614 mode : SP1ProofMode ,
561615 strategy : FulfillmentStrategy ,
@@ -571,9 +625,9 @@ impl NetworkProver {
571625 treasury : Option < Address > ,
572626 max_price_per_pgu : Option < u64 > ,
573627 ) -> Result < B256 > {
574- let vk_hash = self . register_program ( & pk . vk , & pk . elf ) . await ?;
628+ let vk_hash = self . register_program ( vk, elf) . await ?;
575629 let ( cycle_limit, gas_limit, public_values_hash) =
576- self . get_execution_limits ( cycle_limit, gas_limit, & pk . elf , stdin, skip_simulation) ?;
630+ self . get_execution_limits ( cycle_limit, gas_limit, elf, stdin, skip_simulation) ?;
577631 let ( auctioneer, executor, verifier, treasury, max_price_per_pgu, base_fee, domain) = self
578632 . get_auction_request_params (
579633 mode,
@@ -610,7 +664,8 @@ impl NetworkProver {
610664 #[ allow( clippy:: too_many_arguments) ]
611665 pub ( crate ) async fn prove_impl (
612666 & self ,
613- pk : & SP1ProvingKey ,
667+ vk : & SP1VerifyingKey ,
668+ elf : & [ u8 ] ,
614669 stdin : & SP1Stdin ,
615670 mode : SP1ProofMode ,
616671 strategy : FulfillmentStrategy ,
@@ -636,7 +691,8 @@ impl NetworkProver {
636691 loop {
637692 let request_id = self
638693 . request_proof_impl (
639- pk,
694+ vk,
695+ elf,
640696 stdin,
641697 mode,
642698 strategy,
@@ -660,7 +716,7 @@ impl NetworkProver {
660716 let request = super :: tee:: api:: TEERequest :: new (
661717 & self . client . signer ,
662718 * request_id,
663- pk . elf . clone ( ) ,
719+ elf. to_vec ( ) ,
664720 stdin. clone ( ) ,
665721 cycle_limit. unwrap_or_else ( || {
666722 super :: utils:: get_default_cycle_limit_for_mode ( self . network_mode )
@@ -899,7 +955,8 @@ impl Prover<CpuProverComponents> for NetworkProver {
899955 mode : SP1ProofMode ,
900956 ) -> Result < SP1ProofWithPublicValues > {
901957 block_on ( self . prove_impl (
902- pk,
958+ & pk. vk ,
959+ & pk. elf ,
903960 stdin,
904961 mode,
905962 self . default_fulfillment_strategy ( ) ,
0 commit comments