<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es"><title>Chemaclass - security</title><subtitle>Tech Lead compartiendo ideas prácticas sobre artesanía del software, TDD, liderazgo, Bitcoin e IA. Artículos, resúmenes de libros y charlas.</subtitle><link rel="self" type="application/atom+xml" href="https://chemaclass.com/es/tags/security/atom.xml"/><link rel="alternate" type="text/html" href="https://chemaclass.com"/><generator uri="https://www.getzola.org/">Zola</generator><updated>2024-12-11T00:00:00+00:00</updated><id>https://chemaclass.com/es/tags/security/atom.xml</id><entry xml:lang="es"><title>Los Cypherpunks</title><subtitle>Pioneros de la privacidad en la era digital</subtitle><category term="privacy" scheme="https://chemaclass.com/tags/privacy/" label="Privacy"/><category term="bitcoin" scheme="https://chemaclass.com/tags/bitcoin/" label="Bitcoin"/><category term="cryptography" scheme="https://chemaclass.com/tags/cryptography/" label="Cryptography"/><category term="security" scheme="https://chemaclass.com/tags/security/" label="Security"/><category term="philosophy" scheme="https://chemaclass.com/tags/philosophy/" label="Philosophy"/><published>2024-12-11T00:00:00+00:00</published><updated>2024-12-11T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/es/blog/the-cypherpunks/"/><id>https://chemaclass.com/es/blog/the-cypherpunks/</id><summary type="html">A principios de los 90, con el auge de internet, surgió un grupo llamado los Cypherpunks para defender la privacidad digital. Impulsaron el cifrado y la tecnología de privacidad, moldeando nuestro mundo digital con su visión e ideales.</summary><content type="html">&lt;p>A principios de los 90, con el auge de internet, surgió un grupo llamado los Cypherpunks para defender la privacidad digital. Impulsaron el cifrado y la privacidad, moldeando nuestro mundo digital con su visión.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="quienes-eran-los-cypherpunks">¿Quiénes eran los Cypherpunks?
&lt;a class="heading-anchor" href="#quienes-eran-los-cypherpunks" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>El término “Cypherpunk” combina “cipher” (una referencia al cifrado) con “punk”, reflejando el espíritu rebelde y anti-establishment del grupo.&lt;/p>
&lt;p>No eran una organización formal, sino una mezcla de visionarios, tecnólogos y activistas unidos por ideales comunes. El movimiento arrancó en 1992, cuando Eric Hughes, Timothy May y John Gilmore crearon la lista de correo cypherpunks. Algunas figuras clave:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Eric Hughes&lt;/strong> quien escribió “A Cypherpunk’s Manifesto”, estableciendo la base filosófica del movimiento.&lt;/li>
&lt;li>&lt;strong>Timothy C. May&lt;/strong> escribió “The Crypto Anarchist Manifesto”, que imaginaba una sociedad donde la criptografía podría fomentar un nuevo orden anárquico.&lt;/li>
&lt;li>&lt;strong>John Gilmore&lt;/strong>, cofundador de la Electronic Frontier Foundation (EFF), fue fundamental en la defensa temprana de la privacidad en internet.&lt;/li>
&lt;li>&lt;strong>Julian Assange&lt;/strong>, más tarde conocido por WikiLeaks, participó en estas discusiones.&lt;/li>
&lt;li>&lt;strong>Phil Zimmermann&lt;/strong> revolucionó la privacidad del email con su creación de PGP.&lt;/li>
&lt;li>&lt;strong>Jude Milhon&lt;/strong> (St. Jude), hacker y escritora, acuñó el término “cypherpunk” junto con Eric Hughes.&lt;/li>
&lt;li>&lt;strong>Nick Szabo&lt;/strong> trabajó en contratos y monedas digitales, y conceptualizó “bit gold” antes de Bitcoin.&lt;/li>
&lt;li>&lt;strong>Hal Finney&lt;/strong>, uno de los primeros desarrolladores de Bitcoin, trabajó en software criptográfico como PGP.&lt;/li>
&lt;li>&lt;strong>Adam Back&lt;/strong> creó Hashcash, que luego inspiró la prueba de trabajo de Bitcoin.&lt;/li>
&lt;li>&lt;strong>Wei Dai&lt;/strong> propuso “b-money”, una idea temprana para sistemas de dinero digital anónimo, que influyó en el desarrollo de Bitcoin.&lt;/li>
&lt;li>&lt;strong>Zooko Wilcox-O’Hearn&lt;/strong> trajo privacidad avanzada a las criptomonedas con su trabajo en Zcash.&lt;/li>
&lt;li>&lt;strong>David Chaum&lt;/strong>, conocido como el “padrino de los cypherpunks”, fue pionero del dinero digital con DigiCash (1989). Su trabajo sobre privacidad electrónica precedió e inspiró al movimiento.&lt;/li>
&lt;li>&lt;strong>Bram Cohen&lt;/strong> desarrolló BitTorrent, mostrando el ethos cypherpunk de descentralización en el intercambio de archivos.&lt;/li>
&lt;/ul>
&lt;p>Su trabajo se basó en la investigación criptográfica fundamental de &lt;strong>Whitfield Diffie&lt;/strong> y &lt;strong>Martin Hellman&lt;/strong>, quienes inventaron la criptografía de clave pública en 1976, haciendo posible la comunicación segura entre desconocidos.&lt;/p>
&lt;p>Se reunían online en la lista de correo cypherpunks. En su mejor momento, tenía unos 2000 suscriptores que intercambiaban más de 30 mensajes al día. Su lema: &lt;strong>“Cypherpunks write code.”&lt;/strong> No solo hablaban de privacidad. La construían.&lt;/p>
&lt;p>&lt;img src="/images/blog/2024-12-11/manifesto.jpg" alt="a cypherpunk’s manifesto" />&lt;/p>
&lt;h2 id="filosofia-y-objetivos">Filosofía y objetivos
&lt;a class="heading-anchor" href="#filosofia-y-objetivos" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>La filosofía central de los Cypherpunks se centraba en la privacidad, la libertad de expresión y el potencial de la criptografía para proteger estos derechos. Sus principios principales incluían:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>La privacidad como derecho fundamental&lt;/strong>: Creían que la privacidad era esencial para la libertad personal y que la comunicación digital debería ser privada.&lt;/li>
&lt;li>&lt;strong>Descentralización&lt;/strong>: Desconfiaban del control centralizado sobre la información, así que impulsaron sistemas descentralizados donde cada persona pudiera controlar sus propios datos.&lt;/li>
&lt;li>&lt;strong>La criptografía como herramienta&lt;/strong>: Veían el cifrado no solo como un medio para asegurar datos sino como una herramienta política contra la vigilancia y los regímenes opresivos.&lt;/li>
&lt;/ul>
&lt;h3 id="sus-objetivos-eran">Sus objetivos eran
&lt;a class="heading-anchor" href="#sus-objetivos-eran" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;ol>
&lt;li>Crear y promover herramientas para cifrado, anonimato y dinero digital.&lt;/li>
&lt;li>Educar al público sobre la importancia de la criptografía.&lt;/li>
&lt;li>Resistir los esfuerzos gubernamentales y corporativos para controlar o monitorear las comunicaciones digitales.&lt;/li>
&lt;/ol>
&lt;h2 id="impacto-actualmente">Impacto actualmente
&lt;a class="heading-anchor" href="#impacto-actualmente" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="desarrollo-de-tecnologias-clave">Desarrollo de tecnologías clave
&lt;a class="heading-anchor" href="#desarrollo-de-tecnologias-clave" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Los Cypherpunks construyeron herramientas, no solo teorías:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>PGP&lt;/strong> (1991): Cifrado de email para todos&lt;/li>
&lt;li>&lt;strong>Tor&lt;/strong> (2002): Navegación anónima a través de enrutamiento cebolla&lt;/li>
&lt;li>&lt;strong>BitTorrent&lt;/strong> (2001): Intercambio de archivos descentralizado&lt;/li>
&lt;li>&lt;strong>Bitcoin&lt;/strong> (2009): Dinero digital sin bancos&lt;/li>
&lt;li>&lt;strong>Protocolo Signal&lt;/strong>: El cifrado detrás de Signal, WhatsApp y otros mensajeros&lt;/li>
&lt;/ul>
&lt;p>Cuando envías un mensaje cifrado hoy, estás usando tecnología cypherpunk.&lt;/p>
&lt;h3 id="cambio-cultural">Cambio cultural
&lt;a class="heading-anchor" href="#cambio-cultural" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Cambiaron cómo la sociedad ve la privacidad. Antes de ellos, el cifrado era principalmente para gobiernos o expertos. Hoy, es una parte estándar de herramientas como aplicaciones de mensajería y navegadores web. Al promover el cifrado y el anonimato, hicieron de la privacidad una prioridad y animaron a las personas a tomar control de sus datos.&lt;/p>
&lt;h3 id="influencia-legal-y-politica-las-crypto-wars">Influencia legal y política: Las Crypto Wars
&lt;a class="heading-anchor" href="#influencia-legal-y-politica-las-crypto-wars" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Los años 90 vieron una batalla real entre los cypherpunks y los gobiernos, conocida como las “Crypto Wars”. EE.UU. clasificó el cifrado fuerte como arma y prohibió su exportación. Cuando Phil Zimmermann lanzó PGP, fue investigado por “exportar municiones” porque el software se extendió globalmente a través de internet.&lt;/p>
&lt;p>Los cypherpunks contraatacaron creativamente. Imprimieron el código fuente de PGP en libros, ya que los libros eran discurso protegido. Usaron camisetas con código de cifrado. Finalmente, ganaron. Las restricciones de exportación se relajaron en 2000. La mensajería cifrada de hoy existe gracias a esa lucha.&lt;/p>
&lt;h2 id="desafios-y-criticas">Desafíos y críticas
&lt;a class="heading-anchor" href="#desafios-y-criticas" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Los Cypherpunks enfrentan estas críticas principales:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Accesibilidad&lt;/strong>: Sus herramientas son demasiado complejas para mucha gente. Solo quienes tienen conocimientos técnicos pueden usarlas, dejando al resto fuera.&lt;/li>
&lt;li>&lt;strong>Riesgo de mal uso&lt;/strong>: Su tecnología de cifrado puede caer en malas manos. Los Cypherpunks creen que la privacidad es un derecho para todos, pero las autoridades temen que estas herramientas oculten actividades ilegales.&lt;/li>
&lt;/ul>
&lt;p>Es la eterna tensión entre privacidad y seguridad en el mundo digital.&lt;/p>
&lt;p>&lt;img src="/images/blog/2024-12-11/btc-p2p.webp" alt="bitcoin dinero entre pares" />&lt;/p>
&lt;h2 id="precursores-de-bitcoin">Precursores de Bitcoin
&lt;a class="heading-anchor" href="#precursores-de-bitcoin" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Bitcoin es el resultado más conocido de la filosofía cypherpunk. Encarna sus valores: descentralización, privacidad e independencia del control gubernamental sobre el dinero. El misterioso Satoshi Nakamoto lo compartió por primera vez en la lista de correo cypherpunks en 2008.&lt;/p>
&lt;p>Pero Bitcoin no surgió de la nada. Es el resultado de muchos intentos previos dentro de este grupo. Usa ideas de Hashcash (prueba de trabajo), b-money y bit gold, todas reflejando el sueño cypherpunk de una moneda que nadie controle.&lt;/p>
&lt;h3 id="digicash-ecash">DigiCash (eCash)
&lt;a class="heading-anchor" href="#digicash-ecash" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>David Chaum lo desarrolló a finales de los 80 y lo lanzó en 1990. Fue uno de los primeros intentos de pago electrónico. Usaba criptografía para garantizar privacidad, pero fracasó por problemas de adopción, centralización y el famoso problema del doble gasto.&lt;/p>
&lt;h3 id="b-money">B-Money
&lt;a class="heading-anchor" href="#b-money" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Wei Dai lo propuso en 1998 como un marco conceptual para dinero electrónico anónimo y distribuido. Quería resolver el doble gasto sin autoridad central, pero nunca se implementó. Sus ideas influyeron en el diseño de Bitcoin.&lt;/p>
&lt;h3 id="bit-gold">Bit Gold
&lt;a class="heading-anchor" href="#bit-gold" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Nick Szabo lo conceptualizó en 1998. Proponía una moneda con propiedades similares al oro usando prueba de trabajo criptográfica. Nunca se terminó, pero contribuyó al desarrollo de Bitcoin, especialmente su sistema de prueba de trabajo.&lt;/p>
&lt;h3 id="hashcash">Hashcash
&lt;a class="heading-anchor" href="#hashcash" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Adam Back lo introdujo en 1997. No era una moneda, sino un sistema para combatir el spam de email usando prueba de trabajo. Bitcoin adoptaría este concepto para la minería.&lt;/p>
&lt;blockquote>
&lt;p>Ninguno de estos proyectos logró crear una moneda digital funcional. Pero sentaron las bases teóricas de Bitcoin al abordar problemas clave: el doble gasto, la privacidad y la descentralización.&lt;/p>
&lt;/blockquote>
&lt;h2 id="legado-cypherpunk">Legado cypherpunk
&lt;a class="heading-anchor" href="#legado-cypherpunk" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Bitcoin ha cambiado cómo entendemos el dinero, la privacidad y la seguridad:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Control descentralizado&lt;/strong>: Bitcoin no es administrado por ningún banco o gobierno, lo que encaja perfectamente con el escepticismo cypherpunk hacia el poder centralizado.&lt;/li>
&lt;li>&lt;strong>Privacidad&lt;/strong>: Aunque no es completamente anónimo, las transacciones de Bitcoin usan pseudónimos, ofreciendo cierta protección contra la supervisión financiera.&lt;/li>
&lt;li>&lt;strong>Transacciones inmutables&lt;/strong>: Una vez que una transacción está en la blockchain, es casi inalterable, fomentando la confianza en las transacciones digitales.&lt;/li>
&lt;/ul>
&lt;p>Bitcoin dio vida a los ideales cypherpunk. Ha provocado debates globales sobre privacidad financiera, la naturaleza del dinero y el poder de la criptografía. Y sigue evolucionando con desarrollos como &lt;a rel="external" href="https://en.wikipedia.org/wiki/Lightning_Network">Lightning Network&lt;/a> para transacciones más rápidas y privadas, y &lt;a href="/es/blog/programmable-money/#p2tr-pay-to-taproot-taproot-up">Taproot&lt;/a> para mayor privacidad.&lt;/p>
&lt;h2 id="lo-que-dejaron-los-cypherpunks">Lo que dejaron los cypherpunks
&lt;a class="heading-anchor" href="#lo-que-dejaron-los-cypherpunks" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Los cypherpunks demostraron que un pequeño grupo de personas que escriben código pueden cambiar el mundo. Cada mensaje cifrado que envías, cada transacción de Bitcoin, cada navegación anónima: su legado.&lt;/p>
&lt;p>La privacidad no está muerta. Ellos se aseguraron de eso.&lt;/p>
&lt;hr />
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/9vM0oIEhMag"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;hr />
&lt;p>&lt;strong>Enlaces relacionados&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Aprende más: &lt;a href="/pgp">¿Qué es el cifrado PGP?&lt;/a> &lt;small>Un tutorial de 3 minutos para principiantes&lt;/small>&lt;/li>
&lt;li>Artículo de Wikipedia: &lt;a rel="external" href="https://en.wikipedia.org/wiki/Cypherpunk">wikipedia.org/Cypherpunk&lt;/a>&lt;/li>
&lt;/ul></content></entry><entry xml:lang="es"><title>Commits de Git Verificados</title><subtitle>Aumentando la confianza y seguridad en tu código</subtitle><category term="git" scheme="https://chemaclass.com/tags/git/" label="Git"/><category term="security" scheme="https://chemaclass.com/tags/security/" label="Security"/><category term="cryptography" scheme="https://chemaclass.com/tags/cryptography/" label="Cryptography"/><category term="open-source" scheme="https://chemaclass.com/tags/open-source/" label="Open Source"/><published>2024-11-17T00:00:00+00:00</published><updated>2024-11-17T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/es/blog/verified-git-commits/"/><id>https://chemaclass.com/es/blog/verified-git-commits/</id><summary type="html">Firma tus commits de Git con GPG para demostrar que son tuyos. Sin firmas, cualquiera puede falsificar commits con tu email. Se configura en 5 minutos.</summary><content type="html">&lt;p>En desarrollo de software, la confianza y la seguridad son clave. Una forma fácil de mejorar ambas: usar commits verificados.&lt;/p>
&lt;span id="continue-reading">&lt;/span>
&lt;p>Ya trabajes en open-source o en una empresa privada, los commits verificados aseguran que tus contribuciones son legítimas. Veamos qué son, por qué importan y cómo empezar a usarlos.&lt;/p>
&lt;h2 id="que-son-los-commits-verificados">¿Qué son los commits verificados?
&lt;a class="heading-anchor" href="#que-son-los-commits-verificados" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Un commit verificado es un commit de Git firmado digitalmente por su autor. La firma demuestra que el commit viene de quien dice haberlo hecho. Herramientas como &lt;a rel="external" href="https://gnupg.org/">GPG (GNU Privacy Guard)&lt;/a> permiten adjuntar esta firma.&lt;/p>
&lt;p>En plataformas como GitHub verás una insignia “Verified” junto a los commits firmados. Es una forma rápida de mostrar que el commit es auténtico.&lt;/p>
&lt;p>&lt;img src="/images/blog/2024-11-17/verified-commit-example.jpg" alt="blog-cover" />&lt;/p>
&lt;h2 id="por-que-son-importantes">¿Por qué son importantes?
&lt;a class="heading-anchor" href="#por-que-son-importantes" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Los commits firmados mantienen tus contribuciones auténticas y confiables. La firma criptográfica demuestra que los cambios vinieron de ti. En entornos colaborativos, donde la confianza y la responsabilidad importan mucho, esto es clave.&lt;/p>
&lt;p>Sin firmar, cualquiera puede falsificar un commit usando tu email. GitHub lo vincularía a tu perfil, pareciendo que hiciste los cambios aunque no fuera así. Nada bueno.&lt;/p>
&lt;p>&lt;img src="/images/blog/2024-11-17/impersonating-commit.jpg" alt="blog-cover" />&lt;/p>
&lt;p>&lt;img src="/images/blog/2024-11-17/impersonating-commit4.webp" alt="blog-cover" />&lt;/p>
&lt;p>Al firmar tus commits, demuestras que el trabajo es tuyo. Evitas la suplantación, generas confianza y mantienes todo transparente.&lt;/p>
&lt;blockquote>
&lt;p>&lt;small>Nota: Para esta demo, usé un email público de Linus Torvalds. Al hacer push, GitHub reconoció el email y lo vinculó a su perfil. Suplantación solo con fines de demo para mostrar los riesgos. Usa siempre tu propio email para commits.&lt;/small>&lt;/p>
&lt;/blockquote>
&lt;hr />
&lt;h2 id="como-empezar-con-commits-verificados">Cómo empezar con commits verificados
&lt;a class="heading-anchor" href="#como-empezar-con-commits-verificados" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="configura-una-clave-gpg">Configura una clave GPG
&lt;a class="heading-anchor" href="#configura-una-clave-gpg" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Primero necesitas una clave GPG. Así se hace:&lt;/p>
&lt;p>Genera una clave GPG:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">gpg&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-full-generate-key&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Encuentra tu ID de clave:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">gpg&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-list-secret-keys&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-keyid-format=long&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Dile a Git que use tu clave:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">git&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> config&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-global&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> user.signingkey&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">tu-id-de-clav&lt;/span>&lt;span>e&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Haz que firmar commits sea el valor por defecto:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">git&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> config&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-global&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> commit.gpgsign&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> true&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;h3 id="anade-tu-clave-a-github-gitlab">Añade tu clave a &lt;a rel="external" href="https://github.com/settings/keys">GitHub&lt;/a>/&lt;a rel="external" href="https://docs.gitlab.com/user/project/repository/signed_commits/gpg/">GitLab&lt;/a>
&lt;a class="heading-anchor" href="#anade-tu-clave-a-github-gitlab" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Exporta tu clave pública:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">gpg&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-armor&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-export&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">tu-id-de-clav&lt;/span>&lt;span>e&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Navega a “Settings &amp;gt; SSH and GPG keys,” y pega tu clave.&lt;/p>
&lt;p>&lt;img src="/images/blog/2024-11-17/gpg-keys.jpg" alt="blog-cover" />&lt;/p>
&lt;h3 id="empieza-a-firmar-commits">Empieza a firmar commits
&lt;a class="heading-anchor" href="#empieza-a-firmar-commits" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>A partir de ahora, Git firmará tus commits automáticamente.&lt;/p>
&lt;p>Si quieres firmar un commit a mano, usa la bandera &lt;code>-S&lt;/code>:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">git&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> commit&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">S&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">m&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> &amp;quot;&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">Tu mensaje de commit&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);">&amp;quot;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Puedes &lt;strong>verificar&lt;/strong> la firma del commit con:&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">git&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> log&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-show-signature&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>También puedes hacer clic en la insignia “Verified” en GitHub.&lt;/p>
&lt;p>&lt;img src="/images/blog/2024-11-17/gpg-verify.jpg" alt="blog-cover" />&lt;/p>
&lt;p>Los commits verificados parecen un paso pequeño, pero hacen tu código más confiable. Una capa extra de protección fácil de añadir. Pruébalo.&lt;/p>
&lt;hr />
&lt;h3 id="extra-configuracion-completa-en-espanol">Extra: Configuración completa en español
&lt;a class="heading-anchor" href="#extra-configuracion-completa-en-espanol" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/0DzQBu7U2f4"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;hr />
&lt;p>&lt;strong>Enlaces relacionados&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>Aprende más: &lt;a href="/pgp">¿Qué es el cifrado PGP?&lt;/a> &lt;small>Un tutorial de 3 minutos para principiantes&lt;/small>&lt;/li>
&lt;/ul></content></entry><entry xml:lang="es"><title>Pretty Good Privacy</title><subtitle>Cómo PGP protege tu comunicación digital</subtitle><category term="security" scheme="https://chemaclass.com/tags/security/" label="Security"/><category term="privacy" scheme="https://chemaclass.com/tags/privacy/" label="Privacy"/><category term="cryptography" scheme="https://chemaclass.com/tags/cryptography/" label="Cryptography"/><published>2024-07-13T00:00:00+00:00</published><updated>2024-07-13T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/es/blog/pretty-good-privacy/"/><id>https://chemaclass.com/es/blog/pretty-good-privacy/</id><summary type="html">PGP te permite cifrar mensajes para que solo el destinatario pueda leerlos, y firmarlos para demostrar que son tuyos. Creado en 1991 por Phil Zimmermann.</summary><content type="html">&lt;p>PGP (&lt;em>Pretty Good Privacy&lt;/em>) es un programa de cifrado para proteger tu privacidad y autenticar comunicaciones. Sirve para firmar, cifrar y descifrar textos, correos, archivos, directorios y particiones de disco.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="historia">Historia
&lt;a class="heading-anchor" href="#historia" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>&lt;a rel="external" href="https://en.wikipedia.org/wiki/Phil_Zimmermann">Phil Zimmermann&lt;/a> creó PGP porque le preocupaba la falta de privacidad en las comunicaciones digitales. Quería dar a la gente herramientas de cifrado potentes. En 1991 lanzó PGP gratis, abriendo una nueva era en la seguridad digital.&lt;/p>
&lt;h3 id="desafios-legales">Desafíos legales
&lt;a class="heading-anchor" href="#desafios-legales" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>A principios de los 90, el cifrado fuerte estaba clasificado como arma según la ley de exportación de EE.UU. Cuando PGP se extendió por internet, Zimmermann fue investigado por “exportar municiones”.&lt;/p>
&lt;p>Su defensa fue ingeniosa: publicó el código fuente de PGP en un libro. Los libros son libertad de expresión protegida. El caso se archivó en 1996 y las restricciones de exportación se relajaron en 2000.&lt;/p>
&lt;hr />
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/1-MPcUHhXoc"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;h2 id="caracteristicas-principales">Características principales
&lt;a class="heading-anchor" href="#caracteristicas-principales" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>Cifra y descifra datos para comunicación segura&lt;/li>
&lt;li>Verifica la identidad de quien envía y recibe&lt;/li>
&lt;li>Genera pares de claves pública/privada para intercambio seguro&lt;/li>
&lt;li>Soporta varios algoritmos de cifrado y funciones hash&lt;/li>
&lt;/ul>
&lt;p>Hoy PGP sigue vivo como &lt;strong>OpenPGP&lt;/strong> (el estándar) y &lt;strong>GPG&lt;/strong> (GNU Privacy Guard, la implementación libre). Cuando verificas una descarga de software o firmas un commit de git, probablemente estás usando GPG.&lt;/p>
&lt;h2 id="como-funciona">Cómo funciona
&lt;a class="heading-anchor" href="#como-funciona" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>PGP combina &lt;a rel="external" href="https://en.wikipedia.org/wiki/Public-key_cryptography">criptografía de clave pública&lt;/a> y &lt;a rel="external" href="https://en.wikipedia.org/wiki/Symmetric-key_algorithm">criptografía de clave simétrica&lt;/a>. Genera un par de claves: una pública que compartes y una privada que guardas en secreto. Los datos se cifran con la clave pública y solo la privada puede descifrarlos.&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>Cifrado simétrico&lt;/strong>: PGP genera una clave de sesión única para cifrar el mensaje. Es rápido y eficiente, pero necesita que ambas partes compartan la clave de forma segura.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Cifrado asimétrico&lt;/strong>: Resuelve el problema del intercambio de claves. Cada usuario tiene su par de claves. La clave de sesión se cifra con la clave pública del destinatario, y solo su clave privada puede descifrarla.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Firmas digitales&lt;/strong>: El remitente firma el mensaje con su clave privada. El destinatario verifica la firma con la clave pública del remitente, confirmando quién lo envió y que el mensaje no se ha alterado.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/Lq-yKJFHJpk"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;hr />
&lt;h2 id="mi-clave-publica">Mi clave pública
&lt;a class="heading-anchor" href="#mi-clave-publica" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="huella-digital">Huella digital
&lt;a class="heading-anchor" href="#huella-digital" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="plain">&lt;span class="giallo-l">&lt;span>56D5 D60B 0934 0999 199C 3750 E51B 5BF4 5F85 D160&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;h3 id="importar-directamente">Importar directamente
&lt;a class="heading-anchor" href="#importar-directamente" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="shellscript">&lt;span class="giallo-l">&lt;span style="color: light-dark(#6F42C1, #B392F0);">curl&lt;/span>&lt;span style="color: light-dark(#032F62, #9ECBFF);"> https://chemaclass.com/pgp.asc&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> |&lt;/span>&lt;span style="color: light-dark(#6F42C1, #B392F0);"> gpg&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> -&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">-import&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;h3 id="descargar-el-archivo-asc">Descargar el archivo .asc
&lt;a class="heading-anchor" href="#descargar-el-archivo-asc" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>&lt;a href="/pgp.asc" id="download-link">Descargar clave PGP pública&lt;/a>&lt;/p></content></entry><entry xml:lang="es"><title>Dinero Programable</title><subtitle>El poder del Script de Bitcoin</subtitle><category term="bitcoin" scheme="https://chemaclass.com/tags/bitcoin/" label="Bitcoin"/><category term="software" scheme="https://chemaclass.com/tags/software/" label="Software"/><category term="cryptography" scheme="https://chemaclass.com/tags/cryptography/" label="Cryptography"/><category term="security" scheme="https://chemaclass.com/tags/security/" label="Security"/><published>2024-07-06T00:00:00+00:00</published><updated>2024-07-06T00:00:00+00:00</updated><author><name>
Chemaclass</name></author><link rel="alternate" type="text/html" href="https://chemaclass.com/es/blog/programmable-money/"/><id>https://chemaclass.com/es/blog/programmable-money/</id><summary type="html">Bitcoin se conoce como dinero programable porque permite ejecutar transacciones con condiciones mediante su lenguaje de scripting.</summary><content type="html">&lt;p>A Bitcoin se le llama “dinero programable” porque permite ejecutar transacciones con condiciones mediante su lenguaje de scripting.&lt;/p>
&lt;span id="continue-reading">&lt;/span>&lt;h2 id="que-es-el-dinero-programable">Qué es el dinero programable
&lt;a class="heading-anchor" href="#que-es-el-dinero-programable" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Dinero programable significa poder meter lógica y condiciones dentro de las transacciones financieras. Las transacciones se ejecutan solas siguiendo reglas predefinidas, sin intermediarios ni intervención manual. El dinero deja de ser algo estático y se convierte en una herramienta capaz de ejecutar acuerdos y automatizar operaciones.&lt;/p>
&lt;h2 id="el-lenguaje-script">El lenguaje Script
&lt;a class="heading-anchor" href="#el-lenguaje-script" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>La programabilidad de Bitcoin viene de su lenguaje incorporado: &lt;a rel="external" href="https://en.bitcoin.it/wiki/Script">&lt;strong>Script&lt;/strong>&lt;/a>. Es un lenguaje basado en pila, parecido a Forth, creado específicamente para transacciones de Bitcoin.&lt;/p>
&lt;p>Soporta multi-firma, transferencias bloqueadas por tiempo y otras transferencias condicionales. Es intencionalmente limitado: no es Turing-completo y no tiene bucles.&lt;/p>
&lt;p>Este video muestra ejemplos de los scripts de bloqueo/desbloqueo más comunes.&lt;/p>
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/6Fa04MnURhw"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;h2 id="caracteristicas-clave-del-script-de-bitcoin">Características clave del Script de Bitcoin
&lt;a class="heading-anchor" href="#caracteristicas-clave-del-script-de-bitcoin" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;h3 id="ejecucion-basada-en-pila">Ejecución basada en pila
&lt;a class="heading-anchor" href="#ejecucion-basada-en-pila" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Script funciona con un modelo de pila: los comandos y datos se apilan y se procesan en orden Last-In-First-Out (&lt;a rel="external" href="https://en.wikipedia.org/wiki/Stack_(abstract_data_type)">LIFO&lt;/a>).&lt;/p>
&lt;h3 id="gasto-condicional">Gasto condicional
&lt;a class="heading-anchor" href="#gasto-condicional" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Una transacción que solo se puede gastar si se cumplen ciertos criterios o se proporcionan datos específicos. Sirve para:&lt;/p>
&lt;ul>
&lt;li>servicios de custodia&lt;/li>
&lt;li>intercambios atómicos&lt;/li>
&lt;li>otros arreglos financieros&lt;/li>
&lt;/ul>
&lt;h3 id="multifirma">Multifirma
&lt;a class="heading-anchor" href="#multifirma" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Puedes configurar transacciones que requieran varias firmas de diferentes claves privadas. Útil para:&lt;/p>
&lt;ul>
&lt;li>cuentas conjuntas&lt;/li>
&lt;li>fondos corporativos&lt;/li>
&lt;li>mayor seguridad (nadie puede gastar los fondos por su cuenta)&lt;/li>
&lt;/ul>
&lt;h3 id="bloqueo-temporal">Bloqueo temporal
&lt;a class="heading-anchor" href="#bloqueo-temporal" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>Las transacciones pueden tener condiciones de tiempo: no se pueden gastar hasta cierta fecha o altura de bloque. Útil para:&lt;/p>
&lt;ul>
&lt;li>pagos diferidos&lt;/li>
&lt;li>contratos inteligentes&lt;/li>
&lt;li>evitar gastos prematuros (ej: &lt;a rel="external" href="https://en.bitcoin.it/wiki/Lightning_Network">Lightning Network&lt;/a>)&lt;/li>
&lt;/ul>
&lt;h3 id="codigos-de-operacion">Códigos de operación
&lt;a class="heading-anchor" href="#codigos-de-operacion" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>El Script de Bitcoin usa &lt;a rel="external" href="https://en.bitcoin.it/wiki/Script#Opcodes">OP_Codes&lt;/a> para realizar operaciones específicas. Algunos ejemplos:&lt;/p>
&lt;ul>
&lt;li>&lt;code>OP_DUP&lt;/code>: &lt;small>Duplica el elemento superior de la pila.&lt;/small>&lt;/li>
&lt;li>&lt;code>OP_HASH160&lt;/code>: &lt;small>Hashea el elemento superior de la pila dos veces (SHA-256 seguido de RIPEMD-160).&lt;/small>&lt;/li>
&lt;li>&lt;code>OP_EQUALVERIFY&lt;/code>: &lt;small>Verifica que los dos elementos superiores son iguales y los elimina.&lt;/small>&lt;/li>
&lt;li>&lt;code>OP_CHECKSIG&lt;/code>: &lt;small>Verifica una firma contra una clave pública.&lt;/small>&lt;/li>
&lt;li>&lt;a rel="external" href="https://en.bitcoin.it/wiki/OP_RETURN">&lt;code>OP_RETURN&lt;/code>&lt;/a>: &lt;small>Marca la salida de la transacción como inválida, a menudo usado para almacenar datos.&lt;/small>&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h2 id="tipos-comunes-de-direcciones-bitcoin">Tipos comunes de direcciones Bitcoin
&lt;a class="heading-anchor" href="#tipos-comunes-de-direcciones-bitcoin" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;p>Cada tipo de dirección corresponde a una forma distinta de hacer scripts. Veamos ejemplos para cada tipo principal.&lt;/p>
&lt;ul>
&lt;li>&lt;strong>P2PK&lt;/strong>: Las primeras transacciones legacy usando claves públicas completas directamente.&lt;/li>
&lt;li>&lt;strong>P2PKH&lt;/strong>: Comienza con &lt;code>1&lt;/code>. Transacciones &lt;strong>Legacy&lt;/strong> usando hashes de claves públicas.&lt;/li>
&lt;li>&lt;strong>P2SH&lt;/strong>: Comienza con &lt;code>3&lt;/code>. &lt;strong>Legacy&lt;/strong>, encapsula scripts complejos como multisig.&lt;/li>
&lt;li>&lt;strong>P2MS&lt;/strong>: Típicamente es un tipo de dirección P2SH o P2WSH.&lt;/li>
&lt;li>&lt;strong>P2WPKH&lt;/strong>: Comienza con &lt;code>bc1&lt;/code>. &lt;strong>SegWit&lt;/strong> nativo, transacciones más eficientes.&lt;/li>
&lt;li>&lt;strong>P2WSH&lt;/strong>: Comienza con &lt;code>bc1&lt;/code>. &lt;strong>SegWit&lt;/strong> para scripts complejos.&lt;/li>
&lt;li>&lt;strong>P2TR&lt;/strong>: Comienza con &lt;code>bc1p&lt;/code>. Direcciones &lt;strong>Taproot&lt;/strong> SegWit, mejorando privacidad y eficiencia para transacciones complejas.&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;p>Usar SegWit nativo (P2WPKH y P2WSH) es preferible cuando es posible, ya que maximiza los beneficios de la actualización SegWit, pero P2SH-SegWit puede ser útil para compatibilidad con sistemas más antiguos.&lt;/p>
&lt;/blockquote>
&lt;h3 id="p2pk-pay-to-pubkey-direccion-legacy-antigua-arriba">P2PK (Pay-to-PubKey) - Dirección Legacy antigua &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#tipos-comunes-de-direcciones-bitcoin">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2pk-pay-to-pubkey-direccion-legacy-antigua-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Comienza con "1" (ej., 1A1zP1eP5QGefi2DMPTf...v7DivfNa)
&lt;/div>
&lt;p>Antes de P2PKH y P2SH, las direcciones de Bitcoin eran más limitadas:&lt;/p>
&lt;ul>
&lt;li>Empiezan con 1 pero sin hashear la clave pública.&lt;/li>
&lt;li>Poco usadas hoy por falta de privacidad y eficiencia.&lt;/li>
&lt;li>Formato &lt;strong>obsoleto&lt;/strong> en favor de P2PKH como mínimo.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2pkh-pay-to-pubkey-hash-direccion-legacy-arriba">P2PKH (Pay-to-PubKey-Hash) - Dirección Legacy &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#tipos-comunes-de-direcciones-bitcoin">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2pkh-pay-to-pubkey-hash-direccion-legacy-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Comienza con "1" (ej., 1A1zP1eP5QGefi2DMPTf...v7DivfNa)
&lt;/div>
&lt;p>Un script P2PKH típico consiste en dos partes principales:&lt;/p>
&lt;ol>
&lt;li>&lt;strong>ScriptPubKey&lt;/strong>: El script de bloqueo (también conocido como script de salida) que especifica cómo pueden gastarse los fondos.&lt;/li>
&lt;li>&lt;strong>ScriptSig&lt;/strong>: El script de desbloqueo (también conocido como script de entrada) que proporciona los datos necesarios para desbloquear los fondos.&lt;/li>
&lt;/ol>
&lt;h3 id="scriptpubkey-script-de-bloqueo">ScriptPubKey (Script de Bloqueo)
&lt;a class="heading-anchor" href="#scriptpubkey-script-de-bloqueo" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_DUP&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_HASH160&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubKHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_EQUALVERIFY&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKSIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_DUP&lt;/code>: Duplica el elemento superior de la pila (la clave pública).&lt;/li>
&lt;li>&lt;code>OP_HASH160&lt;/code>: Hashea la clave pública con SHA-256 seguido de RIPEMD-160.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubKHash&amp;gt;&lt;/code>: La clave pública hasheada (un valor de 20 bytes).&lt;/li>
&lt;li>&lt;code>OP_EQUALVERIFY&lt;/code>: Verifica si la clave pública hasheada coincide con el hash en el script.&lt;/li>
&lt;li>&lt;code>OP_CHECKSIG&lt;/code>: Verifica la firma proporcionada contra la clave pública.&lt;/li>
&lt;/ul>
&lt;h3 id="scriptsig-script-de-desbloqueo">ScriptSig (Script de Desbloqueo)
&lt;a class="heading-anchor" href="#scriptsig-script-de-desbloqueo" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: La firma digital generada por la clave privada.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK&amp;gt;&lt;/code>: La clave pública correspondiente a la dirección.&lt;/li>
&lt;/ul>
&lt;h3 id="flujo-de-ejecucion">Flujo de Ejecución
&lt;a class="heading-anchor" href="#flujo-de-ejecucion" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;ol>
&lt;li>El &lt;code>ScriptSig&lt;/code> (script de desbloqueo) se empuja a la pila.&lt;/li>
&lt;li>El &lt;code>ScriptPubKey&lt;/code> (script de bloqueo) se ejecuta.&lt;/li>
&lt;/ol>
&lt;p>&lt;img src="https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc3_0703.png" alt="ejecucion del script p2pkh paso 1" />
&lt;img src="https://raw.githubusercontent.com/bitcoinbook/bitcoinbook/develop/images/mbc3_0704.png" alt="ejecucion del script p2pkh paso 2" />&lt;/p>
&lt;hr />
&lt;h3 id="p2sh-pay-to-script-hash-arriba">P2SH (Pay-to-Script-Hash) &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#tipos-comunes-de-direcciones-bitcoin">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2sh-pay-to-script-hash-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Comienza con "3" (ej., 3J2BtwzN2GEr6FCP.....81T2eiX8PVHh)
&lt;/div>
&lt;p>Los scripts P2SH se usan para scripts más complejos. La característica principal es que la dirección misma codifica un hash de un script, que se usará en la transacción.&lt;/p>
&lt;h3 id="scriptpubkey-script-de-bloqueo-1">ScriptPubKey (Script de Bloqueo)
&lt;a class="heading-anchor" href="#scriptpubkey-script-de-bloqueo-1" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_HASH160&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">ScriptHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_EQUAL&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_HASH160&lt;/code>: Hashea el script con SHA-256 seguido de RIPEMD-160.&lt;/li>
&lt;li>&lt;code>&amp;lt;ScriptHash&amp;gt;&lt;/code>: El script hasheado (un valor de 20 bytes).&lt;/li>
&lt;li>&lt;code>OP_EQUAL&lt;/code>: Verifica si el hash coincide con el hash del script proporcionado.&lt;/li>
&lt;/ul>
&lt;h3 id="scriptsig-script-de-desbloqueo-1">ScriptSig (Script de Desbloqueo)
&lt;a class="heading-anchor" href="#scriptsig-script-de-desbloqueo-1" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">ScriptSig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: La firma digital.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK&amp;gt;&lt;/code>: La clave pública.&lt;/li>
&lt;li>&lt;code>&amp;lt;ScriptSig&amp;gt;&lt;/code>: El script real que coincide con el hash del script, que será ejecutado por la red Bitcoin.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2ms-pay-to-multisig-arriba">P2MS (Pay-to-Multisig) &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#tipos-comunes-de-direcciones-bitcoin">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2ms-pay-to-multisig-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;h3 id="formato-del-script">Formato del Script
&lt;a class="heading-anchor" href="#formato-del-script" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_M&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">M&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubKN&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_N&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKMULTISIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_M&lt;/code>: El número mínimo de firmas requeridas.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK1&amp;gt;, &amp;lt;PubK2&amp;gt;, ..., &amp;lt;PubKN&amp;gt;&lt;/code>: Las claves públicas involucradas en el esquema multifirma.&lt;/li>
&lt;li>&lt;code>OP_N&lt;/code>: El número total de claves públicas proporcionadas.&lt;/li>
&lt;li>&lt;code>OP_CHECKMULTISIG&lt;/code>: El opcode que verifica las firmas contra las claves públicas proporcionadas.&lt;/li>
&lt;/ul>
&lt;h3 id="scriptpubkey-script-de-bloqueo-2">ScriptPubKey (Script de Bloqueo)
&lt;a class="heading-anchor" href="#scriptpubkey-script-de-bloqueo-2" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK3&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_3&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKMULTISIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>Este script significa que se requieren 2 de 3 claves públicas proporcionadas para firmar la transacción para que sea válida.&lt;/p>
&lt;h3 id="scriptsig-script-de-desbloqueo-2">ScriptSig (Script de Desbloqueo)
&lt;a class="heading-anchor" href="#scriptsig-script-de-desbloqueo-2" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sigN&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">SerializedScript&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig1&amp;gt;, &amp;lt;sig2&amp;gt;, ..., &amp;lt;sigN&amp;gt;&lt;/code>: Las claves públicas.&lt;/li>
&lt;li>&lt;code>&amp;lt;SerializedScript&amp;gt;&lt;/code>: El script serializado (lo mismo que el script de bloqueo pero sin el &lt;code>OP_M&lt;/code> y &lt;code>OP_N&lt;/code>).&lt;/li>
&lt;/ul>
&lt;div class="status warning-orange">
&lt;b>NOTA&lt;/b>: Hay una rareza en la ejecución de CHECKMULTISIG.
&lt;small>&lt;a href="#hay-una-rareza-en-la-ejecución-de-checkmultisig-arriba">Ver nota al final.&lt;/a>&lt;/small>
&lt;/div>
&lt;hr />
&lt;h3 id="p2wpkh-pay-to-witness-public-key-hash-segwit-arriba">P2WPKH (Pay-to-Witness-Public-Key-Hash) - Segwit &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#tipos-comunes-de-direcciones-bitcoin">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2wpkh-pay-to-witness-public-key-hash-segwit-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Comienza con "bc1q" (ej., bc1qf0r2m0ck4psv6yrk9w.....kw8v5rj7ph3)
&lt;/div>
&lt;p>P2WPKH es una dirección Segregated Witness (SegWit) con un formato de scripting distinto. Simplifica las transacciones: menos datos y menos comisiones que los formatos legacy.&lt;/p>
&lt;h3 id="scriptpubkey-script-de-bloqueo-3">ScriptPubKey (Script de Bloqueo)
&lt;a class="heading-anchor" href="#scriptpubkey-script-de-bloqueo-3" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_0&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_PUSHBYTES_20&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubKHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_0&lt;/code>: Un solo byte (0x00) indicando la versión del script.&lt;/li>
&lt;li>&lt;code>OP_PUSHBYTES_20&lt;/code>: Empuja 20 bytes (el hash de la clave pública) a la pila.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubKHash&amp;gt;&lt;/code>: El hash de 20 bytes de la clave pública.&lt;/li>
&lt;/ul>
&lt;h3 id="datos-del-testigo">Datos del Testigo
&lt;a class="heading-anchor" href="#datos-del-testigo" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>En P2WPKH no hace falta un script de desbloqueo tradicional. La información de desbloqueo va como parte de los datos del testigo en el formato SegWit.&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: Firma digital para la transacción.&lt;/li>
&lt;li>&lt;code>&amp;lt;PubK&amp;gt;&lt;/code>: Clave pública usada para generar el hash de la clave pública.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2wsh-pay-to-witness-script-hash-segwit-arriba">P2WSH (Pay-to-Witness-Script-Hash) - Segwit &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#tipos-comunes-de-direcciones-bitcoin">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2wsh-pay-to-witness-script-hash-segwit-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Comienza con bc1q (ej.: bc1q4a3h5sdg4cfkhftgd24tj9g2sg...yj57jmfckhkrw5gslr9g59)
&lt;/div>
&lt;h3 id="scriptpubkey-script-de-bloqueo-4">ScriptPubKey (Script de Bloqueo)
&lt;a class="heading-anchor" href="#scriptpubkey-script-de-bloqueo-4" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_0&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_PUSHBYTES_32&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">ScriptHash&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_0&lt;/code>: Indica una versión de testigo 0 (SegWit).&lt;/li>
&lt;li>&lt;code>OP_PUSHBYTES_32&lt;/code>: Empuja los siguientes 32 bytes (el hash del script) a la pila.&lt;/li>
&lt;li>&lt;code>&amp;lt;ScriptHash&amp;gt;&lt;/code>: Hash de 32 bytes del script de redención.&lt;/li>
&lt;/ul>
&lt;h3 id="datos-del-testigo-1">Datos del Testigo
&lt;a class="heading-anchor" href="#datos-del-testigo-1" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> ...&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">RedeemScript&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig1&amp;gt;, &amp;lt;sig2&amp;gt;&lt;/code>: Firmas requeridas para desbloquear la transacción.&lt;/li>
&lt;li>&lt;code>&amp;lt;RedeemScript&amp;gt;&lt;/code>: El script real que coincide con el hash del script. Este script será ejecutado como parte de los datos del testigo.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;h3 id="p2tr-pay-to-taproot-taproot-arriba">P2TR (Pay-to-Taproot) - Taproot &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#tipos-comunes-de-direcciones-bitcoin">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#p2tr-pay-to-taproot-taproot-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;div class="status info">
Comienza con bc1p (ej.: bc1pl9dfv7kvj4hj9s3a8l.....gjstmrpjl09g8ks3ukds70q4r2j5h)
&lt;/div>
&lt;p>Taproot combina firmas &lt;a rel="external" href="https://en.bitcoin.it/wiki/Schnorr">Schnorr&lt;/a> con &lt;a rel="external" href="https://en.bitcoin.it/wiki/BIP_0114#Merkelized_Abstract_Syntax_Tree">MAST&lt;/a>. Permite condiciones de gasto privadas y eficientes. Las transacciones complejas &lt;strong>&lt;em>parecen estandar&lt;/em>&lt;/strong> a menos que se revelen las condiciones.&lt;/p>
&lt;h3 id="scriptpubkey-script-de-bloqueo-5">ScriptPubKey (Script de Bloqueo)
&lt;a class="heading-anchor" href="#scriptpubkey-script-de-bloqueo-5" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">x&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">-&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">only&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> PubK&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>OP_1&lt;/code>: Indica una versión de testigo 1 (Taproot).&lt;/li>
&lt;li>&lt;code>&amp;lt;x-only PubK&amp;gt;&lt;/code>: Una clave pública Schnorr de 32 bytes (sin la coordenada y).&lt;/li>
&lt;/ul>
&lt;h3 id="datos-del-testigo-2">Datos del Testigo
&lt;a class="heading-anchor" href="#datos-del-testigo-2" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;ul>
&lt;li>&lt;code>&amp;lt;sig&amp;gt;&lt;/code>: Una firma Schnorr probando posesión de la clave privada correspondiente a la pubkey x-only.&lt;/li>
&lt;/ul>
&lt;hr />
&lt;div style="position:relative;aspect-ratio:16/9;width:100%;">
&lt;iframe
src="https://www.youtube-nocookie.com/embed/yU3Sr07Qnxg"
title="YouTube video"
width="560"
height="315"
loading="lazy"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
referrerpolicy="strict-origin-when-cross-origin"
style="position:absolute;inset:0;width:100%;height:100%;border:0;"
allowfullscreen>
&lt;/iframe>
&lt;/div>
&lt;hr />
&lt;h3 id="hay-una-rareza-en-la-ejecucion-de-checkmultisig-arriba">*Hay una rareza en la ejecución de CHECKMULTISIG &lt;small>&lt;a href="https://chemaclass.com/es/blog/programmable-money/#scriptsig-script-de-desbloqueo-2">arriba&lt;/a>&lt;/small>
&lt;a class="heading-anchor" href="#hay-una-rareza-en-la-ejecucion-de-checkmultisig-arriba" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h3>
&lt;p>&lt;code>OP_CHECKMULTISIG&lt;/code> saca un elemento de más de la pila. Ese elemento extra se ignora al verificar firmas, así que no afecta directamente. Pero tiene que estar porque si intenta sacar de una pila vacía, el script falla.&lt;/p>
&lt;pre class="giallo" style="color-scheme: light dark; color: light-dark(#24292E, #E1E4E8); background-color: light-dark(#FFFFFF, #24292E);">&lt;code data-lang="php">&lt;span class="giallo-l">&lt;span style="color: light-dark(#005CC5, #79B8FF);">OP_0&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">sig3&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> 2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK1&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK2&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);"> &amp;lt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);">PubK3&lt;/span>&lt;span style="color: light-dark(#D73A49, #F97583);">&amp;gt;&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> 3&lt;/span>&lt;span style="color: light-dark(#005CC5, #79B8FF);"> OP_CHECKMULTISIG&lt;/span>&lt;/span>&lt;/code>&lt;/pre>
&lt;p>El script de entrada en este multisig no es &lt;code>&amp;lt;sig2&amp;gt; &amp;lt;sig3&amp;gt;&lt;/code> sino &lt;code>OP_0 &amp;lt;sig2&amp;gt; &amp;lt;sig3&amp;gt;&lt;/code>.&lt;/p>
&lt;p>Al principio se usaba &lt;code>OP_0&lt;/code> por convención. Luego se convirtió en regla de relay y finalmente en regla de consenso (&lt;a rel="external" href="https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki">BIP147&lt;/a>).&lt;/p>
&lt;p>Puede que el desarrollador original lo pusiera pensando en añadir una función de mapa en un soft fork futuro (por rendimiento). Esa función nunca se implementó, y BIP147 en 2017 lo hace imposible ya.&lt;/p>
&lt;p>Solo el creador de Bitcoin podría decir si fue un bug o un plan. Si ves un script multisig, espera encontrar un &lt;code>OP_0&lt;/code> extra al principio. Es un parche para esta rareza del consenso.&lt;/p>
&lt;hr />
&lt;h2 id="para-seguir-aprendiendo">Para seguir aprendiendo
&lt;a class="heading-anchor" href="#para-seguir-aprendiendo" title="Copy link" aria-label="Link to this section">#&lt;/a>
&lt;/h2>
&lt;ul>
&lt;li>Documentación oficial de &lt;a rel="external" href="https://en.bitcoin.it/wiki/Script">Script&lt;/a> en el Bitcoin Wiki.&lt;/li>
&lt;li>&lt;a rel="external" href="https://siminchen.github.io/bitcoinIDE/build/editor.html">Bitcoin IDE&lt;/a>: emulador visual de Script online, genial para aprender.&lt;/li>
&lt;li>&lt;a rel="external" href="https://coins.github.io/bitcoin-scripts/script-editor/">Script Editor&lt;/a>: investigación sobre escalabilidad y usabilidad de Bitcoin.&lt;/li>
&lt;li>&lt;a rel="external" href="https://bitcoin.sipa.be/miniscript/">Miniscript&lt;/a>: lenguaje para escribir Scripts de Bitcoin de forma estructurada, con análisis, composición y firma genérica.&lt;/li>
&lt;/ul></content></entry></feed>