<p>Before you take on trying to use Script I recommend doing whatever you can with an existing API. I've used Blockchain.info's which has worked well. </p>

<p>Here's another API package for Java that might work for you <a href="https://github.com/blockchain/api-v1-client-java" rel="nofollow noreferrer">https://github.com/blockchain/api-v1-client-java</a></p>

<p>Once you have gotten comfortable with the abstracted interface, and have a need to go lower level, go for it. That being said, you may find Blockchain to propagate transactions more quickly than your own server since it has many many peers.</p>

CC BY-SA 3.0
2017-09-28T22:57:21.917Z
Ok, I thought to start in this way. Is this meaning that scrypt has the same expressivity of the Java library you suggest? Is there only difference in performance, can you confirm this?
alepuzio
CC BY-SA 3.0
2017-10-01T04:54:29.660Z
You can interact with bitcoin at a low level, e.g. https://en.bitcoin.it/wiki/Script, or you can do so at a high level, like blockchain.info, or coinbase.

Based on the identity management part, it's not clear to me you need to be working at a low level. The problem with running a bitcoin client yourself is that it takes some time to sync the blockchain, so if you want to code something today, I recommend a service, at least till you get a better idea of your goal.
nym
CC BY-SA 3.0
2017-09-26T23:36:22.830Z
2017-09-26T23:36:22.830Z
nym
<blockquote>
<p><strong>when is more convenient to develop an application coding in script and when is it better to use a high-level library like BitcoinJ or a service as Blockchain.info API?</strong></p>
</blockquote>
<p>Those are three different things usable only for very different purposes. They are not really alternatives to one another, they are not equivalent.</p>
<h3>Script</h3>
<p>Bitcoin script is not, as your question suggests, some high performance language and it does not have &quot;high sematic power&quot;. It is a deliberately crippled mini-language used only for expressing payment conditions attached to financial transactions. It is misused for hiding data in parts of scripts that can never be executed (i.e. parts that would be eliminated during coverage analysis in many conventional development environments). There is no way you could use Bitcoin script for complete applications of the sort that Java programmers typically use Java for.</p>
<h3>Java (and Python and C and C++ and Rust and Go ...)</h3>
<p>I don't need to describe Java. It is a general purpose language typically dependent on a run-time environment (JRE). As you noted, there are libraries that simplify (if that word can ever really be applied to Java libraries) the  use of Bitcoin RPC APIs, the use of Bitcoin network protocols and, probably,
the construction of Bitcoin transactions <strong>including creating locking scripts in Bitcoin script language</strong>.</p>
<h3>Blockchain.info API (and APIs of other businesses that offer access to an indexed copy of the blockchain)</h3>
<p>I'm not familiar with this API but it's range of capabilities must be very different from that of, for example, the JDK and Bitcoin libraries. It obviously involves trusting a corporation with any data you pass through it's  API. I would always remember that the main intent of Bitcoin was to create a system of electronic cash by which one party could pay a second party <strong>without the need for any trusted third party</strong>.</p>

