1) you must go to any place in the game, skull island mountain, ancient tunnels.... (but you can find much treasures in Valencia)
2) search all the places like the caves or Behid the houses or the plants.
3) if you find a treasure with 2 locks or 4 you can tell a friend to come quickly and help.

or

1) join a battle have joining it 4 or 2 pirates
2) when you finish the battle, you will see a treasure chest with 4 locks or 2 locks
3) open the treasure with your friends

Enjoy with your doubloons