In a mixing bowl, cream butter and sugar. Add eggs; mix well. Combine flour, baking powder, baking soda and salt; add to creamed mixture alternately with sour cream. Add extract.
Spoon a third of the batter into a greased 9-inch square baking pan. Top with a third of the cranberry sauce. Repeat layers twice. Sprinkle with walnuts.
Bake at 350F for 55-60 minutes or until a toothpick inserted near the center comes out clean.