CC BY-SA 4.0
2024-08-31T09:10:28.673Z
2024-08-31T09:10:28.673Z
RedGrittyBrick
<p>100% start with a library, BitcoinJ or equivalent.</p>
<p>You don't lose anything in regards to being able to create Bitcoin scripts and in fact will gain given the library will have all the Bitcoin opcodes and arguments already wired up.</p>
<p>I started with NBitcoin (C# equivalent of BitcoinJ) and found the ability to use the debugger to step through the Bitcoin consensus logic (NBitcoin has a port of the Bitcoin C++ consensus code) incredibly valuable.</p>
<p>If you start from the raw RPC, or an API wrapper on a website, you'll most likely spend a lot of time creating JSON models and methods for each RPC call. The library has already done all that for you.</p>

CC BY-SA 4.0
2024-09-01T21:37:19.670Z
2024-09-01T21:37:19.670Z
sipsorcery
<p>I would:</p>

<p>Install bitcoin on your local machine and run it regtest mode</p>

<p>Use a json lib to query the local bitcoin node. The RPC documentation here:</p>

<p><a href="https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs" rel="nofollow noreferrer">https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs</a></p>

<p>This seem as easy as learning a third party API.</p>

CC BY-SA 3.0
2017-10-01T04:56:32.937Z
When I originally took this approach we had to wait three days to get the blockchain synced, despite pulling a recent copy from bittorrent beforehand. Hopefully it's better these days!
nym
CC BY-SA 3.0
2017-10-01T08:16:23.193Z
the important part is to run it in _regtest_ mode. This it generates a fake local blockchain. Nothing to download. [Bitcoin Regtest Mode](https://bitcoin.org/en/developer-examples#regtest-mode)

You can get on with developing whilst your Production node is syncing.
erols
CC BY-SA 3.0
2017-09-27T11:26:05.230Z
2017-09-27T11:26:05.230Z
erols
<p>I'm curious about the development of application of Identity management in Blockchain platform, but I'm a bit confused about the technologies to use.</p>
<p>In short words, when is more convenient to develop an application coding in <a href="https://en.bitcoin.it/wiki/Script" rel="nofollow noreferrer">script</a> and when is it better to use a high-level library like <a href="https://bitcoinj.github.io/" rel="nofollow noreferrer">BitcoinJ</a> or a service as <a href="https://blockchain.info/it/api" rel="nofollow noreferrer">Blockchain.info API</a>?</p>
<p>I'm a Java developer and I'm more confortable using a Java Library like bitcoinJ, but I don't understand if, in this way, I can lose something in performance or expressivity or &quot;semantic power&quot; in regard to most raw-level scripting system of Bitcoin (that is a kind of assembler).</p>
<p>Thanks you in advance</p>

<development><script><library>
Bitcoin library vs script to develop application
alepuzio
# Bitcoin library vs script to develop application

(Asked by: username_0 on 2017-09-26)

I'm curious about the development of application of Identity management in Blockchain platform, but I'm a bit confused about the technologies to use.

In short words, when is more convenient to develop an application coding in [script](https://en.bitcoin.it/wiki/Script) and when is it better to use a high-level library like [BitcoinJ](https://bitcoinj.github.io/) or a service as [Blockchain.info API](https://blockchain.info/it/api)?

I'm a Java developer and I'm more confortable using a Java Library like bitcoinJ, but I don't understand if, in this way, I can lose something in performance or expressivity or "semantic power" in regard to most raw-level scripting system of Bitcoin (that is a kind of assembler).

Thanks you in advance

**Tags:** development, script, library


---

## 4 answers

### Answer by username_1 on 2017-09-26. Score: 0

Before you take on trying to use Script I recommend doing whatever you can with an existing API. I've used Blockchain.info's which has worked well.

Here's another API package for Java that might work for you <https://github.com/blockchain/api-v1-client-java>

Once you have gotten comfortable with the abstracted interface, and have a need to go lower level, go for it. That being said, you may find Blockchain to propagate transactions more quickly than your own server since it has many many peers.

> **Comments:**
> **username_0**: Ok, I thought to start in this way. Is this meaning that scrypt has the same expressivity of the Java library you suggest? Is there only difference in performance, can you confirm this?  
> **username_1**: You can interact with bitcoin at a low level, e.g. https://en.bitcoin.it/wiki/Script, or you can do so at a high level, like blockchain.info, or coinbase.  Based on the identity management part, it's not clear to me you need to be working at a low level. The problem with running a bitcoin client yourself is that it takes some time to sync the blockchain, so if you want to code something today, I recommend a service, at least till you get a better idea of your goal.  

---

### Answer by username_2 on 2024-08-31. Score: 0

> **when is more convenient to develop an application coding in script and when is it better to use a high-level library like BitcoinJ or a service as Blockchain.info API?**

Those are three different things usable only for very different purposes. They are not really alternatives to one another, they are not equivalent.

### Script

Bitcoin script is not, as your question suggests, some high performance language and it does not have "high sematic power". It is a deliberately crippled mini-language used only for expressing payment conditions attached to financial transactions. It is misused for hiding data in parts of scripts that can never be executed (i.e. parts that would be eliminated during coverage analysis in many conventional development environments). There is no way you could use Bitcoin script for complete applications of the sort that Java programmers typically use Java for.

### Java (and Python and C and C++ and Rust and Go ...)

I don't need to describe Java. It is a general purpose language typically dependent on a run-time environment (JRE). As you noted, there are libraries that simplify (if that word can ever really be applied to Java libraries) the use of Bitcoin RPC APIs, the use of Bitcoin network protocols and, probably,
the construction of Bitcoin transactions **including creating locking scripts in Bitcoin script language**.

### Blockchain.info API (and APIs of other businesses that offer access to an indexed copy of the blockchain)

I'm not familiar with this API but it's range of capabilities must be very different from that of, for example, the JDK and Bitcoin libraries. It obviously involves trusting a corporation with any data you pass through it's API. I would always remember that the main intent of Bitcoin was to create a system of electronic cash by which one party could pay a second party **without the need for any trusted third party**.


---

### Answer by username_3 on 2024-09-01. Score: 0

100% start with a library, BitcoinJ or equivalent.

You don't lose anything in regards to being able to create Bitcoin scripts and in fact will gain given the library will have all the Bitcoin opcodes and arguments already wired up.

I started with NBitcoin (C# equivalent of BitcoinJ) and found the ability to use the debugger to step through the Bitcoin consensus logic (NBitcoin has a port of the Bitcoin C++ consensus code) incredibly valuable.

If you start from the raw RPC, or an API wrapper on a website, you'll most likely spend a lot of time creating JSON models and methods for each RPC call. The library has already done all that for you.


---

### Answer by username_4 on 2017-09-27. Score: 0

I would:

Install bitcoin on your local machine and run it regtest mode

Use a json lib to query the local bitcoin node. The RPC documentation here:

<https://bitcoin.org/en/developer-reference#remote-procedure-calls-rpcs>

This seem as easy as learning a third party API.

> **Comments:**
> **username_1**: When I originally took this approach we had to wait three days to get the blockchain synced, despite pulling a recent copy from bittorrent beforehand. Hopefully it's better these days!  
> **username_4**: the important part is to run it in _regtest_ mode. This it generates a fake local blockchain. Nothing to download. [Bitcoin Regtest Mode](https://bitcoin.org/en/developer-examples#regtest-mode)  You can get on with developing whilst your Production node is syncing.  

---

