An example would be a promise I made last Christmas to my fiancée. I've had a hard time quitting smoking because it's my go-to solution when life is stressful and feels like the walls are coming down. I gave her 500€ and told her that money is for a small holiday for us next summer if I don't smoke. If I smoke she can keep it all and use it for whatever she wants.
Now when I wanted to smoke, I'd have to weigh the decision against that promise. The downside was, I had a clear price that I could decide to pay if I wanted a cigarette. Needless to say, I failed in two months and now she has a new sewing machine.
On the other hand, I've now managed to keep a 45 day streak on duolingo. It's a way smaller thing and there's nothing externally motivating me except that damn little owl and a little lit flame icon displaying my streak. There's no penalty for failing nor is there any way to wiggle out of failing if I choose not to do my daily exercises. My main motivation is just to learn Welsh for the sake of it and I find it much easier to keep this up than any other habit which comes with internal or external pressure.
Making your friends hold you accountable to something just sounds like the recipe for getting unmotivated and losing the actual goal and swapping the enjoyment of doing something into fear of some sort of penalty which one could decide was worth facing.
I've also heard that talking too much of your ideas and goals will decrease motivation as you gain some feeling of success which should be rewarded to you after you've actually done the deed. I feel that this personally affects me and I've stopped talking about goals and I'm just trying to reach them and celebrating afterwards.