A method for preparing a hairpin comprising a sequence of interest, said method comprising the steps of: a) providing a nucleic acid HP1, said nucleic acid comprising: • a first end bound to a first surface; • a single-stranded region of sequence A linked to said first end, • a single-stranded region of sequence A' hybridised to said single-stranded region A, wherein said single-stranded regions A and A' are not covalently linked; • at least one single-stranded region of sequence C linked to said single-stranded region of sequence A'; • a second end linked to said single-stranded region of sequence C, wherein said second end is bound to a second surface; • wherein one of the first and the second surfaces is a movable surface b) providing at least one nucleic acid HP2, said nucleic acid comprising: • a double-stranded region comprising the sequence of interest, • a loop linked to a first end of said double-stranded region, • a single-stranded region having the sequence A linked to a first strand of the second end of said double-stranded region, said region of sequence A being linked to a single-stranded region of sequence C', C' being complementary of C; • a single-stranded polynucleotide having the sequence A' linked to a second strand of the second end of said double-stranded polynucleotide molecule, wherein the single-stranded polynucleotides of sequences A and A' are hybridised; c) denaturing said nucleic acid HP1 of step a) in the presence of said nucleic acid HP2 of step b) by moving away the surfaces by applying a tension of at least 3 pN; and d) obtaining a hairpin. a) providing a nucleic acid HP1, said nucleic acid comprising: • a first end bound to a first surface; • a single-stranded region of sequence A linked to said first end, • a single-stranded region of sequence A' hybridised to said single-stranded region A, wherein said single-stranded regions A and A' are not covalently linked; • at least one single-stranded region of sequence C linked to said single-stranded region of sequence A'; • a second end linked to said single-stranded region of sequence C, wherein said second end is bound to a second surface; • wherein one of the first and the second surfaces is a movable surface • a first end bound to a first surface; • a single-stranded region of sequence A linked to said first end, • a single-stranded region of sequence A' hybridised to said single-stranded region A, wherein said single-stranded regions A and A' are not covalently linked; • at least one single-stranded region of sequence C linked to said single-stranded region of sequence A'; • a second end linked to said single-stranded region of sequence C, wherein said second end is bound to a second surface; • wherein one of the first and the second surfaces is a movable surface b) providing at least one nucleic acid HP2, said nucleic acid comprising: • a double-stranded region comprising the sequence of interest, • a loop linked to a first end of said double-stranded region, • a single-stranded region having the sequence A linked to a first strand of the second end of said double-stranded region, said region of sequence A being linked to a single-stranded region of sequence C', C' being complementary of C; • a single-stranded polynucleotide having the sequence A' linked to a second strand of the second end of said double-stranded polynucleotide molecule, wherein the single-stranded polynucleotides of sequences A and A' are hybridised; • a double-stranded region comprising the sequence of interest, • a loop linked to a first end of said double-stranded region, • a single-stranded region having the sequence A linked to a first strand of the second end of said double-stranded region, said region of sequence A being linked to a single-stranded region of sequence C', C' being complementary of C; • a single-stranded polynucleotide having the sequence A' linked to a second strand of the second end of said double-stranded polynucleotide molecule, wherein the single-stranded polynucleotides of sequences A and A' are hybridised; c) denaturing said nucleic acid HP1 of step a) in the presence of said nucleic acid HP2 of step b) by moving away the surfaces by applying a tension of at least 3 pN; and d) obtaining a hairpin.