# Account guardians, EIP1271, and recursive proofs

**URL:** <https://forum.aztec.network/t/account-guardians-eip1271-and-recursive-proofs/675>\
**Category:** Aztec\
**Created:** [July 17, 2023, 12:54pm UTC](https://forum.aztec.network/t/account-guardians-eip1271-and-recursive-proofs/675 "2023-07-17T12:54:06Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![LasseAztec](https://avatars.discourse-cdn.com/v4/letter/l/90db22/32.png) [@LasseAztec](https://forum.aztec.network/u/LasseAztec)\
**Post date:** [August 22, 2023, 7:24pm UTC](https://forum.aztec.network/t/account-guardians-eip1271-and-recursive-proofs/675/4 "2023-08-22T19:24:56Z")

</div>

I really like the idea around recursive ZKP’s with the account contracts, as it also will allow us to have something like depositing funds into defi contracts from the private domain WITHOUT needing approvals 👀.

Recall that funds can be spend if you can generate a valid proof and only someone having knowledge of the notes _and_ being able to satisfy the account contract can make such a proof.  
This means that a `transferFrom` function could practically take `from, to, amount, proof` and do a `staticcall` to `from` to see if the `proof` is valid for a `transfer(to, amount)` function call. If it is, do the transfer, and go back to the execution you were in the middle of otherwise the entire thing reverts.

If an oracle is used to generate the proof, dapps could look quite similar to what people expect of solidity dapps, but without needing to deal with lingering approvals 🎉

```rust
// Private function to deposit into X
fn deposit(asset: Address, amount: u120) -> ... {
  // Perform input validation 

  // Encoded function signature and args
  let transfer_call = ...;
  
  // Oracle call to get a proof.
  // The oracle could either generate or pass it on
  let proof = oracle.get_proof(asset, transfer_call);
  
  // Transfer the assets into this contract
  Token::at(asset).transferFrom(
    context.message_sender(), 
    context.this_address(),
    amount,
    proof
  );

  // Some accounting logic in this contract. 
  // The actual defi stuff.
}

```

---

_[View the full topic](https://forum.aztec.network/t/account-guardians-eip1271-and-recursive-proofs/675)._
