Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

135
Vistas
Can I generate a transaction on the server and send it to the client for payment

I have built a smart contract method to which I pass some sensitive data that needs to be stored on the blockchain and alter the state of the contract. I, the creator of the contract don't want to be the one paying for the fees of that transaction. I want the user on the browser to approve and pay for it.

However, I do not want to generate the transaction object on the browser as I want some of the data that will be passed to the contract to be hidden from the client. If I understand the web3 syntax correctly, in the code below, I'm doing just that

web3.eth.sendTransaction({
   from: walletAddressOfTheUserThatWillPayForTheTransaction,
   data: myContract.methods.changeState(..sensitive data...).encodeABI()
})

However I do not want the above to happen on the browser. In my head, the sequence of events should look like this (pseudocode):

// server
let transactionObject = {
   from: walletAddressOfTheUserThatWillPayForTheTransaction,
   data: myContract.methods.changeState(..sensitive data...).encodeABI()
}

sendToClient(encrypt(transactionObject)) 


// client
let encryptedTransactionObject = await fetchEncryptedTransactionObjectFromServer()

// this should open up Metamask for the user so that they may approve and finalise the transaction on the browser
web3.eth.sendTransaction(encryptedTransactionObject)

Is this possible ? Is there some other way of achieving this? Could you provide me with some hints about the actual syntax to be used?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

However, I do not want to generate the transaction object on the browser as I want some of the data that will be passed to the contract to be hidden from the client.

Then you should not be using public blockchains in the first place, as all data on public blockchains, by definition, is public. Anyone can read it.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda