A method for bonding a first semiconductor chip on a first substrate to a second semiconductor chip on a second substrate, comprising the steps of: - providing a bonding layer (6a,6b) on at least one of the substrates, the bonding layer being formed of a dielectric bonding material, wherein the dielectric bonding material is Hydrogen Silsesquioxane, or a partially condensed silsesquioxane in which 2 or more long chains of RSiO 3/2 units are connected at regular intervals by Si-O-Si bonds, where R is a hydrogen atom, an alkyl, an aryl or an alkoxy functional group, - bonding the first substrate to the second substrate and performing a thermal annealing step, so as to obtain a stack of the substrates with a bond layer between the substrates, wherein: - the first substrate is thinned either before or after the bonding step, - the thermal annealing step takes place at a temperature below a temperature at which the bonding material transforms into silicon oxide, - after bonding, an electron beam is scanned across an area of the thinned substrate, the energy of the electron beam being sufficient for the beam to reach the bond layer and to transform the scanned bonding material of the bond layer into a silicon oxide, to thereby obtain a volume of the bond layer that is transformed into a silicon oxide, wherein said volume is a closed wall extending over the full thickness of the bond layer, and enclosing a volume of bonding material, thereby separating that volume of bonding material from the rest of the bond layer, - thereafter, a via opening is etched through the thinned substrate until reaching the bonding material at the interior of the closed wall, and a dielectric liner is formed on the sidewalls of the via opening, - thereafter, through the via opening, the bonding material is removed from the interior of the closed wall, selectively with respect to the silicon oxide, so as to create a cavity in the bond layer and expose a conductor in the second substrate, - thereafter, the cavity and the via opening are filled with an electrically conductive material, to thereby form an electrical connection that connects the conductor in the second substrate to a conductor present in the first substrate and/or to a contact present on top of the stack. - providing a bonding layer (6a,6b) on at least one of the substrates, the bonding layer being formed of a dielectric bonding material, wherein the dielectric bonding material is Hydrogen Silsesquioxane, or a partially condensed silsesquioxane in which 2 or more long chains of RSiO 3/2 units are connected at regular intervals by Si-O-Si bonds, where R is a hydrogen atom, an alkyl, an aryl or an alkoxy functional group, - bonding the first substrate to the second substrate and performing a thermal annealing step, so as to obtain a stack of the substrates with a bond layer between the substrates, - the first substrate is thinned either before or after the bonding step, - the thermal annealing step takes place at a temperature below a temperature at which the bonding material transforms into silicon oxide, - after bonding, an electron beam is scanned across an area of the thinned substrate, the energy of the electron beam being sufficient for the beam to reach the bond layer and to transform the scanned bonding material of the bond layer into a silicon oxide, to thereby obtain a volume of the bond layer that is transformed into a silicon oxide, wherein said volume is a closed wall extending over the full thickness of the bond layer, and enclosing a volume of bonding material, thereby separating that volume of bonding material from the rest of the bond layer, - thereafter, a via opening is etched through the thinned substrate until reaching the bonding material at the interior of the closed wall, and a dielectric liner is formed on the sidewalls of the via opening, - thereafter, through the via opening, the bonding material is removed from the interior of the closed wall, selectively with respect to the silicon oxide, so as to create a cavity in the bond layer and expose a conductor in the second substrate, - thereafter, the cavity and the via opening are filled with an electrically conductive material, to thereby form an electrical connection that connects the conductor in the second substrate to a conductor present in the first substrate and/or to a contact present on top of the stack.