I want to create a pallet account and then store assets using pallet assets in it, but I have a problem withdrawing assets from the pallet account because you can't transfer from pallet assets unless there is an origin call for the account you want to transfer from, and there is no origin for the pallet account.

1 Answer 1


How did you create this "pallet account"?

Take a look at how the Treasury pallet creates its account:

fn build(&self) {
    // Create Treasury account
    let account_id = <Pallet<T, I>>::account_id();
    let min = T::Currency::minimum_balance();
    if T::Currency::free_balance(&account_id) < min {
        let _ = T::Currency::make_free_balance_be(&account_id, min);

Specifically, the account_id() function:

/// The account ID of the treasury pot.
pub fn account_id() -> T::AccountId {

If you follow the trail all the way, you will find the actual function that creates the account:

fn into_sub_account_truncating<S: Encode>(&self, sub: S) -> T {
    (Id::TYPE_ID, self, sub)
        .using_encoded(|b| T::decode(&mut TrailingZeroInput(b)))
        .expect("All byte sequences are valid `AccountIds`; qed")

At the end of the day, this account can be used just like any other account in Substrate.

  • I have created it like this but wen i want to use transfer in pallet assets it only accept origin from dont accept account id Commented Jan 2, 2023 at 18:57
  • 1
    I see your point. Perhaps consider using frame_system::RawOrigin::Signed(account_id). Take a look at this example.
    – Bruno
    Commented Jan 2, 2023 at 19:29
  • 1
    Thanks you.worked like magic Commented Jan 2, 2023 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.