A method for exchanging keys between a first user and a second user of a transaction blockchain, each user having a portfolio address available enabling him/her to transmit and receive transactions, wherein: - the first user generates a first ephemeral private key ( a) and a first corresponding ephemeral public key ( P a) by means of an asymmetric cryptosystem; - the first user forms and transmits a first transaction ( T A) the input of which refers to a first UTXO held at the first user's portfolio address and the output of which creates a second UTXO in the second user's portfolio, the output of the first transaction further comprising a recording script of the first ephemeral public key ( P a) in the blockchain; - the second user scans the blockchain and accesses the first transaction, after the latter has been confirmed by mining the block containing it; - the second user checks from the input of the first transaction that the latter has been actually transmitted by the first user's portfolio address and, if so, reads on the output of the first transaction the first ephemeral public key ( P a); - the second user generates a second ephemeral private key ( b) and a second corresponding ephemeral public key ( P b) by means of said asymmetric cryptosystem; - the second user forms and transmits a second transaction ( T B) the input of which refers to a third UTXO held at the second user's portfolio address and the output of which creates a fourth UTXO pointing to the first user's portfolio, the output of the second transaction further comprising a recording script of the second ephemeral public key in the blockchain; - the first user scans the blockchain and accesses the second transaction, after the latter has been confirmed by mining the block containing it; - the first user checks from the input of the second transaction that the latter has been actually transmitted by the second user's portfolio address and reads on the output of the second transaction the second ephemeral public key ( P b); - the first user computes the product of the first ephemeral private key ( a) with the second ephemeral public key ( P b) and the second user computes the product of the second ephemeral private key ( b) with the first ephemeral public key ( P a) to generate a common secrete key ( k ab). - the first user generates a first ephemeral private key ( a) and a first corresponding ephemeral public key ( P a) by means of an asymmetric cryptosystem; - the first user forms and transmits a first transaction ( T A) the input of which refers to a first UTXO held at the first user's portfolio address and the output of which creates a second UTXO in the second user's portfolio, the output of the first transaction further comprising a recording script of the first ephemeral public key ( P a) in the blockchain; - the second user scans the blockchain and accesses the first transaction, after the latter has been confirmed by mining the block containing it; - the second user checks from the input of the first transaction that the latter has been actually transmitted by the first user's portfolio address and, if so, reads on the output of the first transaction the first ephemeral public key ( P a); - the second user generates a second ephemeral private key ( b) and a second corresponding ephemeral public key ( P b) by means of said asymmetric cryptosystem; - the second user forms and transmits a second transaction ( T B) the input of which refers to a third UTXO held at the second user's portfolio address and the output of which creates a fourth UTXO pointing to the first user's portfolio, the output of the second transaction further comprising a recording script of the second ephemeral public key in the blockchain; - the first user scans the blockchain and accesses the second transaction, after the latter has been confirmed by mining the block containing it; - the first user checks from the input of the second transaction that the latter has been actually transmitted by the second user's portfolio address and reads on the output of the second transaction the second ephemeral public key ( P b); - the first user computes the product of the first ephemeral private key ( a) with the second ephemeral public key ( P b) and the second user computes the product of the second ephemeral private key ( b) with the first ephemeral public key ( P a) to generate a common secrete key ( k ab).