# Getting a Principal from a callback(actor function type) in motoko

**URL:** <https://forum.dfinity.org/t/getting-a-principal-from-a-callback-actor-function-type-in-motoko/24344>\
**Category:** Language Support\
**Tags:** Motoko\
**Created:** [November 2, 2023, 11:16am UTC](https://forum.dfinity.org/t/getting-a-principal-from-a-callback-actor-function-type-in-motoko/24344 "2023-11-02T11:16:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [November 2, 2023, 11:16am UTC](https://forum.dfinity.org/t/getting-a-principal-from-a-callback-actor-function-type-in-motoko/24344/1 "2023-11-02T11:16:53Z")

</div>

Is it possible to get the canister principal from an actor function reference?

```auto
let args = {
                  start = seeking;
                  length = thisEnd - seeking;
                };
                callback = (actor(archivePrincipal)) : ICRC3Interface).icrc3_get_transactions;
};

//later

Principal.fromActor(args.callback); //doesn't work(not that it should...but looking for something similar for an actor function ref)

```

---

<div class="post-metadata">

**Author:** ![claudio](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/claudio/32/322_2.png) [@claudio](https://forum.dfinity.org/u/claudio)\
**Post date:** [November 2, 2023, 5:06pm UTC](https://forum.dfinity.org/t/getting-a-principal-from-a-callback-actor-function-type-in-motoko/24344/2 "2023-11-02T17:06:54Z")

</div>

By design, no, since that’s like breaking the abstraction of functions.

However, if you really, really have to, you could probably serialize the function reference to a blob, using to\_candid, and fish the principal from that. But that’s cheating and probably somewhat tedious to do.

---

<div class="post-metadata">

**Author:** ![kayicp](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/kayicp/32/36679_2.png) [@kayicp](https://forum.dfinity.org/u/kayicp)\
**Post date:** [March 22, 2024, 3:57am UTC](https://forum.dfinity.org/t/getting-a-principal-from-a-callback-actor-function-type-in-motoko/24344/3 "2024-03-22T03:57:01Z")

</div>

funny. when i’m trying to implement icrc3, i kinda need the principal from the returned callbacks (for logging purposes). guess i have to find another way.
